Correct Arduino UNO Bluetooth

by Creative Science in Circuits > Arduino

1997 Views, 18 Favorites, 0 Comments

Correct Arduino UNO Bluetooth

UNO-HC-WS.bmp
FD4PSH2IUORL3PW.LARGE.jpg
DSC_1634.jpg

This little Instructable is a spin-off from our Creative Robotix instructable project. We needed a way to conveniently communicate with an Arduino UNO/MICRO/NANO using the hardware Serial via Serial Bluetooth, but without interfering with the Arduino programming cycle, using the standard Arduino Bootloader. We also wanted to respect the Bluetooth modules signalling levels of 3.3 volts. We came up with a straightforward solution using a voltage divider to deal with the transmission voltages from the Arduino and a simple 'bus' like solution using a transistor to manage the two serial receive lines between the hardware UART on the Arduino and the Bluetooth module.

Required parts:

  • Arduino UNO / Micro / Nano
  • HC-05/06
  • 2 10K resistors
  • 1 20K resistor
  • 1 2N222A transistor (or virtually any other NPN transistor)
  • 5 patch wires
  • 1 cable tie
  • Basic assembly tools, and if preferred, some electrical tape for insulation

Estimated build time, 10 minutes.

Wire-up the Voltage Divider...

DSC_1635.jpg
DSC_1636.jpg
DSC_1637.jpg
DSC_1638.jpg

The Bluetooth module we are using, the HC-05/06, operates on 3.3 volt signalling, the Arduino board we are using operates on 5 volt signaling. The 3.3 volt transmissions from the Bluetooth module to the Arduino are fine, in 5 volt logic a logic 1 is seen as a voltage greater than 2 volts, so we're all good. However, the 5 volt transmissions from the Arduino to the Bluetooth module may cause very bad things to happen to the RX input, over driving the input potentially causing damage, so we need to regulate these transmission voltages down to an acceptable level. This can easily be achieved with a 'voltage divider'. In this case we need to bring 5 volts down to 3.3 volts, so we need a 20K resistor across the modules RX input to ground and a 10K resistor from RX the input. The RX input resistor will connect to the the TX output on the Arduino Uno.

Notes:

  • How to 'read resistor values'
  • The 20K resistor will be banded red, black, orange
  • The 10K resistor will be banded brown, black, orange

Prepare the Transistor...

105.jpg
106.jpg
107.jpg
108.jpg

We need to create a 'bus' line for the serial TX output on the Bluetooth module, this will allow us to have the Bluetooth module and the USB serial device connected together at the same time. To implement this 'one line bus' we need to use a transistor. Here we use one PNP, 2N222A, transistor and a 10K base input resistor.

Attach the Transistor to the Bluetooth Module, Wire-up and Test.

DSC_1644.jpg
DSC_1642.jpg
DSC_1643.jpg
DSC_1646.jpg

Using the long nosed pliers connect the transistors Emitter to the Bluetooth modules TX output. Ensure there are no short circuits. Strip off a group of 5 wires from a main patch cable set and connect to the Bluetooth module. Loop back and secure the cable with a cable tie. The unconnected transistor leg connects to the RX input on the UNO and the base resistor on the transistor connects to the RX enable line on the UNO, we use Pin 12.

Test using the attached script, with Pin 12 activated you can send and receive on both the USB and Bluetooth serial without interference.

Wiring in the picture:

  • Orange wire is +5 Volts
  • Yellow wire is GND
  • Purple wire connects to the base resistor connected to the transistor and is the activation line to Pin 12
  • Blue wire connects to the RX resistor on the Bluetooth module and to the TX output, Pin 1, on the UNO
  • Green wire connects transistor leg on the Bluetooth module and to the RX input, Pin 0, on the UNO