Nokia 5110 LCD With Infrared Sensor
by Sourya Choudhury in Circuits > Arduino
1082 Views, 3 Favorites, 0 Comments
Nokia 5110 LCD With Infrared Sensor
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.
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.
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!!!!!!!!
Please vote for this project for the Microcontroller contest!