Attiny85 5110LCD DS18B20 Thermometer

Introduction: Attiny85 5110LCD DS18B20 Thermometer

About: My hobby is electronics since childhood. I'm interested in Arduino, programming, drawing PCB in Eagle and solder the connections.....

I was able to make a simple termometer with Attiny85 microcontroller.A small price, small dimensions, low power and low voltage.

Step 1: Parts:

For this project you need a some parts:

1: Attiny85 uC

2. Nokia 5110 LCD

3. DS18B20 + 4,7K ohm resistor

4. Breadbord + jumper wire

Step 2: NOTICE:

Is possible error for uploading code on Attiny85. I would recommend using the arduino 1.0.5 Ide ( i use 1.0.6) and it should work just fine.You need a tinyPCRELpatch. Extract from zip and copy file to C:\Program Files (x86)\Arduino\hardware. Then you should not have problems with upload. Also copy a libraries in C:\Users\(your user)\Documents\Arduino\libraries.

Step 3: Upload Code;

#include <OneWire.h>

#define ONEWIRE_BUSS 4

OneWire TemperatureSensor(ONEWIRE_BUSS);

#include

// SCK (CLK) ------- Attiny85 pin 5
// MOSI (DIN)------- Attiny85 pin 6

// DC (register select) ------- Attiny85 pin 7

// RST ------- Attiny85 pin 2

// CS (CE) ------- to GND

//LCD5110 myGLCD(0, 1, 2, 3, 6); //D6 don't exist - conect CS to GND

extern uint8_t BigNumbers[];

void setup(void) {


myGLCD.InitLCD();

myGLCD.clrScr();

}

void loop(void) {


myGLCD.setFont(BigNumbers);

byte i;
byte data[12];

int16_t raw;

float t;

TemperatureSensor.reset(); // reset one wire buss
TemperatureSensor.skip(); // select only device

TemperatureSensor.write(0x44); // start conversion

delay(1000); // wait for the conversion

TemperatureSensor.reset();
TemperatureSensor.skip();

TemperatureSensor.write(0xBE); // Read Scratchpad

for ( i = 0; i < 9; i++) { // 9 bytes

data[i] = TemperatureSensor.read();

}

raw = (data[1] << 8) | data[0];
t = (float)raw / 16.0;

myGLCD.printNumF(t, 1, CENTER, 14);

}

Step 4: Specifications:

Working voltage 3 - 3.3 V

Current 5mA

Step 5: Version With Batteries:

Step 6: All Files in Zip:

Be the First to Share

    Recommendations

    • Toys & Games Contest

      Toys & Games Contest
    • Big vs Small Challenge

      Big vs Small Challenge
    • Fix It Challenge

      Fix It Challenge

    15 Comments

    0
    stp715a
    stp715a

    1 year ago

    How would the sketch need to change to print temperature in Fahrenheit?

    0
    EmanG12
    EmanG12

    2 years ago

    amazing!
    could i use atmega32 instead of attiny85 ? if yes, which library i could use?

    0
    Mic100
    Mic100

    3 years ago

    Thank you for that instrctable :)

    Work fine with Arduino 1.8.3

    powered by Li-ion 3.7V 120mA

    OneWireATtiny85.jpg
    0
    mattenpatten
    mattenpatten

    Reply 3 years ago

    Hello is there a schematic to ?

    0
    Mic100
    Mic100

    Reply 3 years ago

    Hello
    her is my schematic from Kicad 4.2
    Nice Day Mic100

    5110-18B20.jpg
    0
    hemanthk13
    hemanthk13

    4 years ago

    Just wired LCD without thermometer

    P_20160918_120606.jpg
    0
    hemanthk13
    hemanthk13

    4 years ago

    Full documentation of the LCD library used here .. https://github.com/chapuzzo/ardusketches/blob/master/libraries/LCD5110_Basic/LCD5110_Basic.pdf

    0
    chiskas2
    chiskas2

    4 years ago

    Hi!

    Thank you for this instrutable. Very interesting!

    Could you please clarify the input voltage? are you using the AtTiny version for 3V or the 5V working at 3V?

    0
    MisloElectronics
    MisloElectronics

    Reply 4 years ago

    ATTiny work for 3 - 5 V and display work 3 - 3.3 V

    0
    diy_bloke
    diy_bloke

    4 years ago

    your #include 'libary' is empty

    0
    MisloElectronics
    MisloElectronics

    Reply 4 years ago

    #include <LCD5110_Basic.h>

    download a zip file :)

    0
    diy_bloke
    diy_bloke

    Reply 4 years ago

    tnx, I missed that

    0
    luisfranco1990
    luisfranco1990

    5 years ago

    hi i like your project.. im try to do some like, but i want to change the thermometer for a resistive divider in a regular arduino i just make a analogRead, can i used the lcd code and change the temp code just for a analogRead?

    thanks!