Digital RPi LED Thermometer




Introduction: Digital RPi LED Thermometer

About: Hi, I love electronics, 3d printing and sharing what i make. I mostly try making useful things, but sometimes I also make some just for fun and for learning something new. And if you like what you see, follow…

Raspbian OSLearn how i made this Digital LED Thermometer, with a Raspberry Pi Zero W, LED strip, an OLED Display, and a custom PCB.

It automatically cycles thought a list of cities, and displays the temperature on the OLED display, and the LED's. But you can also manually select a city to display, with the buttons on the side. On top of that, it will shut off the LED's and the OLED, if it's been inactive for a few minutes, and will turn back on, if it detects a significant light change (Controlled by an LDR).


- A Raspberry Pi Zero W and SD-card with Raspbian OS

- A 1.5 Inch OLED Module by Waveshare

- A 5V 2.4A Power Supply for Raspberry Pi

- A 5m WS2812B LED Strip, 30 LEDs/m

- Screws, washers, bolts and standoffs.

- A Custom PCB, with buttons, a switch, an ldr, pin-headers, and more

- Soldering iron and solder

- Hot glue

- Wood glue

- 4mm and 6mm plywood

- 3mm white acrylic

Step 1: Weather Data

Credit to StuffWithKirby for his code on reading JSON weather data in python.

I collect the weather data free from, where they supply weather data from a lot of the bigger cities, in a lot of countries.

1. Start by making a FREE account on

2. Then copy your api-key to use later.

3. Now download, unzip and open the city.list.json.gz file, and search for the cities you want displayed, and copy the city-id's for later.

Step 2: Setting Up the RPi and Writing the Code

First I connected the OLED to the Pi, and installed the necessary libraries for the OLED, as described by the manufacturer, here.

Make sure the RPi is connected to the internet

1. Enable the I2C and SPI function in raspi-config under Interfacing Options. Exit and reboot.

2. Run this to update:

sudo apt-get update

3. Run the following commands to install the necessary libraries:

sudo apt-get install python-dev
sudo apt-get install python-smbus
sudo apt-get install python-serial
sudo apt-get install python-imaging

4. Run the following command to open the configuration file:

sudo nano /etc/modules

Make sure the following two lines, are in the configuration file, then exit and reboot:


5. Now run this to clone my GitHub repo:

git clone https:/ / .git

6. Go into the new folder, and unzip


Run this to install the library:

cd RPi_GPIO-0_6_5
sudo python install

7. Go back to the main folder, by typing by typing:

cd /home/pi/1.5inch-OLED-with-RPi/


cd ..

Then do the some with

8. Then unzip

unzip wiringPi
cd wiringPi

And run these commands:

chmod 777 build

Check the installation with:

gpio –v

9. Go back to the main folder, and unzip

cd bcm2835-1_45

10. Then run this, to install the library:

sudo make check
sudo make install

11. Again go back to /home/pi/1.5inch-OLED-with-RPi/, and run this, to test the OLED:

cd /Demo_Code/Python/
sudo python

Then i also had to install the libraries for the WS2812B LED-strip, following this guide.

After that it was just a matter of writing the code, which took about a couple of months from start to finish, working on it on and off. My code can be found on my GitHub here.

Step 3: Configuring the Weather API

1. Cd into LED_Thermometer_Code_and_OLED_driver:

cd LED_Thermometer_Code_and_OLED_driver

2. Then open


And then scroll down and edit the api-key, to your api key, from, as shown in the image above. Also change the city-ids and city names, to your desired locations.

Step 4: The Custom PCB

After having figured out all of the electronics, I designed my own PCB, to have everything connected neatly together, and got it fabricated and shipped from China.

Step 5: The Laser Cut Enclosure

Then I modeled an enclosure, and laser cut it out of 4mm and 6mm plywood. I also modeled in LED diffusers, which I cut out of 3mm white acrylic.

After that I attached the electronics and the LED-strip to the laser cut plywood. And then assembled the enclosure, partly with glue and friction, so I can take it apart if i want to.

As an added detail, i also 3D-printed button and switch extensions, so they are easier to press.

All the files, can be found and downloaded from my GitHub. You may have to scale the SVG files down to 75%.

Step 6: The Result

So I hope you like my build. I personally think it was a fun projekt to work on.

If you are interested in buying the pcb with components, feel free to DM me, and we can arrange something. Note that i only have a limited supply.

Follow my work on Instagram and Twitter.

Raspberry Pi Contest 2020

Second Prize in the
Raspberry Pi Contest 2020

Be the First to Share


    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    3 Discussions


    10 months ago

    I would love to get one of your custom PCB boards. Let me know if we can make this happen!


    11 months ago

    I love how you think, plan and execute your design. I wish more in the U.S were like this- I know there are many but few and far between.
    I have lots of ideas (and components!) but no , or little ability. I'm trying to support others, and admire from afar...


    1 year ago

    Love the design of this :D