A telegram bot that tells you how much coffee there is in a pot.
The hardware consists of a kitchen scale, HX711 ADC and a raspberry pi.
If you decide to use a kitchen scale for this bot, you might have to do a bit of soldering. Solder the wires coming from the scales weight sensors to a female jumper wire. The wire coloring from the weight sensors or kitchen scales may vary but usually the colors are straightforward. The wiring from the sensor to the HX711 goes as follows:
- Red --> E+
- Black --> E-
- Green --> A-
- White --> A+ (This wire might be different in color, for example in this case it was yellow)
From the HX711 to the pi, the wiring is pretty straightforward:
- VCC to raspi pin 2 (5V)
- GND to raspi pin 6 (GND)
- DT to raspi pin 29 (GPIO 5)
- SCK to raspi pin 31 (GPIO 6)
This bot uses the HX711 library by Tatobari (modified from Philip Whitfield). On how to use the library in question, use the example.py file provided in the library.
Create your own telegram bot with the instructions from Telegram.
Clone or download the files from this repository to your raspi. Get the reference unit for your scale with instructions found in the HX711 library. After you have your reference unit, open up the server.py file and initiliaze the scale object with your GPIO pin numbers and reference unit (Scale(5 ,6, 1509) in my case). After this create a config.ini file to your directory containing the python files. Construct it as shown in the image below:
The "weight" in the config file is used to store calibrated weight of the coffee pot so the calibration doesn't have to be done everytime the raspi reboots. After this run the server.py file and everything should be working! Start chatting with your bot! To see available commands for the bot and what they do use command /help.