Posts: 4
Joined: Thu Oct 11, 2012 7:39 pm

Pi Zero, LED thermometer using 64 SMD LED's

Wed Mar 23, 2016 9:15 pm

A few years ago, I made a thermometer of 64 LED's hooked up to some eight shift registers which were controlled by a Microchip microcontroller. Even though that thermometer is still in use, I saw an opportunity to use a Raspberry Pi Zero to build a smaller version. With a Pi, the possibilities are almost endless. For example, I can use Gnuplot to turn data into a nice looking graph, and ftp the graph to a website or I can simply store the data for later use.
The original thermometer used only one sensor and I decided that the new one needed two: one for inside and one for outside.
To make it small, I used SMD LED's. The end result looks like this:
More images can be found here:http://imgur.com/a/l6AAi
Below zero, temp's are indicated by blue LED's. Zero is indicated by a single cold white LED. Temp's from one to 9 are indicated by green ones, 10 to 19 by yellow ones, 20 to 29 by orange ones and 30 to 43 by red ones. Where I live, temperatures rarely rise above 35 degrees so this scale should be enough.

The top of the thermometer is a piece of sanded acrylate (plastic) under which 9 SMD LED's are soldered. Every 8 minutes, the temperature is compared with the temperature 8 minutes ago. If it has signicantly risen (>0.25 degrees) the red LED's light up. If it has fallen, the blue ones light up, if it's nominally the same, the white ones light up.

The highest illuminated LED in the LED column indicates the current temperature. For a finer scale, this top LED can flash with a duty cycle that depends on temperature:
a 0.1 on/0.9 off for 0.25 degrees, 0.5 on/0.5 off for 0.5 degrees, and 0.9 on/0.1 off for 0.75 degrees. So when it is 14.3 degrees, the "14 LED" lights up continuously, and the "15 LED" lights up with a 0.1/0.9 duty cycle. Dividing further, to indicate even smaller changes, makes it difficult to separate the different regimes. Besides, 0.25 is more than enough display accuracy in most cases.

A push button switch at the back can be pressed for about a second to switch between one or the other sensor. One sensor is attached to a 10 m long cable and when that sensor is selected, a red LED at the back lights up to indicate which temp is currently being displayed at the front. Both temperatures are measured and stored, however, but only one can be displayed at the same time.
Sensors are DS18B20, purchased from ModMyPi (no connection), where I also found a small tutorial on how to read out the detector on the command line and from a python programme. Neat.

The python programme also sends the data, clockpulses, and the pulses to make the output of the shiftregisters visible. Initially I was afraid that Python wouldn't be fast enough, but it is. The largest delay occurs when the sensors are read. This can take about 1.5 seconds during which the LED's can't flash since the programme is waiting for the result. Since the temperature is read about every 20 seconds, for twenty seconds it can flash, it then briefly pauses (just the top illuminated LED associated with the temperature, the lower ones don't flash and are just continuously on) after which it shows the newly measured temp which will show a flashing LED when the temperature has a fractional component.

Anyway, the work is not finished yet, since one can, for example, implement an alarm when the temperature rises too much (fire!). A Gnuplot script to regularly convert the data into a graph has been written but hasn't been put at the Pi Zero just yet. The script works on my notebook computer so I don't expect many problems here.

I suppose a lot of improvements can be made. It would be nice to use RGB LED's for example, to create a column of LED's where the color changes gradually from blue to red instead of in discrete steps, but for now I'm satisfied with the result. More images with short descriptions can be found at the imgur link: http://imgur.com/a/l6AAi


Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Pi Zero, LED thermometer using 64 SMD LED's

Wed Mar 23, 2016 9:55 pm

Very nice! The upgrade to RGB would be awesome.

User avatar
Posts: 453
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK

Re: Pi Zero, LED thermometer using 64 SMD LED's

Thu Mar 24, 2016 2:01 pm

cool project

Return to “Other projects”