Is it possible to upload a program to Arduino via Bluetooth?
Anyone who uses Arduino in their projects will sooner or later wonder about this.
Is it possible to upload a program to Arduino wirelessly?
A.: Yes, it’s fully tested, proven, and explained in this post.
To begin with, in this case, “wirelessly” means a Bluetooth connection. The tests were conducted using an Arduino UNO R3 and an Arduino Nano 328, with Windows XP, and the Arduino IDE 1.0.5. Another necessary program is VSPE (Virtual Serial Port Emulation). These are some of the requirements that I will explain, along with terms like Handshake, Reset, Watchdog, Sketch, Bootloader, and other foreign terms defining certain operations.
To start solving this problem, I rephrased the question. How does the upload process work, and what prevents me from uploading programs to Arduino wirelessly?
Software upload to Arduino is typically done via an FTDI cable, which is essentially a USB to serial converter, through pins 0 and 1 (the serial port of the Arduino TX and RX).
Given that we can have a serial port with most Bluetooth devices in our notebooks, the question arises. What stops me from connecting a Bluetooth module to the Arduino serial port, pairing it with the PC, and asking the Arduino IDE to send the firmware to that port?
The answer lies in three main aspects:
- First, in my case, I use HC-05 Bluetooth modules, which, like other market options, seem to lack a DTR line (I’m not sure; if anyone knows more about DTR in HC-05 modules, please inform me). Without DTR, resetting the Arduino to start the Bootloader and begin the firmware upload sequence isn’t possible.
- What are the characteristics that the serial connection needs to communicate with the Arduino during the upload sequence?
- The Arduino IDE can send the upload to a serial port, but when establishing a Bluetooth serial connection from the PC to the Arduino via Windows, the IDE reports that the port is in use and prevents the upload.
By mastering these issues, we can solve the problem and get the firmware upload working perfectly.
Step 1: Resetting the Arduino
These are interconnected, and there are several solutions, always keeping in mind that a reset is needed for the bootloader to start.
This can be achieved in several ways.
Hardware Method
- Pressing the Arduino reset button addresses both points 1 and 2. To initiate the upload, press the reset button on the Arduino, and release it one second after “Uploading” appears in the IDE.
Software Method
- Soon, I will dedicate a post to this topic, but for now, here are two useful links.
Resetting the Arduino through software for fun and profit by aRiver’s pad
Arduino tips tricks and techniques Bootloader by Adafruit
Step 2: Characteristics of the Serial Connection during Firmware Upload
The main point here is that the upload is done from the IDE via a serial port that can be selected by the user. A fundamental aspect is that this communication is done at a Baud Rate of 57600bps, with 1 Stop Bit and No Parity.
Therefore, we need to configure the HC-05 Bluetooth module with these characteristics. I have even written a post about this, which can be read here.
For different modules, the procedure is similar, but I recommend consulting the respective module’s datasheet and obtaining references on AT mode and respective commands.
Step 3: Arduino IDE Settings
Here lies the issue with the normal functioning of the IDE, which involves testing the use of the specified serial port, in this case, the serial port associated with Bluetooth.
In Linux, I am not sure how both Bluetooth and the IDE work, but in Windows, the situation is as follows.
On one hand, we have to make the serial port connection from the PC to the Bluetooth module via Windows. On the other hand, when selecting that same port for upload, the IDE reports that the serial port is already in use.
The Solution
The solution involves using the program mentioned above, VSPE (Virtual Serial Port Emulation), which can be downloaded for free here.
The trick is to create a virtual serial port and route all traffic between the Bluetooth serial port and this virtual serial port.
This way, the IDE does not complain about Windows using the Bluetooth serial port, and the upload proceeds without issues.
Example
I created a splitter using COM16 as the virtual serial port and redirected it to COM13, the real Bluetooth port of the PC. I paired and connected via Windows, and “voilà,” it’s ready to upload new sketches to the Arduino via Bluetooth.


Charly Da Silva liked this on Facebook.
Pedro Neves liked this on Facebook.
Daniel Lopes liked this on Facebook.
Nuno Moleiro liked this on Facebook.
Manuel Barros liked this on Facebook.
Mario Guido liked this on Facebook.
César Rafael liked this on Facebook.
Silvia Lopes liked this on Facebook.