Universal Bluetooth receiver with LCD display.

  

This project uses an Arduino UNO to act as a remote receiver for data sent via Bluetooth from a remote location. The data is displayed on an LCD display and although Bluetooth is used here it could just as easily be Infra Red (for short range communication) or radio (for long range communication). A suitable transmitter will be described in part 2.

Components used:

Blogs for the Bluetooth unit can be found here and the Liquid Crystal display here.

The wiring for the Bluetooth unit is here, note a logic level shifting board is needed as the HC06 Tx/Rx pins are 3 volt logic. Only connect 3.3 volts to the Logic level shit board if it does not have a 3 volt regulator, otherwise you will burn out the regulator.

 

The wiring for the LCD display is here

 

All the components could be mounted on a single breadboard. After the circuit has been built upload the sketch below:

/*
Universal Bluetooth receiver with LCD Display
Uses a 1602a 2 line by 16 character display
and a HC06 Bluetooth Slave

The LCD circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K variable resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

The Bluetooth circuit:
* Vcc and Gnd on HC06 to Arduino +5volts and Gnd
* HC06 Tx to Arduino pin 6, through a logic level convertor
* HC06 Rx to Arduino pin 7, through a logic level convertor
*/

// include the libraries:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(6,7); // RX, TX
#include <LiquidCrystal.h>

// Initialize the LCD library with the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
Serial.begin(9600); // used to debug
// set up the LCD's number of columns and rows
lcd.begin(16, 2);
mySerial.begin(9600); // default baudrate for the HC06
lcd.setCursor(0,0); // set cursor at the start of the first line
lcd.print("Universal");
lcd.setCursor(0,1); // set cursor at the start of the first line
lcd.print("Serial Receiver");
}

void loop() {
if (mySerial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// Print a message to the LCD
lcd.setCursor(0,0); // set cursor at the start of the first line
lcd.print("Remote Temp:");
lcd.setCursor(0, 1); // first character line 2
// read all the available characters
while (mySerial.available() > 0) {
// display each character to the LCD
lcd.write(mySerial.read());
}
}
}

The sketch prints a string on the first line, in this case Remote Temp: and data sent via Bluetooth on the second line. 

Testing the project:

I normally use BlueTerm on my Android phone to connect to the HC06, but it sends characters one at a time as they are typed in. I use BlueSerial that allows a sentance to be typed in, then sent. Connect your device to the HC06, you should find it listed as linvor unles you have changed it. Send a sentance of less than 16 characters and it will appear on the second line.

Advertisements

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