Introduction: Nokia 5110 LCD With Infrared Sensor

About: Sourya Choudhury is a 15 year old student and a computer science enthusiast living in Kolkata, India.

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.

Step 1: Parts Required.

The following parts are required for this project:

1) Arduino Nano.

2) Infrared sensor.

3)Nokia 5110 lcd screen.

4)Jumper wires.

5) Breadboard.

Step 2: Connecting the Wires.

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.

Step 3: 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() );

}

Step 4: Enjoy!!!!!!!!

Please vote for this project for the Microcontroller contest!

Microcontroller Contest

Participated in the
Microcontroller Contest