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 needed! Instructions can be found below, including some information on the parts I used and the Arduino code needed for it to work.
Arduino Nano version has also been posted as STL files there are a few connection changes that I will post below. Please note that you will have to make sure you use the 3.3v version of Arduino Nano or Micro. Send me a message or comment on the "thing" if you want to use another battery type.
Connections Arduino Pro Micro (clone):- Sensor data pin on Arduino PIN 5
- Display SDA on Arduino PIN 2
- Display SCL on Arduino PIN 3
- Sensor data pin on Arduino PIN 5
- Display SDA on Arduino PIN A4
- Display SCL on Arduino PIN A5
STL Files: https://www.thingiverse.com/thing:2824270
Code: https://noobmakers.com/2018/04/01/digital-temperature-widget/
//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];
// 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"); //Print a message
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 & Amazon links:- Sensor: Amazon.de - Amazon.co.uk - Amazon.com
- Display: Amazon.de - Amazon.co.uk - Amazon.com
- Microcontroller: Amazon.de - Amazon.co.uk - Amazon.com
- Battery: Amazon.de - Amazon.co.uk - Amazon.com
- Sensor: Ebay.de - Ebay.com - Ebay.co.uk
- Display: Ebay.de - Ebay.com - Ebay.co.uk
- Microcontroller: Ebay.de - Ebay.com - Ebay.co.uk
- Battery: Ebay.de - Ebay.com - Ebay.co.uk
The above links are part of the amazon affiliate program, that means that if you click and buy one of the items from those links I will get a small commission with no additional cost to you. This is a great way to support this and the upcoming projects.
Credits:Models used to help me design it so everything fits on the links below:
SVG Cloud was used from:
Icon made from Icon Fonts is licensed by CC BY 3.0SVG CLOUD
PS: I am a noob maker, so any advice or suggestions will be much appreciated.
Comments