Introduction: Bluetooth Serial Adapter for Pro Mini
This is how to make a wireless FTDI-like adapter for 5V Pro Mini. FTDI is actually a brand of chips, and serial adapters used for programming Arduinos are often informally called FTDI adapters, even if they use other brands of chips. Since I have a Mac with built-in Bluetooth, I like to go wireless.
You can upload sketches to the Pro Mini, and interact with the Pro Mini via the Serial Monitor.
Step 1: Pick the Bluetooth Transceiver
I like these HC-05 modules sold on eBay. You can get them post-paid for $1.75 to $4.50 USD. I recommend getting one with 3 features:
- State pin available on the header
- Key button to put it in programming mode
- Onboard regulator to allow powering via Arduino 5V
Recently, I have seen on eBay some boards that are shorter than most, and you can tell from the pictures there no circuitry between the HC-05 stamp-shaped module and the header pins. Unless there is circuitry on the back, these are the ones that do not have the 3.3 V regulator onboard, and they don't have the Key button. I recommend paying attention to the photo of the board to get the best one. Ask questions of the seller if you are not sure, including asking for photos of the back side of the board if it is not shown in the listing.
This Instructable covers using the HC-05 module, not HC-06, which is programmed differently.
Step 2: Program the Bluetooth Transceiver
Set the Bluetooth transceiver to 57600 baud, and give it a name and password so you can pair it with your computer and communicate with the Pro Mini. The schematic and picture show the wiring and show using an UNO for this.
The UNO can be running a sketch that does nothing with the Serial port, such as the Blink sketch, or you can connect the Reset pin to GND to make the UNO main processor do nothing. We are just using the USB-to-serial adapter on the UNO to communicate with the Bluetooth transceiver. You could also use an FTDI adapter to program the transceiver.
Hold the Key button on the Bluetooth transceiver down while you connect the Arduino to the computer to power it up. After power up you can release the button. The LED on the transceiver will blink slowly to indicate it is in programming mode and it is listening for commands at baud rate to 38400.
Open the Serial Monitor window. Set the Line Ending to Both NL & CR and baud rate to 38400. Enter AT on the send line and click Send. It is all right if the response you see to the first AT command is ERROR. Just send AT again and it should then respond OK. You can enter AT commands in lower or upper case. You should see an OK response in the Serial Monitor for each command. You will not see the command you enter repeated back to you in the Serial Monitor, you will only see the OK responses. Enter these commands and see the responses:
at OK at+orgl OK at+role=0 OK at+polar=1,0 OK at+uart=57600,0,0 OK at+name=Arduino OK at+pswd=1234 OK
Close the Serial Monitor window and disconnect the Arduino to remove power. Reconnect the Arduino to the computer to power it up. Go into your System Preferences or Control Panel on your computer and pair the Bluetooth transceiver with your computer using the password you programmed into the transceiver as the pairing code.
Your Bluetooth transceiver is now prepared for use with Arduino. It is programmed for baud rate 57600, which is the baud rate of the bootloader on the Pro Mini. If you need a different baud rate, follow the same procedure above, except change the at+uart command to program your preferred baud rate. The transceiver name Arduino shown above is an example. You can name it whatever you wish. You can also program it with whatever pairing code you wish.
Step 3: Glue Header and Resistors to Bluetooth Transceiver
Cut the shrink-wrap plastic off the Bluetooth transceiver. Desolder, remove, and discard the header from the Bluetooth transceiver. I find it easiest to cut the pins off at the bend so they are flush with the plastic standoff that is part of the header. Then pry the plastic standoff loose and discard it. Now you have individual pins exposed that you can grab one at a time with needle nose pliers, heat each solder joint one at at time, and pull the pin out, and move on the the next pin. Heat each solder joint as quickly as possible and remove heat as soon as possible after removing the pin.
Use some general purpose adhesive to glue a 6-pin single-row female header and 15K and 10K resistors on the back of the transceiver. Point the resistors towards the RX pin, because that is where the connection will be made. The 15K resistor is closest to the RX pin and the 10K resistor is closest to the TX pin.
Note: The wiring I did was to connect to a derivative Pro Mini and the header is oriented so the Bluetooth transceiver faces up. I would reverse the positions of the resistors to reverse the orientation of the header for a SparkFun Pro Mini, so the 10K resistor is closest to the RX pin and the 15K resistor is closest to the TX pin. See the next step for more information about the header pin differences between SparkFun Pro Mini and derivative Pro Mini.
Let the glue dry.
Step 4: Complete Wiring
Wire to the female header to connect:
- TX of Pro Mini to RX of HC-05 through the voltage divider resistors
- RX of Pro Mini to TX of HC-05
- VCC of Pro Mini to VCC of HC-05
- BLK or GND of Pro Mini to GND of HC-05
- GRN or DTR of Pro Mini to State of HC-05
Derivatives sold on eBay often have reversed pinouts on the programming header, compared to the original SparkFun model, as seen in the picture above. I like to wire mine so the top side of the HC-05 is facing up when plugged into the Pro Mini. If you wire the female header on the HC-05 for a SparkFun Pro Mini, to use it on a derivative you will flip it over and plug it in. I recommend putting a spot of green paint on the DTR side of the header to remember the orientation.
Step 5: Verify 5V Is Available on the Pro Mini Header
Another difference between SparkFun and derivatives: some derivatives have a diode added to the circuit that prevents VCC from flowing towards the programming header. The programming header can provide power to the Pro Mini, but the Pro Mini can't provide power to the programmer. This is an additional component that is not on the official Pro Mini schematic on the SparkFun website. I have a derivative board, so I added a small wire to short the diode. This allows the Pro Mini to power the Bluetooth transceiver.
Step 6: Plug It In
The wireless adapter is complete. Plug it in to the Pro Mini header, connect a battery to the RAW input, or connect a regulated 5 V power supply to the VCC pin of the Pro Mini. Choose the Bluetooth adapter in the Arduino IDE Tools, Port menu. Choose the Pro Mini in the Tools, Board menu. Upload a sketch.
If you include any Serial statements in your sketch, you will need to use Serial.begin(57600); in your setup because the Bluetooth adapter does not dynamically change baud rates.
Step 7: Further Reading
To make an adapter for a 3.3V Pro Mini, you can omit the voltage divider resistors and buy the HC-05 module that does not have the onboard regulator.
To see more details about the HC-05 modules, or to use a Leonardo or other ATmega32U4-based Arduino to program the HC-05, see my other Instructable where I have included more details.
More info:
https://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/
Now that you have a wireless Arduino, you can use it as a wireless ISP programmer. Note that as of Arduino IDE 1.6.6 and later from arduino.cc, you have the ability to set the baud rate in the ArduinoISP sketch. For earlier versions of the ArduinoISP sketch, should you have the need to use an old version for some reason, you can edit the sketch to allow higher baud rates:
15 Comments
2 years ago
I am interested in creating a bluetooth to serial adapter for controlling a amateur radio. Would it be as simple as using an HC-05 to the DB-9 or would I need to do additional signal conditioning?
Reply 2 years ago
Additional signal conditioning. I recommend ask your question on a forum such as https://forum.arduino.cc/ and give as much information as possible about the ham equipment you are wanting to connect to and what you expect to accomplish.
Question 3 years ago on Step 7
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!
Answer 3 years ago
This only works with an HC-05 module. You may have something else, such as an HC-06.
Reply 3 years ago
This is the at command response of the Bluetooth module i have
AT+NAME?
+NAME:HC-05
OK
AT+VERSION?
+VERSION:4.0-20190815
OK
**AT+POLAR**
**ERROR:[0]**
AT+UART?
+UART:9600,0,0
OK
The problem I am facing is I am unable to change the state pin with AT+POLAR command. I think this version of bluetooth has different AT Commands.
Reply 3 years ago
That is interesting. I don’t know a solution. I suggest try resetting to orgl settings, try lower case commands, try with and without spaces around the = sign, try separating the 1,0 with period as in 1.0, search the internet for documentation on that firmware version, and perhaps contact the seller for documentation on the polar command. If most HC-05 modules are coming out this way, my article may be no longer useful.
Reply 3 years ago
Not a lot of hc-05 were coming like this. Very recently we got this hc-05 and believe me the older version is not available in the market. I searched all over the internet for the documentation for this version. Where would you recommend to look up for the documentation? I also tried lower case a lot of other things but still no success. I dont know the source seller as it came through a channel of distributers.
Also, the baud rate that I would recommend for latest versions of Arduino Nano would be 115200 as arduino has also updated the version of their bootloader.
6 years ago
Nice project.
Just one comment, you create an connector on the antenna side of the bluetooth module, I doubt this is a good idea because it can limit range or can cause connection problems because of the metal of the pins are very close to the antenna.
Just a question. By doing this, is the bluetooth module still usable as normal serial port and on different speeds?
Reply 6 years ago
I have not found it a problem to have the connections near the antenna. In theory, it may be a problem if you are looking at getting the absolute maximum range out of the module.
These cheap bluetooth modules can be used at any typical speed, but they must be programmed to use one specific speed between the module and the Arduino, and manually reprogrammed each time you want to use a different speed. So, the speed your sketches work with must be the same as the speed the bootloader works with, if you want to use the bluetooth for both programming and then immediate interaction with your sketch via the serial monitor. For example, if you are programming a typical 16 MHz Pro Mini that has a 57600 BPS bootloader, and your sketch interacts with you at 57600 also, you will find this adapter is very much like using a wired serial adapter.
You will notice it does not matter what speed you set the computer's comm port to in the serial monitor, because that speed is only for communication between your computer and it's built in bluetooth adapter. The speed you set your computer's comm port to is really not used at all, since the computer's bluetooth adapter should be using an internal USB connection and only partially emulating a serial port. The speed in that part of the communication between the computer and its bluetooth adapter, and also over the air between bluetooth modules happens as fast as possible and at rates much higher than typical serial speeds.
For dynamic speed change that changes at the Arduino end when you change the speed of the port on your computer, you would need a fancier and more expensive bluetooth module such as an Adafruit Bluefruit module.
6 years ago
Hey,
I tried with 3.3v pro mini and HC05 with regulator but powered HC05 with external 5v supply. But I am unable to upload sketches.
I get the error:
avrdude: ser_open(): can't open device "\\.\COM6": The system cannot find the file specified.
What should I do now ?
Reply 6 years ago
You just selected wrong USB port of computer. Go to tools, port, and select the right one.
6 years ago
Very thorough and detailed instructions. Fantastic. Thank you very much. I made it and it works like a charm.
7 years ago
Thanks so much for your guide, it has been so much help. I was not able to get the at command working as per your instructions, instead successfully used a sketch to change the rx/tx pins on my uno: https://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/
Your method for uploading sketches to a mini worked perfectly.
7 years ago
Hi im not able to upload the program to the arduino some error like there is no response from the programer i tried difetent boards diferent hc-05 and diferent computers and also a capacitor and a resistor to ground for state pin iam using a 3v3 pro mini original is there any advice or hint you could give me
Thanks
Max
Reply 7 years ago
Yes, I recommend posting your question on the arduino.cc forum, it looks like the section "Networking, Protocols, and Devices" would be appropriate. Include information such as how you have each pin wired, include a diagram (hand drawn is fine), include a photo of your Pro Mini and the HC-05 module, and include information about how you configured the HC-05 when you were in AT mode and setting it up. Also confirm the Pro Mini accepts uploads when used with a regular wired FTDI adapter.