Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 5 hours 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-19T19:12:39.000Z (about 1 year ago)
- Last Synced: 2025-02-06T20:45:50.979Z (1 day ago)
- Topics: dht22, iot, mqtt, nestjs, nodejs, postgresql, raspberry-pi, smart-home
- Language: TypeScript
- Homepage:
- Size: 2.69 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
RPi Smart Thermometer
## Architecture
![Architecture diagram](docs/rpi-smart-thermometer-architecture.drawio.png)
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
![Hardware schematics](docs/rpi-smart-thermometer-schematics.png)
## 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