Here is a simple little project that everybody can make and modify to meet their needs.
First you need a core; then you need an 1.2 inch LED display with i2c backpack from Adafruit. And you need a one-wire temperature sensor. And three 4.7K resistors.
The display very nicely has separate power pins for the LEDs, which need +5V and the i2c port which can run on 3.3V. So wire it up like this:
Display Spark
IO +3.3V
+5V Vin
GND GND
SDA D0
SCL D1
The Dallas/Maxim DS18B20 gets wired up like this:
DS18B20 Spark
GND Pin1 GND
DQ Pin2 D2
Vdd Pin3 +3.3V
The three 4.7K resistors pull-up SDA and SCL and DQ from the LED display and the DS18B20 to +3.3V.
Now we need some software:
- The one-wire library from @wgbartley from here. Just edit out the parts that you don’t need. I used just the one-wire part.
- The Adafruit LED Backpack library from here. You will need to do a little editing here–it’s easy, you’ll get it!
- The Adafruit GFX library from here. You will need to edit this one too. You can choose if you are going to keep the glcdfont.c file or not since this display doesn’t need it. I kept it and put it in glcdfont.h in the web IDE, leaving glcdfont.cpp empty.
- My SparkTime library from here.
And finally the timentemp.cpp code itself also from here.
For me, i2c just worked right out of the web IDE, so nothing extra was needed here.
And here’s what you get:
The Board itself–sorry there is no fritzing component for the Adafruit display, but I have asked them to make one.
And then you get the time (12-hour format with AM led) and flashing colon for seconds, here showing 9:14 PM:
And finally the temperature in degrees F with a little upper dot for a combo degree symbol and decimal point, here showing 79.9 degrees F.
Have fun!