Arduino Programming With Bluetooth

Introduction: Arduino Programming With Bluetooth

About: I am a hobbyist. I love building stuffs and robots. Things I like - You, Wireless, Arduino, Servos, Jesus Things I hate - Wires, Batteries, Satan Things I wish - Roam around the world, meet different people an…

Hello people from across the world.

Programming Arduino everytime with USB might be a heck for many. Also many sites do provide the circuit for Bluetooth Programming, however they sound so complicated with many components and the special pin 32 soldering. I am pretty sure you hate to solder in such tiny areas just for the sake of a simple job. Below are the circuits by which you can program Arduino Uno and Pro mini and other boards with just a single capacitor. Go ahead

Step 1: Programming HC 05 Bluetooth Module

Materials

1. Arduino Uno or any board

2. Jumper Wires

3. Laptop with Arduino IDE

Connect HC 05 with Arduino as shown in the image.

Here is a simple overview of connections

Arduino (TX) --> HC 05 (TX)

Arduino (RX) --> HC 05 (RX)

Arduino (5v) --> HC 05(Vcc)

Arduino (GND) --> HC 05 (GND)

Arduino (Reset) --> Arduino (GND)

Now the crucial step --> I have HC 05 module with a button as KEY. So before powering Arduino press thee button and hold it. While holding it power Arduino and after 1s release the button. You will notice that HC 05 will blick slowly like 1 or 2 Hz frequency.

Now open Arduino IDE. Select your board and Voltage and COM Ports.

Go to the serial Monitor and select "Both NL and CL" and Baud Rate 38400 thentype

AT (You may receive error at first but type it again and you will receive OK else check your connections)

AT+ ORGL

AT+NAME=<Enter your desired name without brackets>

AT+POLAR = 1,0

AT+ ROLE = 0 //0 means Slave and 1 means Master

The UNO programs at 115200 baud, the Duemilanove (with ATmega328p) programs at 57600 baud. The Duemilanove with ATmega168 programs at 19200 baud.

AT+UART=<115200,0,0> //If you have Uno

AT +UART=<57600,0,0> //If you have Nano or Pro Mini

AT+ PSWD = <Your desired password>\

AT+INIT

The baud rate of Pro Mini and Nano bootloader is 57600 hence the baud rate of HC 05 must also be same inorder to talk to bootloader.

Step 2: Connect HC 05 With Arduino

Now connect Arduino with HC 05

Arduino (TX) = HC 05 (RX)

Arduino (RX) = HC 05 (TX)

Arduino (5v) = HC 05 (Vcc)

Arduino (GND) = HC 05 (GND)

Arduino (RESET) = Capacitor (22nf) = HC 05 (STATE)

Remember you need a voltage divider if your arduino is 5v rated since HC 05 TX & RX are 3.3v rated.

If you need a divider then Resistor would be 10k and 15k and TX of Arduino would move to the joint of the resistors. No divider needed for RX.

So the Voltage = [15k/(10k+15k)]*5 = 3v for HC 05 :)

In case of Pro Mini 3.3v 8 Mhz your are lucky as we don't need any divider.

There is a second model where a transistor is adder. I used BC547B. You can use any NPN. The resistor used here is 10k

Step 3: Connecting HC 05 With Laptop

Now search you Bluetooth device with your laptop and pair it.

If you have windows then after pairing

Click Bluetooth ICON (Right Click)

Click Open Settings

Click "More Bluetooth Options"

Click "COM Ports"

Note down the port with your device name referring "Dev B"

Now for Windows 10 users RUN ARDUINO IDE as ADMINISTRATOR then select your board and voltage rating and select the "Dev B port" Click Upload

Else you would recieve error avrdude : COMxx Access Denied

Windows 8.1, 8 7 users no problem.

MAC -- No Problem

Wait for a second and voila !!

I am assuming that you know how to pair a device. HC05 will blink once and fastly when paired. It will blink twice when you start UPLOADING means CONNECTED

You can choose the ONLY CAPACITOR method or Transistor method. No soldering required for PIN 32

So Long

Cheers

Step 4: Serial Monitor

To use the serial monitor for serial data display you can enter Arduino IDE-->Tools --> Serial Monitor. It is simple and data will be received. Don't forget to select the correct com port.

