How to flash an Arduino over the Air with Bluetooth

As mentioned in the previous article i wanted to figure out how to connect the Arduino over Bluetooth to my Mac, including flashing the device.
I managed to get the serial console over the air with the HM-13 module as described before, but unfortunately flashing seemed to be a bit of an issue.
This is because the Arduino needs a clean reset signal which usually comes out of the DTR-Line of the module. But: most BT-Modules (and FTDI-Cables etc.) do not make this port available.
But i found three solutions that work nevertheless.
1. easiest and most straightforward, but also most expensive: buy the EZ-Link module from Adafruit. It has the DTR pin (don’t forget to use a 100nF ceramic capacitor “104” to connect to the reset pin) and everything works well just out of the box. This module also has an automatic baud-rate detection and some other useful features like voltage regulation both for power and the TX/RX Pins. The other modules below require 3.3 voltage for power and also for the logic, so be careful if you plan to work with a 5v controller like the UNO.
2. the RN-42 BT Module comes with a DTR-Pin as well, but unfortunately it has a reverse signal on that pin – when it should be high it is actually low and vice-versa. If you want to use it nevertheless you have ot apply an invert circuit or buy an inverter module. You can find a nice explanation on this and the module in general in this video. Although i believe from the video that this setup can work, it did not for me – the DTR-PIN just did not generate any signal…
3. You can also use the above mentioned HM-13 module from Seeed – although it does not have the DTR PIn available. I used a nice little hack described here to make it work. Just reuse the status-led pin to trigger the reset signal! To do this you have to use a short AT-Command on the module “AT+PIO11” which will tell the module to shut off the LED when unconnected and turn it on while connected. This again has to be inverted to be useful as a reset-signal, but if you do so it really works (other modules like the HC-05 for instance even make this available via another AT-command, so no inversion is needed here). The good thing with this solution: the HM-13 is a dual-mode BT-Module which can work as classic BT to simulate a serial connection _and_ as BLE Module at the same time!

Advertisements

About holadiho

stephannoller.eu
This entry was posted in Allgemein. Bookmark the permalink.

One Response to How to flash an Arduino over the Air with Bluetooth

  1. Lutze says:

    Man muss halt aufpassen das die Teile sich nicht schlafen legen. Hatte heute auch den ganzen Tag gefummelt.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s