Time and Temp Project

Here is a simple little project that everybody can make and modify to meet their needs.

First you need a :spark: 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!

8 Likes

Awesome!!
Those are some big displays! How much current are they rated at?

Hi @mohit,

The Adafruit datasheet does not say, but there are two LEDs per segment in the seven segment display plus some dots, so I count 61 total LEDs. That implies that it could be a bit over 1 amp total at full brightness. Just for fun, I will stick a meter on it tonight and report back.

I tried powering this beast from a rechargeable USB battery pack and it drained it in about an hour!

You don’t realize how big and bright the 1.2" digits are until you see them in person.

2 Likes

Well I put the ammeter on the +5 for the LED display and the meter would not settle down, so they must be switching the LEDs in the driver chip. I would estimate around 100mA or so but you would need a scope and a precision shunt to to see the AC behavior of the power. I am powering it with a iPad-rated 2.1A USB supply.

This giant LED display already has a low wife-acceptance factor, so I am looking for something more tasteful.

Check the LED screens this guy is using. They look perfect for a time and temp display.

1 Like