Hi,
Does anyone knows a good tutorial about programming an arduino Uno with the Bluetooth module HC-05? Every tutorial I find is about the ESP8266
I did some test with the HC-05 module and the arduino Uno, and I am able to turn on/off a led via bluetooth. But now I want to upload new code (for example to change the delay of blinking, or a whole new code) via bluetooth to the UNO..
@Boffin I already tried this one, without success..
The software that you can download is for PC (not macOS) but with an USB toggle, I entered the following commands via serial monitor (in stead of the pc software)
Connect the HC-05 module to the computer. This requires the so-called TTL-dongle. This is actually a USB-UART converter. You can use any (FTDI, CH340, CP2102 etc.) with the appropriate driver. You also need a program like Serial Monitor. There are many such programs for both PC and Mac. OS X Serial Port Apps Serial Port Utility for Mac OS X: Best alternatives
Configure HC-05 module. Submit some AT commands to configure the module. It does not always work, sometimes a module firmware update is required.
Connect the module to Arduino and pair the computer with the module via Bluetooth. After that, the required COM port should appear on the computer.
Start Arduino IDE, select the required port, download the program.
Don't expect it to say "Arduino Uno"; does a port disappear from the IDE when you disconnect, and appear again when you connect. Yo need to close and open the tools menu between the two steps.
Please enable show verbose output during upload and disable show verbose output during compilation om file->preferences in the IDE
Next attempt an upload and post the complete output from the output window (there more than likely will will be more than just the few lines that you showed).
Don't post screenshots of error messages, they are useless in 99.9% of the time.
Arduino: 1.8.15 (Mac OS X), Board:"Arduino/Genuino Uno"
De schets gebruikt 1952 bytes (6%) programma-opslagruimte. Maximum is 32256 bytes.
Globale variabelen gebruiken 204 bytes (9%) van het dynamisch geheugen. Resteren 1844 bytes voor lokale variabelen. Maximum is 2048 bytes.
/Users/imac/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/bin/avrdude -C/Users/imac/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/etc/avrdude.conf -v -patmega328p -carduino -P/dev/cu.WordClock-SPPDev -b115200 -D -Uflash:w:/var/folders/2k/m9t1sj2x3w90t9l2_gvz_sk00000gn/T/arduino_build_33358/fastLed.ino.hex:i
avrdude: Version 6.3, compiled on Dec 16 2016 at 13:32:25
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/Users/imac/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/etc/avrdude.conf"
User configuration file is "/Users/imac/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/cu.WordClock-SPPDev
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "/dev/cu.WordClock-SPPDev": Resource busy
To my knowledge, the HC-05 is a 3.3V device and should be powered from the 3.3V pin of the Arduino; the RX pin on the HC-05 should be connected to the TX pin of Arduino via a resistor divider to bring the level down to approx. 3.3V.
Further the LED does not have a current limiting resistor; either add it or remove the LED, the onboard L LED can take that function for now.
The HC-05 can be powered 3,6V to 6V (printed on the back of the module)
As I wrote before, my connections are as follow:
HC-05 UNO
GND GND
VCC 5V
TX RX
RX TX
STATE - Capacitor - RESET
When I use this configuration, I can access my UNO via bluetooth: I wrote a simple program so the serial.print send the data to my phone.. So it works without the resistor devider..
The led is not connected, I use the onboard led (this as test to see if I can change the delay by uploading a new sketch via bluetooth in the Blink-program)
The error text indicates that the port is busy. When loading the code through Arduino IDE, all other programs for working with the port must be closed. Some serial port programs do not properly close the port. After setting the HC-05 parameters, a computer restart is required.
During the download of the program, the USB cable between the Arduino and the computer should also not be connected.
P.S. It would be nice right from the start if you link to your module's sellers page.