A temperature and humidity sensor (Si7021) with an OLED screen on top of Pi Zero.
The OLED shows temperature in C and F, and humidity. It is refreshed every 15 seconds.
In the background, the average of every half an hour is recorded in a csv file.
The csv file is later read by pandas, and
Dash for the webserver for visualization.
You have a basic selection of the days for the range of dates in the
csv file. You can access it on http://[pi_ip]:8050/
, and should show something like:
What's inside:
- Raspberry Pi Zero W
- Adafruit PiOLED - 128x32 Monochrome OLED
- Adafruit Si7021 Temperature & Humidity Sensor
- Adafruit Perma Proto Bonnet Mini Kit
- Some cable and solder
Software:
- Latest version of HypriotOS
- Flash it to your SD card with this guide we made here
- Set your WiFi network in
/etc/wpa_supplicant/wpa_supplicant.conf
based on the guide. - SSH to your pi, after finding its IP on your local WiFi:
pi@192.168.x.x
git clone
this repo, I assume at /home/pi for the rest.- Install pandas and dash with pip3.
- To startup the codes create
/etc/rc.local
,chmod +x /etc/rc.local
, and edit it withsudo vim /etc/rc.local
#!/bin/sh
#
# rc.local - executed at the end of each multiuser runlevel
#
# Make sure that the script will "exit 0" on success or any other
# value on error.
sudo echo "$(date +%s),$(date),$(uname -a)" >> /home/pi/logs/reboot.log
sudo python3 /home/pi/boot_oled.py > /dev/null 2>&1
sudo python3 /home/pi/update_oled.py > /dev/null 2>&1 &
sudo python3 /home/pi/app.py > /dev/null 2>&1 &
- Network Wide ad Blocker: Pi-Hole
- Always install fail2ban
- Additional blacklists for your Pi-Hole: https://firebog.net/
- DNS over HTTPS cloudflared