I wanted to download sketches from the Adrino IDE to my uno without the usb cable.
I wanted to tweak sketches in a robot without carrying it to my bench as the uno is inside a sorta sealed box. After reading many articles The best way is with Bluetooth. The best source I found was Instructables under "program an arduino wireless over Bluetooth by webgeeks" please visit their instructable.
THEY DESERVE ALL THE CREDIT FOR THIS.
The problem is they probably did this in fifteen minutes blindfolded, and it took me 3+ days. They left out details that a first timer would not know. If you need detailed help, here are all my many mistakes. I don't know much about bluetooth or windows10 so don't ask for further information. You can expect to use Arduino IDE without other downloads. The range of Bluetooth is short, around 30 feet. Once connected it all works just like the usb cable and the serial.monitor works too! The biggest downside is the cost of the HC05 around $7-10. So every project doesn't need this.
The steps involve ONE HC05 and ONE pro-mini (or uno). You load the uno with a
sketch that allows changes to the HC05. Then connect and program the HC05. Then rewire the HC05. Then pair the same HC05 to your computer. (this was the hardest). Then open The IDE and select the correct com and download the sketch. Looking at the article pictures I was wrong to think that TWO HC05 were used and they talked to each other through the computer connected to the uno.
Step 1: Load UNO With Sketch
Use any arduino type board and load the sketch " AT_mode_sketch ".
This sketch will allow changes to be made in the HC05 by typing AT
codes through the serial.monitor.
Step 2: HC 05 Not the HC 06 Connections
The HC05 is picture here. I used the newer one with 'STATE', 'EN' and a switch .
The switch that dose nothing. Many tutorials show soldering wires to pins 32-24 don't bother.
The 'STATE' pin resets the uno
The 'EN' will put the HC05 into AT mode.
The blinking led displays 4 modes.
1. fast blink = is trying to pair or paired without data flowing.
2. one slow blink-pause = is AT mode
3. two slow blink = paired
4. no led = paired and talking I guess. this 'no led' is confusing.
Connect as shown to the uno with the 'AT_mode_sketch'.
HC05 EN to ARDUINO pin 9
HC05 TX to ARDUINO pin 10
HC05 RX to resistor divider at ARDUINO pin 11 (ok to make 2.2k from 2ea 1k)
HC05 vcc to vcc 5V ok
HC05 ground to ground
Step 3: AT Commands in CAPITALS
Connect and power up through the usb cable to the IDE. The HC05 will blink fast if all ok even though you connected the EN pin and uno switched it high. If for some reason the HC05 is blinking slowly then you lucked out. Pull the vcc (5V) from the HC05 ....wait 2 sec ...plug back and the HC05 should go into the AT-MODE as shown by the slow blinking led....this is a MUST.
on the serial.monitor check these settings:
baud rate 9600 and both NL and CR window (not no line ending.... will show no response)
With the computer, open the IDE serial.monitor (a reset will happen) and should show 'Enter AT commands:'
Use caps for these commands!
2...AT+ORGL... response ok
3...AT+ROLE=0 ...response ok
4...AT+POLAR=1,0 ...response ok
5...AT+UART=115200,0,0 ...response ok
my biggest mistake, This is the speed to talk to the micro. The IDE sets this when choosing a board under tools. I used a pro-mini at 3.3v and the speed is 57600 The IDE automatically knows this. Here you MUST match the correct speed for any other type board.
I don't have a clue where to find this info ! So if a regular uno 115200 or pro-mini 3.3v 57600
AT+BAUD=115200,0,0 : Change baud rate to 115200 (Arduino Uno, Bluino and Mega2560)
AT+BAUD=57600,0,0 : Change baud rate to 57600 (Arduino Nano, Leonardo, Micro, Pro Mini 3V3/5V and Duemilanove)
6...AT+INIT ... response 17 error,, says already initialized
HC05 unplug and ready for next step to re-wire to the uno you want to upload to.
In my 3 days of frustration i found this GOOD step by step chart of AT commands and good descriptions. (more stuff i'll never learn) PDF EGBT-045MS-046S.....
Step 4: AT Programed HC05 to Computer to Be Paired
You can just supply 3volts to the HC05 to pair or go ahead and connect to the uno you want to download sketches to. This is HC-vcc to uno-vcc......HC-ground to uno-ground.....HC-TX to uno-RX....HC-RX to uno-TX HC-STATE to a 0.1 disk cap (104) to uno-reset. state o-----||-----o reset
If you use a pro-mini at 3.3v connections are direct. If using a 5v micro you must divide the RX pin on the HC05 by using the same resistors shown in step2 RX o---www---o----www----o ground 1k | 2k TX- uno pin
These connections are through the TX and RX uno pins. (pin 0 and pin 1). Just like the FTDI adaptor that plugs into a pro-mini edge connector. Because these pins are exclusive to loading sketches you should never use the. If your sketch uses them they may not allow communication for loading from the IDE.
With all connected and power up, the HC05 will fast blink and try to be paired to your computer.
On the computer with windows10 open settings >> devices >> add bluetooth >>
A black box shows....add a device >> bluetooth >> then H-C-2010-06-01 should show up or the name of the HC05 module you have. Select it and you will get a password prompt to enter 1234
This should now become paired. (yea almost done) This is photo one and the pointer is at more bluetooth options. Open this option. photo2 check box Allow bluetooth device to find this pc. photo3 shows com tab opened and states which com port HC05 is tied to. WRITE COM NUMBER DOWN.
Repeat this step until you are paired and have a confirmed com port number. I had several devices (headphones...etc) showing on the paired screen. This kept me from pairing to the HC05. even after many attempts. I removed all devices and added the HC05 in order to get to this point. You may be lucky.
Step 5: IDE Download
I have my HC05 powered by a battery and away from the computer. You may be using the computer usb cable to power the HC05 and uno. To really confirm that the HC05 is pairing and not the usb sending data think about separating from the usb and use a battery. After all this is your goal.
Open ARDUINO IDE to the blink sketch. Because all unos have blink as a default I like to change the sketch delay() times from delay(1000) to delay(50) in both delays. If successful this will change the uno led to blink fast. Open tools and select your board/speed/. Then you should see a selection of com ports. the port number you wrote down from the last step MUST be on this list. Select that port. Last step is upload via the upload arrow next to the check mark.
The HC05 is blinking fast while you do all this but as soon as the IDE starts to send the sketch the HC05 will stop blinking and go out. The sketch will load into the uno and the uno led will flash quickly. Then the HC05 will go back to a fast blink as long as it has power or another upload. You can even include a Serial.print("anything); and open the IDE monitor and see "anything" printed. Dont forget to Serial.begin(9600); in setup().
Step 6: PROBLEMS........
The arduino IDE will give general errors and trying to solve a failure to upload using these codes and descriptions is very hard. It is better to recheck the above steps and confirm each one. If AT commands were not sent correctly or the uart rate is wrong avrdude will give the same errors. Same is true if not paired and timed out or you chose the wrong micro in the IDE tools. The other problem is not having a HC05 module that pulses the STATE pin in order to trigger the cap connected to the uno reset pin that resets the uno. in preparation to load a sketch. Use the same uno connected to the usb and upload sketches to confirm it can be done. Then repeat the steps. I have played with ARDUINOs for five+ years. Most articles work as shown but when they dont I usually find fault with what I did wrong. And sometimes researching other peoples articles you get another point of view. This is not a hoax project. Replacing the usb cable makes uploading easy and convenient.
Oh here are some ideas for the two dollar pro-mini. I made an adapter (just switched the vcc and ground) to plug into the edge connector where the FTDI usb cable went. Now I just plug in the HC05 bluetooth and download away.
HOPE THIS HELPED jim