A tale of two UART devices
Resolving UART bus conflicts and voltage levels
I wanted to record two potential issues I found with using my custom Atmega328p board with onboard USB FT232 when an HC-05 bluetooth module in introduced, in the hope it may well be helpful to others.
The problems and solutions identified were:
Above: A small piece of perfboard modifies the Bluetooth socket to include a 5V to 3.3V voltage divider on the Bluetooth HC-05 RX line (10 and 20kohm resistors). The red wire provides a direct line from the Bluetooth HC-05 TX output and the Atmega328p RX input, thereby granting it preference when the HC-05 module is present. It's not quite clear from the picture, but the RX input pin is bent up out of the socket and a 1k resistor connects the FT232 TX output (see below).
The problems and solutions identified were:
(1) The HC-05 bluetooth module runs on 5V, but the RX and TX are only 3.3V tolerant. The HC-05's TX line is fine - it will output 3.3V and the AVR RX will receive the signal as logical '1' the voltage threshold at 5V on the AVR is sometimes quoted as 0.6*Vcc = 3V. Although in some circuits you'll find 5V run through HC-05's RX directly from the 5V AVR TX line - this WILL break the module over time. The solution is simple: Take the 5V TX line from the AVR and use a voltage divider to convert to a 3.3V (or thereabouts) level into the HC-05 RX line. I used 10k and 20k resistors for this.
Comments
Post a Comment