A small and good looking digital thermometer using the dallas DS18B20 digital sensor and an Arduino pro micro at 3.3v.
Everything is designed to fit exactly and to snap in place, no screws or glue is needed!
Instructions can be found bellow, including some information on the parts i used and the arduino code needed for it to work.
STL Files:
Arduino Pro Micro STL Files: STL Files
Arduino Nano STL Files: STL Files
Connections:
Sensor data pin on Arduino PIN 5
Display SDA on Arduino PIN 2
Display SCL on Arduino PIN 3
Arduino Nano connection changes:
SDA -> A4
SCL -> A5
Libraries:
Arduino Code:
//Include libraries #include <onewire.h> #include <dallastemperature.h> #include <u8g2lib.h> U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0); static char outstr[15];</u8g2lib.h></dallastemperature.h></onewire.h> // Data wire pin 5 #define ONE_WIRE_BUS 5 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); void setup(void) { //Serial.begin(9600); //Begin serial communication //Serial.println("Arduino Digital Temperature // Serial Monitor Version"); sensors.begin(); u8g2.begin(); } void loop(void) { sensors.requestTemperatures(); Serial.print("Temperature is: "); Serial.println(sensors.getTempCByIndex(0)); dtostrf(sensors.getTempCByIndex(0),7, 1, outstr); u8g2.clearBuffer(); u8g2.setFont(u8g2_font_profont22_tf); //Fonts here https://github.com/olikraus/u8g2/wiki/fntlistall u8g2.drawStr(40,13, "Temp"); u8g2.drawStr(4,30,outstr); u8g2.sendBuffer(); delay(10000); }
Parts Used:
- Sensor: DS18B20
- Display: 0.91″ OLED Display
- Microcontroller: Arduino Pro Micro
- Battery: CR123
Some of the above links may be affiliate links ,meaning ,at no additional cost to you ,if you click through and make a purchase a small commission is earned to help support the site and the authors.Read more here.
Posted on:
Comments are closed here.