A telegram bot hosted by a Raspberry Pi equipped with a temperature and humidity sensor
This is a telegram bot hosted by a Raspberry Pi equipped with a temperature and humidity sensor. The bot is capable of sending plots and readings.
Structure
This project is composed of 3 main files:
bot.py
is used to host the telegram bot.graph.py
contains theGraph
class, used to make graphs.sensor.py
contains theTemperatureSensor
class, used to write and read from the sqlite3 database, as well as the function that reads the temperature and humidity values from the sensor.
bot.py
will call both the Graph
and TemperatureSensor
classes.
Installation
Dependencies
Raspberry Pi setup
To make this project i used a Raspberry Pi Zero W with an AM2302 temperature and humidity sensor.
The humidity sensor has 3 pins:
- DATA, connected to the GPIO 4 port, it sends the readings