https://github.com/bartekl1/rpi-thermometer
:thermometer: Raspberry Pi Thermometer
https://github.com/bartekl1/rpi-thermometer
dht11 ds18b20 humidity humidity-logger humidity-monitoring humidity-sensor iot raspberry-pi raspberry-pi-projects raspberry-pi-temperature raspberry-pi-thermometer raspberrypi smart-home smarthome temperature temperature-logger temperature-monitoring temperature-sensor thermometer
Last synced: 5 months ago
JSON representation
:thermometer: Raspberry Pi Thermometer
- Host: GitHub
- URL: https://github.com/bartekl1/rpi-thermometer
- Owner: bartekl1
- License: gpl-3.0
- Created: 2024-01-22T16:54:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-18T17:11:05.000Z (about 2 years ago)
- Last Synced: 2025-01-24T12:32:40.503Z (over 1 year ago)
- Topics: dht11, ds18b20, humidity, humidity-logger, humidity-monitoring, humidity-sensor, iot, raspberry-pi, raspberry-pi-projects, raspberry-pi-temperature, raspberry-pi-thermometer, raspberrypi, smart-home, smarthome, temperature, temperature-logger, temperature-monitoring, temperature-sensor, thermometer
- Language: Python
- Homepage:
- Size: 119 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# đĄ Raspberry Pi Thermometer




[đ Changelog](CHANGELOG.md)
[đ Acknowledgements](ACKNOWLEDGEMENTS.md)
[đĩđą Polish version of README](README_PL.md)
## âšī¸ About
### Available sensors
- DS18B20 (temperature)
- DHT11 (humidity)
### Available functions
- Measure current temperature and humidity
- Save temperature and humidity to database
- Simple website with current readings
## đ¨âđģ Installation
1. Connect the DS18B20 and DHT11 sensors to the Raspberry Pi.
2. Clone repository
```bash
git clone https://github.com/bartekl1/rpi-thermometer
cd rpi-thermometer
```
3. Create database and import structure from `thermometer.sql` file.
4. Create configuration file named `configs.json` with the following content.
```json
{
"host": "0.0.0.0",
"mysql_user": "",
"mysql_password": "",
"mysql_database": ""
}
```
Replace ``, `` and `` with correct credentials.
5. Install PIP dependencies.
```bash
pip install -r requirements.txt
```
6. Create `/etc/systemd/system/thermometer.service` file with the following content.
```ini
[Unit]
Description=Thermometer
After=network.target
[Service]
WorkingDirectory=
ExecStart=/usr/bin/python3 /app.py
Restart=always
User=
[Install]
WantedBy=multi-user.target
```
Replace `` with path to the cloned repository and `` with your system username.
7. Start and enable created service.
```bash
sudo systemctl start thermometer
sudo systemctl enable thermometer
```
8. Add following line to crontab (edit using `crontab -e`).
```text
*/10 * * * * cd "" && python3 save_to_database.py
```
Replace `` with path to the cloned repository. You can edit cron expression to change frequency.