https://github.com/mathcale/rpi-smart-thermometer
Smart thermometer that pushes readings from a DHT22 sensor plugged on an Raspberry Pi Zero via MQTT to a Nest.js server
https://github.com/mathcale/rpi-smart-thermometer
dht22 iot mqtt nestjs nodejs postgresql raspberry-pi smart-home
Last synced: 3 months ago
JSON representation
Smart thermometer that pushes readings from a DHT22 sensor plugged on an Raspberry Pi Zero via MQTT to a Nest.js server
- Host: GitHub
- URL: https://github.com/mathcale/rpi-smart-thermometer
- Owner: mathcale
- Created: 2022-05-21T04:21:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-19T19:12:39.000Z (over 1 year ago)
- Last Synced: 2025-04-01T22:01:05.395Z (3 months ago)
- Topics: dht22, iot, mqtt, nestjs, nodejs, postgresql, raspberry-pi, smart-home
- Language: TypeScript
- Homepage:
- Size: 2.69 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
RPi Smart Thermometer
![]()
## Architecture

Every 30 minutes, a Node.js script reads the current temperature and humidity from the DHT22 sensor plugged to a Raspberry Pi Zero W via GPIO and then publishes this data via MQTT to the Mosquitto server.
On the server stack, a Nest.js microsservice listens to a specific topic on the Mosquitto server and, when there's a new message, it gets parsed, validated and stored on a PostgreSQL database. This stack is deployed with Docker Compose to my local Raspberry Pi 4 home server.
There's also a button that, when pressed, will fetch the latest reading from the Nest.js API and show it on the OLED display. After 20s, the display will turn off to avoid burn-in.
## Schematics

## Tech
### Hardware
- Raspberry Pi Zero W
- DHT22 sensor
- OLED display
- Push button
- 1K resistor### Software
- Node.js 16
- Typescript
- Nest.js
- Next.js
- Docker
- PostgreSQL
- Mosquitto