Industriële fabricage
Industrieel internet der dingen | Industriële materialen | Onderhoud en reparatie van apparatuur | Industriële programmering |
home  MfgRobots >> Industriële fabricage >  >> Manufacturing Technology >> Industriële technologie

Bluetooth interfacing met Arduino: praktische handleiding voor HC-05/HC-06 modules

Veel Arduino-starters weten niet dat er uitbreidingsmodules zijn. De populaire Arduino Uno heeft geen ingebouwde Bluetooth. Boards met Bluetooth (Arduino BT, Raspberry Pi 4) zijn duurder, groter en minder leuk. De oplossing: een Bluetooth-module koppelen. Deze gids laat zien hoe je je microcontroller draadloos koppelt met smartphones/computers.

Wat is Bluetooth interfacing?

Bluetooth interfacing met Arduino: praktische handleiding voor HC-05/HC-06 modules
Bluetooth sensor, breadboard en Arduino Uno

Bluetooth is de meest gebruikte draadloze standaard voor korte afstand (datauitwisseling). Wi-Fi is voor lange afstand. Bluetooth 5.2 haalt 400 m met 2 Mbps. Toekomstige versies: verder, sneller. Elke keer dat je je telefoon koppelt, doe je Bluetooth interfacing. Microcontrollers zonder Bluetooth hebben een module nodig.

Bluetooth modules: HC-05 vs HC-06

Bluetooth interfacing met Arduino: praktische handleiding voor HC-05/HC-06 modules
Bluetooth modules

Modules (ook 'Bluetooth sensors' genoemd) koppelen je microcontroller/SBC aan externe apparaten. Alleen nodig als je board geen Bluetooth heeft. Meest gebruikt: HC-05 en HC-06.

Je ontvangt een groen printje op een blauwe breakout-board met pinnen voor breadboard-gebruik.

In slave-modus werken HC-05 en HC-06 identiek. Maar: HC-05 kan schakelen tussen master en slave, HC-06 is alleen slave. Wil je twee Arduinos met elkaar laten praten? Kies HC-05 (master initieert verbinding).

Pinout van een Bluetooth-module

Op de achterkant: VCC, GND, RXD, TXD.

  • VCC / GND – Voeding (3,6–6 V veilig)
  • RXD – Ontvangt data (ingang module)
  • TXD – Zendt data (uitgang module)

HC-05 extra: EN (Key) en STATE pinnen. Datapinnen vereisen 3,3 V logica (spanningsdeler nodig bij 5 V Arduino).

Hardware aansluiten: Arduino + HC-05 + Telefoon

Bluetooth interfacing met Arduino: praktische handleiding voor HC-05/HC-06 modules
Bluetooth sensor

Componenten

  • HC-05 of HC-06 module
  • Breadboard
  • Arduino Uno
  • 2,2 kΩ en 5,7 kΩ weerstand (spanningsdeler voor RXD)
  • Massieve draad
  • Arduino IDE

Aansluitschema

  1. Arduino 5V en GND → breadboard voedingsrails → module VCC en GND.
  2. Arduino TX (pin 1) → spanningsdeler (2,2k + 5,7k naar GND) → tussentap naar module RXD. (Module vereist 3,3 V logica!)
  3. Module TXD → Arduino RX (pin 0) direct (3,3 V is voldoende voor Arduino HIGH).
Bluetooth interfacing met Arduino: praktische handleiding voor HC-05/HC-06 modules
Arduino Uno met HC-05 module

Software: Bluetooth terminal sketch

We schrijven een sketch die luistert naar Bluetooth-data en deze via de seriële monitor toont.

Bluetooth interfacing met Arduino: praktische handleiding voor HC-05/HC-06 modules
Bluetooth terminal sketch deel 1
Bluetooth interfacing met Arduino: praktische handleiding voor HC-05/HC-06 modules
Bluetooth terminal sketch deel 2

Stappen

  1. Include SoftwareSerial.h (voor extra seriële poort op digitale pinnen).
  2. Definieer pinnen: bijv. RX pin 9, TX pin 8.
  3. Instantieer: SoftwareSerial BTSerial(9, 8); (RX, TX).
  4. setup(): pinmodes, Serial.begin(9600), BTSerial.begin(9600) (standaard baudrate HC-05).
  5. Twee String variabelen voor berichten.
  6. loop(): while (BTSerial.available()) → lees karakters tot puntkomma (;) → print naar Serial Monitor.

Koppelen met telefoon

  1. Arduino aan → module knippert rood (pairing modus).
  2. Telefoon: Bluetooth instellingen → zoeken → selecteer module (meestal "HC-05").
  3. Pair-code: 1234 (standaard).
  4. Installeer Serial Bluetooth Terminal app (klassiek Bluetooth compatibel!).
  5. PC: Arduino IDE → Serial Monitor (9600 baud).
  6. App: selecteer Arduino project → type bericht + puntkomma (;) → verzenden.

Je ziet het bericht in de Serial Monitor en op de telefoon. Succes!

Samenvatting

Deze basisproject is ideaal voor beginners. Uitbreidingen: drukknop, onboard LED, DC-motor, e-mail versturen. Vragen? Neem contact op!

Industriële technologie

  1. Arduino Mega koppelen aan een NEO‑6M GPS-module: stapsgewijze handleiding
  2. De nRF24L01 onder de knie krijgen: Draadloze communicatie, Arduino-integratie, schema's & code
  3. PIR Bewegingssensor: Werkprincipe & Arduino Integratie Handleiding
  4. Veelvoorkomende vallen in data-analytics projecten vermijden — Een praktische gids
  5. Elektrische schema's snel maken met E3.series
  6. Panelroutering beheersen in E3.series met filters
  7. Vervullingsefficiëntie verhogen door overtollige voorraad te kappen
  8. Bluetooth Mesh-ontwerpkeuzes: Module vs. discreet apparaat
  9. Python Modules: Aanmaken, Importeren en Geavanceerd Gebruik
  10. Python-modules: Je code organiseren voor duidelijkheid en herbruikbaarheid
  11. Java Interfaces Uitgelegd: Hoe Ze Te Definiëren en Implementeren met Praktische Voorbeelden