Arduino Nokia 5110 LCD temp meter DS18B20

Hello World! I made a Arduino Nokia 5110 LCD Temperature meter with a Nokia 5110 LCD.
I added the librarys and i made a Image for the LCD background with a rounded border and temperature icon which
is added to the LCD5110_Graph Libary and is named borderRoundedIcon.c

Schematic:
Arduino Nokia 5110 LCD DS18B20

Just wire everything up like the schematic and upload the code.

Make sure you download and install the libraries first! You need them!
LCD5110_Graph_Library.zip
DallasTemperature_Library.zip

Put the pins on the LCD like following:
PIN1 on LCD ==>> PIN 12 on Arduino
PIN2 on LCD ==>> PIN 11 on Arduino
PIN3 on LCD ==>> PIN 10 on Arduino
PIN4 on LCD ==>> PIN 9 on Arduino
PIN5 on LCD ==>> PIN 8 on Arduino
PIN6 on LCD ==>> PIN 3.3 Volt on Arduino
PIN7 on LCD ==>> PIN 5 volt on Arduino
PIN8 on LCD ==>> PIN Ground on Arduino

Parts list:
Arduino Uno, I used the robotdyn uno.
DS18b20 Temperature Sensor.
Nokia 5110 LCD
Jumper wires MM/FF/MF.

Code:

/*
Author: Danny van den Brande, ArduinoSensors.nl. BlueCore Tech.
Arduino Nokia 5110 LCD temp meter.
Hello world! this is a example project for the DS18b20 on a old Nokia 5110 LCD Display.
 */

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LCD5110_Graph.h>
#define ONE_WIRE_BUS 2

LCD5110 lcd(8,9,10,12,11);

extern unsigned char SmallFont[];
extern unsigned char BigNumbers[];
extern uint8_t borderRoundedIcon[];

char TempCelciusFahrenheit[6];

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

float tempC = 0;
float tempF = 0;

void setup(void)
{
  lcd.InitLCD();
  sensors.begin();
}

void loop(void)
{ 
  lcd.clrScr();
  lcd.drawBitmap(0, 0, borderRoundedIcon, 84, 48);
  sensors.requestTemperatures();
  tempC = sensors.getTempCByIndex(0);
  tempF = sensors.toFahrenheit(tempC); 
//  convertToString(tempF); //these are Fahrenheit, uncomment when using degrees.
  convertToString(tempC);  //These are degrees, comment when using Fahrenheit.
  lcd.setFont(BigNumbers);
  lcd.print(TempCelciusFahrenheit,22,14); // You can set position of the text here.
  lcd.setFont(SmallFont);
  lcd.print("Temp.Celc.",17,5); //Comment when using Fahrenheit
//  lcd.print("Temp.Fahr.",17,5); //Uncomment when using Celcius
  lcd.update();  
  delay(1000);
}
void convertToString(float number)
{
   dtostrf(number, 3, 1, TempCelciusFahrenheit);
}
Danny van den Brande

http://www.arduinosensors.nl

Programmer, Game Designer, 3D Designer, Web Designer, Graphic Designer. Jup this website looks crappy.. :) But enjoy the projects! Everything you need is here.

Leave a Reply

Your email address will not be published. Required fields are marked *