Introduction: LCD & Bluetooth - Arduino

Picture of LCD & Bluetooth - Arduino

In this Instructable, you will learn how to write a text on your smartphone and print it on an LCD via Bluetooth, using an Arduino.

Step 1: Hardware Needed

Picture of Hardware Needed

For this project, you will need:

-an Arduino UNO

-an LCD (Liquid Crystal Display)

-a breadboard

-a 10K potentiometer

-a BT module (I use an HC-05)

-jumper wires

-a Bluetooth app. For Android users, I recommend BlueTerm. Sorry iOS users, BlueTerm is only available for Android... But you can still download equivalent apps.

No tools required

Step 2: Build the Circuit

Picture of Build the Circuit

The image above corresponds to the following guidelines:

First, pin your LCD on the breadboard and power the breadboard by connecting a wire from "5V" (power) on your Arduino to the positive row on the breadboard and another one from "GND" (ground or 0V) to the negative row.

Then connect the LCD to the Arduino:

LCD pin 4 - Arduino pin 2

Pin 6 - pin 3

Pin 11 - pin 4

Pin 12 - pin 5

Pin 13 - pin 6

Pin 14 - pin 7

After that, power the LCD:

LCD pin 1 = GND on the breadboard

Pin 2 = 5V

Pin 5 = GND

Pin 15 = 5V

Pin 16 = GND

Then connect pin 3 on your LCD to the central pin of the 10K potentiometer and power the potentiometer with one pin on GND and the other one on 5V (on the breadboard).

Then connect the Tx(Transmit) pin on your Bluetooth module to the Rx (Receive) on the Arduino, and connect the Rx pin on your BT module to the Tx on the Arduino.

Finally, power the BT module by connecting the VCC (or 5V) to the positive row on the breadboard an connect the GND to the negative one on the breadboard.

Step 3: Code

Now let's write the code:

#include <LiquidCrystal.h> //Include the library that enables you to use the LCD

LiquidCrystal lcd(2,3,4,5,6,7);//Declare that your LCD is connected to pins 2,3,4,5,6 & 7 on your Arduino

void setup() {
lcd.begin(16,2);//16 by 2 are the dimensions of the LCD (in number of characters)
Serial.begin(9600);//launch the process of receiving serial data (via bluetooth) at 9600 bits/s
}

void loop() {
if(Serial.available()){
lcd.write(Serial.read());//these two lines mean that if there is data coming from the BT module, the Arduino prints it on the LCD.
}
}

//Before uploading the code to the Arduino, disconnect the Tx and Rx pins, otherwise you won't be able to upload. Once the code uploaded, reconnect them.

Now open BlueTerm, put BlueTooth on and connect HC-05. Then simply write your text and it should be printed on the LCD!

Comments

ShankarB8 (author)2017-11-24

how plz send code

Prd99 (author)2016-01-29

Hi
I added a delay and a lcd.clear in Ur code .But now when I type something it displays and clears the word letter by letter. What can be wrong?

Hugo Trombert (author)Prd992016-01-29

did you add these functions to delete the word every 4 seconds?

Prd99 (author)Hugo Trombert2016-01-29

Yes

Hugo Trombert (author)Prd992016-01-29

and your problem is that when you type a letter, it clears it after 4 seconds, right?

Prd99 (author)Hugo Trombert2016-01-29

Yeah right

Hugo Trombert (author)Prd992016-01-31

I'm not at my home so I can't try it on my arduino now
but I think the problem is that it deletes the letter you type every 4 seconds, instead of clearing the LCD every 4 seconds,
so what you can try is to create an integer (the text) and say to the Arduino to print it when you press a button (like a text message or an email), and then to clear the LCD every 4 seconds
Gonna send you the code soon ;)

Prd99 (author)Hugo Trombert2016-01-31

Ok I'll try that

Hugo Trombert (author)Prd992016-06-29

hey Prd99! did it finally work?
because while working on another project (BT robot arm), i found out how to make your project work. would you like the code?

Prd99 (author)Hugo Trombert2016-06-29

I haven't tried it in many days
Yeah I would like the code?

Prd99 (author)Prd992016-06-29

I would like the code

Hugo Trombert (author)Prd992016-06-30

//There you go! It works!

#include <LiquidCrystal.h>

LiquidCrystal lcd(2,3,4,5,6,7);

char buffer[20];

int charsRead;

int val;

void setup(){

Serial.begin(9600);

lcd.begin(16, 2);

}

void loop(){

while(Serial.available() > 0){

charsRead = Serial.readBytesUntil('\n', buffer, sizeof(buffer) - 1);

buffer[charsRead] = '\0';

lcd.print(buffer);

delay(4000);

lcd.clear();

}

}

Sorry,
you should create a string

Hugo Trombert (author)2016-06-29

//There you go ! It works !

#include <LiquidCrystal.h>

LiquidCrystal lcd(2,3,4,5,6,7);

char buffer[20];

int charsRead;

int val;

void setup(){

Serial.begin(9600);

lcd.begin(16, 2);

}

void loop(){

while(Serial.available() > 0){

charsRead = Serial.readBytesUntil('\n', buffer, sizeof(buffer) - 1);

buffer[charsRead] = '\0';

lcd.print(buffer);

delay(4000);

lcd.clear();

}

}

Prd99 (author)2016-01-29

**

Prd99 (author)2016-01-29

**

Prd99 (author)2016-01-29

Sorry for the image
Here is the code
#include


LiquidCrystal lcd(2,3,4,5,6,7);

void setup() {
    lcd.begin(16,2);
    Serial.begin(9600);
  }
  void loop() {
    if(Serial.available()){
      lcd.write(Serial.read());
delay(4000);
lcd.clear();
    }
    }

murphadonut (author)2016-01-28

what lcd screen are you using?

murphadonut (author)murphadonut2016-01-28

did you get it off amazon?

I use a 16x2 characters LCD, included in the Arduino starter kit

DiegoA60 (author)2016-01-18

Hi! I tried to write on BlueTerm but there is no one word, what could be happening?

Thanks,

Hugo Trombert (author)DiegoA602016-01-18

Hey!
Could you send me a screenshot of BlueTerm?

DiegoA60 made it! (author)Hugo Trombert2016-01-19

Yes, here it goes.

Thank you for your quick answer

Hugo Trombert (author)DiegoA602016-01-19

But does your text display on the LCD or doesn't it work at all?

About This Instructable

6,154views

43favorites

License:

Bio: Hi! I'm Hugo, 15 yo student from the French Alps. I spend most of my spare time programming, tinkering, building electronic stuff, observing planets ... More »
More by Hugo Trombert:Remote Controlled Telescope - ArduinoBluetooth robot arm + app | Arduino & AndroidTelescope motorization (focus + orientation)
Add instructable to: