A Fabulous Festive Raspberry Pi Thermometer

Using the Raspberry Pi to make a winter thermometer with snow alert.

As of recent I’ve been doing more projects with Raspberry Pi, starting out by learning Python basics on the Pi and then moving on to building a Raspberry Pi 1-Wire thermostat.

Next I decided I wanted to make something using Raspberry Pi which was more useful and considering the time of year, at the same time festive. Designing a Festive thermometer using the Raspberry Pi and DS18B20 temperature sensor seemed like a good idea as I had worked with these two not long ago.

a-fabulous-festive-raspberry-pi-thermometer

Planning

I planned to use LEDs connected to the GPIO pins of the RPi to indicate varying temperature readings from the DS18B20. This would be used to create a display which would indicate from -5ºC to +5ºC. When there is the highest chance of snow there will be an additional 6 LEDs which flash for a number of times once the temperature has reached 0º.

Since this was a festive thermometer I thought it would be appropriate to house it in something like a snowflake. I made a rough hand drawn sketch of what it would look like and I had an idea in my mind of how it would connect.

I had to ensure that the Raspberry Pi was in close proximity to the acrylic snowflake and decided the best way would be to mount this on the reverse. However, this needed to be concealed so that the snowflake design would be aesthetically pleasing. To achieve this I used a snowflake template with a large centre so I could mount a circular panel stood off from the back.

I had figured out I would need 13 GPIO pins from the Pi; this accounted for the 11 temperature indicating LEDs, the six LEDs which would illuminate when there was a high chance of snow and the temperature sensor.

The main part of this project was going to be writing the Python script. For someone who has little experience in Python and needing to write multiple functions this was going to be a challenge!

Coding

The first function I created was the easiest, since I just needed this to take readings from the DS18B20. I had done exactly this previously when I built a Raspberry Pi 1-Wire thermostat and I used the code from this project as the basis for the first function.

codind

I then tested the function before starting work on the next one. To do this I used print with my getTemp() function in the while loop. As this correctly displayed temperature readings from the DS18B20 it reassured me that this function was working fine, therefore I could move onto my next function.

 

Read More:  A Fabulous Festive Raspberry Pi Thermometer


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top