Adding a Nokia 3310 LCD screen

OLD ARCHIVE - some info might be out of date 

The Nokia 3310 LCD screen is a plug-n-play display shield. Thanks to Nuelectronics. It's a really neat way of displaying lots of information without a computer. This page goes through connecting it to Mains AC. Non-invasive 3.0, but hopefully gives enough information to interface it with any of the other basic setups or any other project.

The LCD can be ordered form nuelectronics for £9.99 here.

Step one: Making a breakout adapter

To use the display at the same time as the sensor electronics, an adapter is needed to make 5V, GND, Analog input 1 and 2 accessible. Here are couple of pictures of the way I did it. You will need two 6x3 pieces of stripboard and two 6-way sockets


Once you have that done, plug the shield into the Arduino and connect the GND, 5V and analog inputs wires 1 and 2 from the sensor electronics to the breakout pins. That completes the hardware part, on to the software.

Step Two: Software - installing the library

To run the LCD, the nuelectronics LCD library is needed. Download it here, then unzip it and insert it into your Arduino/libraries folder.

Step Three: Software - Arduino Sketch

Download the LCD Mains AC: non-invasive 3.0 sketch here: MainsACemonAndLCD.tar.gz. Unzip and upload to your Arduino.

Thats it! When you turn it on, the screen should light up nice and blue and be displaying useful information!

More information on the added bits of code

There are three blocks of code that need to be added:

The first block goes right at the top of the program, it includes the LCD library, sets up the LCD and declares the variable used to convert integers to characters.

//Include nokia 3310 LCD library
#include "nokia_3310_lcd.h"
//Setup LCD
Nokia_3310_lcd lcd=Nokia_3310_lcd();
//Used to convert integer to char for LCD
char chvalue [10];
The second block is inserted in the void setup() procedure, initializes the LCD and clears the screen.
//Initialize LCD and reset it
The third block actually displays the information on the LCD screen. Insert this wherever you want to output a value.
//Ouput Real Power to the LCD
itoa((int)(realPower), chvalue,10);
lcd.LCD_3310_write_string_big(15, 1, chvalue, MENU_NORMAL);
lcd.LCD_3310_write_string(65, 3, "W", MENU_NORMAL);