Adding a Nokia 3310 LCD screen

The Nokia 3310 LCD screen is a plug and play shield thanks to Nuelectronics is great work. Its a really neat way of displaying lots of information without having to have a computer on. This page goes through connecting it up 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 a little adapter is needed to make 5V, GND, Analog input 1 and 2 accessible. Here a couple of pictures of the way I did it, but feel free to do it any other way: You will need 2x 6x3 pieces of stripboard and 2x 6way sockets

   

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

Step Two: Software - installing the library

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

Step Three: Software - Arduino Sketch

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

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, set's 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 and initializes the LCD and clears the screen.
 
//Initialize LCD and reset it
lcd.LCD_3310_init();
lcd.LCD_3310_clear();
 
The third block actually outputs the information to be displayed to 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_clear();
lcd.LCD_3310_write_string_big(15, 1, chvalue, MENU_NORMAL);
lcd.LCD_3310_write_string(65, 3, "W", MENU_NORMAL);