A very good wireless local area network (and personal) is undoubtedly the Bluetooth (BT). Today in our day-to-day is common to find us using cell phones, stereos, cameras, etc., interconnected with the help of the famous "blue little light”.

In the world of IoT and automation in general, it is very common find remote controls via mobile phones using BT technology. This is due to two basic components, but very important:

  • Simple Development Platforms for ANDROID apps (like MIT AppInventor2) and
  • Affordable BT modules (like HC-06)

In this instructable, I will develop some ideas about controlling Arduino’s outputs through a mobile device in order to move a Robot, turn on lamps on a house, etc.

Step 1: The Bluetooth Module and the Arduino

In the market is very common to find "Master-Slave" BT 3.0 modules as the HC-05 and "Slave" ones as the HC-06. More recently, appeared the HC-08 and HC-10 working with technology BT 4.0 or BLE ( "Bluetooth Low Energy"). The BLE modules are the only ones that can be connected to an iPhone, because unfortunately Apple does not provide support to BT 3.0.

For the projects discussed here, I will use an HC-06 that is very popular and cheap (Bye, bye, Iphone! Androids are kings here!). The BT module is powered with 5V which makes it to be easily connected to an Arduino UNO for example. His transmit (Tx) and receive (Rx) pins can be connected directly to the UNO, with no need of voltage dividers as we see in the case of ESP8266. Usually the HC-06 should be connected directly to pins 0 and 1 Arduino (“Serial 0”):

  • HC06-Tx to Arduino pin 0 (Rx)
  • HC06-Rx to Arduino pin 1 (Tx)

When using "Serial 0" inputs (the only HW Serial port at UNO), it is very important to remember that the HC-06 may not be physically connected to pins 0 and 1 during the program load, because the USB port also use the same serial. A simple way to get around this little problem (if your project does not use many GPIOs UNO) is to use a “SW serial port” through the library SoftwareSerial. In our case here, we will use the pins 10 and 11 of UNO (Tx, Rx respectively).

<p>Great!</p><p>You should change the strings that are in the Loop part of the code. I used Portuguese that it is my mother language and was easer to manage at Google due the different accent with my English. You should use short sentences or only words there . The important is a perfect match between what you wrote and with what the Google voice recognition app returns. </p><p>Thanks.</p>
<p>Thank you MJRoBot for the simple BT learning tool. Worked for me first time out except for the voice commands. I don't know what to say. ??</p>
<p>Nice but I can not make it work so that the leds go out when i tell them. I can turn them on but not off with voice commands. Any idea?</p>
<p>btw I use a HC-05 it works!</p>
<p>also, can you explain the voicecontroll code for the arduino, what exactly is going on?</p>
<p>i wanted to try this with the pic18f452 any idea how i could do it</p>
<p>it uses assembly code or c </p>
<p>great very easy with help</p>
<p>Thanks a lot!</p>
<p>Thanks a lot!</p>
<p>a great&hellip;&hellip;</p>
<p>Thanks a lot!</p>
<p>Very nice project! Thanks for sharing!</p><p>Can I use a HC-05 instead of HC-06?</p>
<p>I never used the HC-05, but it should work fine once it is a Master/Slave. The HC-06 is only a slave, so HC-05 works. Besides, both works with BT 3.0 (compatible with Android devices). As far as I know there are some differences regarding the AT commands response, but the HC-05 are superior, like respond with the device name, etc. </p>
<p>Thanks! I'm gonna try it and let you know the result.</p>
<p>Any tips for transferring large amounts of data faster than available via the serial port profile? </p><p>Most BLE applications I've seen are 250kbps, so I'd like to find some bluetooth classic (2.1 EDR) solution.. which should in theory support 2.1Mbps (probably using the FTP profile)</p>

About This Instructable




Bio: I am a Brazilian engineer, who rediscovered an old passion for electronics. I dedicate my time to learn and share with others, electronics, IoT and ... More »
More by mjrovai:When IoT Meets AI: Home Automation With Alexa and NodeMCU IoT Made Simple: Home Weather Station With NodeMCU and OLED Automatic Gardening System With NodeMCU and Blynk, the "ArduFarmBot 2" 
Add instructable to: