Raspberry Pi Temperature & Humidity Network Monitor – DIY Setup Guide
Raspberry Pi Temperature & Humidity Network Monitor – DIY Setup Guide
Build a reliable, network‑connected temperature and humidity monitor using a Raspberry Pi and an inexpensive sensor. This guide provides a complete parts list, step‑by‑step instructions, and the software needed to capture, store, and visualize data.
Bill of Materials (BOM)
- $35.00 – Raspberry Pi Model B – Newark
- $8.12 – Classic Pi Case – Pi Hut (5.99€)
- $6.99 – SD Card (SanDisk, not Kingston)
- $15.00 – DHT22 Temperature/Humidity Sensor – Adafruit
- $15.99 – PoE Splitter – Newegg
- Miscellaneous: hand tools, soldering iron, hot‑melt glue gun, plastic standoffs, rubber feet, etc.
Step 1: Physical Assembly
1. Separate the case halves and set aside the rubber feet.
2. Mount the Raspberry Pi on the bottom half with the supplied hardware.
3. Remove the GPIO knockout using a razor blade or X‑acto knife.
4. Cut a 1.1×2.4×0.75 in. plastic standoff (Azek) to isolate the sensor from the Pi’s heat output.
5. Apply hot‑melt glue to the standoff, sensor, and case halves as shown in the diagram, ensuring the LED cutouts and camera ribbon cutout remain unobstructed.
6. Attach rubber feet to the bottom of the PoE adapter for stability.
7. Set the PoE splitter’s voltage‑output switch to 5 V and lock it in place with a dab of glue.
Step 2: Electrical Wiring
The DHT22 has a spare ground wire; trim it off. Then:
- Wire the sensor to a 5‑pin female header: Red (+3.3 V), Yellow (Data), Black (Ground). The middle two pins are unused.
- Connect the header to the Raspberry Pi’s GPIO as follows:
- Red → GPIO Pin 1 (3.3 V)
- Yellow → GPIO Pin 7 (GPIO 4)
- Black → Ground (GPIO Pin 9)
- Use a short CAT5 cable to link the PoE splitter’s LAN OUT to the Pi’s Ethernet jack.
- Splice a Micro‑USB cable to the PoE splitter’s power output. For an Adafruit connector, follow the wiring diagram at Adafruit; otherwise, identify +5 V and GND with a multimeter (white stripe = positive).
Step 3: Raspberry Pi Software Setup
1. Download the latest NOOBS image from Raspberry Pi Downloads and format your SD card using SD Card Formatter.
2. Install Raspbian, selecting English‑US keyboard and enabling SSH and headless boot. Set a memorable hostname (e.g., rpithon) and a 16 M memory split.
3. Log in via SSH (ssh [email protected]) and update the system:
sudo apt-get update && sudo apt-get upgrade && sudo rpi-update && sudo reboot4. For convenience, enable the root account and remove the default
pi user:sudo passwd root sudo deluser --remove-home pi5. Install essential utilities:
apt-get install emacs23-nox and configure SSH for no X11 forwarding, no DNS, and a 60‑second keep‑alive.6. Set the SD card to perform a file‑system check on every boot:
tune2fs -c 1 /dev/mmcblk0p6.
Step 4: LAMP Server Installation
Install the web stack to host data visualizations:
sudo apt-get install apache2 php5 mysql-client mysql-server vsftpdChoose a secure MySQL root password during the installation. Afterward, verify the web server by navigating to https://rpithon or https://
Step 5: Python Environment & Data Handling
Install Python packages for MySQL and plotting:
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py python ez_setup.py sudo apt-get install python-mysqldb libmysqlclient-dev sudo easy_install MySQL-python sudo apt-get install libblas-dev liblapack-dev python-dev libatlas-base-dev gfortran python-setuptools python-scipy python-matplotlib
Step 6: WiringPi GPIO Interface
Use Gordon Henderson’s WiringPi library to interface with the DHT22 and to log data to the MySQL database. Refer to the WiringPi documentation for detailed API usage.
Maintenance & Troubleshooting
- After roughly 49 days +16 hours the sensor may flat‑line; a reboot clears the issue. Schedule a monthly reboot if the system runs unattended.
- Use SanDisk SD cards to avoid the reliability problems previously experienced with Kingston.
- Keep the PoE splitter’s power‑output switch locked to 5 V to protect the Pi.
With the hardware assembled, software configured, and the sensor data flowing to a web interface, you now have a fully functional, network‑connected environmental monitor suitable for home, office, or small‑scale industrial use.
Manufacturing process
- Build a Raspberry Pi Temperature Logger with a $5 I2C Sensor
- How to Read Temperature with a DS18B20 on Raspberry Pi 2
- Professional Raspberry Pi Temperature Monitoring with DS18B20
- Measuring Temperature on Raspberry Pi with Maxim 1‑Wire Sensors and DS2482 I2C Bridge
- Seamless Temperature & Humidity Monitoring on Raspberry Pi with EzTemp
- Build a Raspberry Pi Weather Station that Emails Daily Weather Data
- Accurate Temperature Monitoring in a Server Closet with Raspberry Pi
- Build a ThingSpeak Temperature Monitor with Raspberry Pi & BrickPi
- Monitor Your Home Temperature with a Raspberry Pi Dashboard
- Build a Raspberry Pi Home Temperature Monitor with MCP9808, InfluxDB & Grafana