To upload code from Android simple download Bluino Bluetooth App. The Slide left and click on boards. Choose your board and enable the bluetooth option from there. The click on the arrow inside circle icon. It will compile and then you will have to select your bluetooth device. It will show uploading status and will end with Uploaded status. Success..

To have the serial monitor for Android download Talking Serial Monitor. Click the thunder bolt icon and connect with HC05 and voila !! you will receive your data.

iOS users. Its just pain in a**. I can't connect it with my iPhone, iPad as well. Since iOS doesn't support HC 05 services. If it does do tell me guys.

Be the First to Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    7 Comments

    0
    kunal7
    kunal7

    Question 1 year ago

    Hey i was trying the same method with latest version of Bluetooth and Arduino nano (old bootloader)
    AT+POLAR=1,0
    ERROR(0)
    AT+VERSION?
    +VERSION: 4.0-20191010
    I think for this version there are different AT Commands. If you know anything please help!

    0
    MonteCristo94
    MonteCristo94

    Answer 2 months ago

    Hi! I got the same 4.0 bluetooth with the same problems. (AT+POLAR does not working, AT+INIT too).

    I have tried really everything, and now i say ok, now i can use it for programming an uno, although with a trick.

    I created the same circuit with transistor which is in this article. My experience is that, the 100nF is 'nothing'. I needed to connect 10 uF, but i did not change the 10k resistor. I tried some transistors which were available for me. Do not try with any 'tricky' one like darlington. Finally i use BC547.

    Story has no end yet. After i changed some transistors and capacitors, i was so close to give up, but after a lot of try (power off-on UNO+HC-05, restart windows, connect, unconnect etc..) Once the program uploading was succesfull. After some tries i think, windows and HC-05 pairing sometimes not successfull, but windows thinks it is... When once the upload was succesfull, i restart windows, restart UNO+HC-05, power off-on etc., and i still able to programming via bluetooth. But if i unconnect the HC-05 in the windows options and reconnect, it is over.
    (I use windows 8.1 and the reason not try under linux is that, i made this tool for a windows user.)
    (Little bonus tips:
    - If your windows creates COM5 and COM6, then choose COM6 in ArduinoIDE.
    - When you want to put this device to AT mode, connect 5V to the enable pin under the whole process).
    Good luck to everyone, and never give up, thank you for this usefull article!

    0
    bheadley58
    bheadley58

    Tip 4 months ago

    For iPhone (iOS v10 or higher) use, you might need the HM10 BLE module

    0
    bheadley58
    bheadley58

    Question 4 months ago

    In regards to the Arduino Uno R3 implementation:
    1. Are the external regulators necessary?
    2. Are the regulator part numbers? LF33, LF50, LM7805?
    3a. Would it be possible to connect a wall wart or 9V battery & snap adapter to the Uno power connector (and eliminate the regulators)?
    3b. Would it be possible to connect a cable between the Uno USB port and a standard smartphone power adapter (also eliminating the regulators)?
    4. Why are the voltage divider resistors needed? I believe the HC05 and Uno devices are powered from 5V ..
    5. The capacitor implementation will work, as long as both the HC05 and Uno are at the same VCC levels, otherwise there will be 5V output pulses applied to a 3.3V input, along with possible framing errors at the end of a serial transmission.
    6. Is jumpering GND pins together on the Uno necessary?

    I believe the idea of Bluetooth programming of the Uno is to eliminate the USB tether and/or the need to remotely program it, so I assume the Uno will be powered from an external source (which is what I have in mind).

    And I'm surprised that nobody makes a simple adapter that plugs into the Uno USB 'B' port for this very purpose ..

    0
    DouglasT29
    DouglasT29

    3 years ago

    Will this same Bluetooth module be able to be used for controlling the Arduino or does the configuration changes made to the Bluetooth module require another module to be used?

    0
    Suman_Shashi
    Suman_Shashi

    Reply 3 years ago

    Yep of course! you can control with the same. No configuration changes required. You can use it as wireless serial monitor too.

    Just use Serial.begin(xxxxx); in setup. Replace xxxxx with the correct baud rate (same as the bootloader baudrate) of your Arduino Board and you are done