Nokia 5110 LCD With Infrared Sensor

by Sourya Choudhury in Circuits > Arduino

1082 Views, 3 Favorites, 0 Comments

Nokia 5110 LCD With Infrared Sensor

1526035842810-1918724165.jpg

The Nokia 5110 LCD display is an awesome LCD display which is compatible with the Arduino development

board. Let us now control one of those LCDs and interface it with Arduino and an IR sensor.

Parts Required.

1526035930333254069737.jpg

The following parts are required for this project:

1) Arduino Nano.

2) Infrared sensor.

3)Nokia 5110 lcd screen.

4)Jumper wires.

5) Breadboard.

Connecting the Wires.

1526035994709-157962400.jpg

Connect the wires in this manner:

Arduino to LCD:

CLK=8, DIN=4, CE=7, DC=5, RST=6.

Arduino to ir:

Out=2 , gnd=gnd , vcc=5v.

Code:

#include "U8glib.h"

int a=2; int x;

//Prepared by Sourya Choudhury.

// Credits-Henry's Bench tutorials for lcd tutorial.

U8GLIB_PCD8544 u8g(8, 4, 7, 5, 6);

// CLK=8, DIN=4, CE=7, DC=5, RST=6

void writer()

{

x= digitalRead(a);

if (x==HIGH)

{ u8g.setFont(u8g_font_profont12);

u8g.setPrintPos(0,15);

u8g.print("Path Clear!");\

delay(100);

}

else

{

u8g.setFont(u8g_font_profont12);

u8g.setPrintPos(0,15);

u8g.print("Path Blocked!");

delay(100);

}

}

void setup()

{

pinMode(a,INPUT);

}

void loop() {

u8g.firstPage();

do {

writer();

} while( u8g.nextPage() );

}

Enjoy!!!!!!!!

15260360906511997917706.jpg

Please vote for this project for the Microcontroller contest!