← सभी पोस्ट ब्लॉग पोस्ट

Arduino के साथ Bluetooth Module कैसे use करें

Viktoria Builds

HC-05 Bluetooth module को Arduino Mega से जोड़ने और Android phone से serial messages भेजने की एक quick guide।

YouTube पर देखें

HC-05 Arduino project में wireless control add करने के सबसे आसान तरीकों में से एक है। मैंने इसे अपने Arduino Mega से connect किया और Android app से Bluetooth पर messages send किए — कोई cable नहीं, कोई Wi-Fi setup नहीं।

Parts

  • Arduino Mega
  • HC-05 Bluetooth module
  • Jumper wires
  • Android phone जिसमें Serial Bluetooth Terminal app install हो

Wiring

HC-05 में 6 pins हैं, लेकिन सिर्फ चार चाहिए: GND, VCC, TX और RX। VCC को Mega के 3.3V से, GND को GND से connect करें, और data lines cross करें — HC-05 का TX Arduino के RX से, और HC-05 का RX Arduino के TX से जोड़ें। Arduino Mega यहाँ convenient है क्योंकि इसमें multiple hardware serial ports हैं (Serial1, Serial2, Serial3), इसलिए Bluetooth module computer की USB connection वाले port से share नहीं होता।

Sketch

Sketch, Serial को USB monitor के लिए और Serial1 को Bluetooth module के लिए initialise करती है। Loop में Serial1 पर received सब कुछ Serial पर forward होता है, इसलिए phone app में type किए messages Arduino serial monitor में दिखते हैं। पूरी sketch GitHub पर है: viktoriabuilds/bluetooth-module-arduino.

Pairing और Testing

Arduino on करें, phone की Bluetooth settings खोलें और HC-05 से pair करें। Default pairing PIN 1234 है। फिर Serial Bluetooth Terminal खोलें, HC-05 से connect करें और message type करें — वो तुरंत Arduino serial monitor में दिखता है।

Result

पहली बार में ही काम किया। HC-05 सस्ता है, आसानी से मिलता है और setup करना surprisingly simple है। अगर आप Wi-Fi configuration की झंझट के बिना किसी project में wireless control add करना चाहते हैं तो यह एक अच्छा starting point है।

यह ट्यूटोरियल पसंद आया?

Patreon पर चैनल को सपोर्ट करें और प्रोजेक्ट्स, बिल्ड लॉग्स और बहुत कुछ तक जल्दी पहुंचें।

Patreon पर सपोर्ट करें →