tempsense

Tempsense

A Telegram Bot that controls IOT devices on a Raspberry Pi Zero W and brings API data to the chat.

background: This project was first developed to monitor a server room’s temperature using telegram bot to receive the values. As the time didn’t help at that moment, I didn’t finish the project. But now let’s go.

Today it’s a bot with multi-functions and programmable to receive more functions.

Materials:

  1. Any Raspberry Pi - I’m using Raspberry Pi Zero W on headless
  2. DHT11 temperature and humidity sensor
  3. BC548 Transistor
  4. 10k Ohms Resistor
  5. 5VDC Relay module - 110/220VCC
  6. Telegram Bot API token
    • Create with @BotFather on Telegram and it will give you the bot token
    • Enable inline commands and make the ones you want

Build system

Run pinout on raspberry’s terminal to see which pin to connect - see map of the GPIO to see the connections.

Now just chat with the bot or add it on a group or channel. Functions below!

I’m leaving the other files to further study, so just ignore them - or don’t.

Soon more info.

Autostart on boot

Any change on the system, remember to modify it on the service file.

Bot commands

extra: /update - updates within repository

Electronic schematic

This is the transistor BC548 used to toggle 3v3 to the input of the relay.


What’s new

2023

2022

2021

References


WARNING: I don’t know why, but if you add the bot already running in a group, the code AND the bot cracks, and it stops working forever, I lost like 4 bots doing that. If you know why please contact me or send and issue or PR i dunno. Thanks a lot!