Build a 4 MCB circuit with Telegram notification using optoisolators
We are monitoring 4 * MCB in our project. User will receive notification, If any MCB goes tripped then device will send message on predefined telegram channel. All MCB’s are interfaced with NodeMcu WiFi Module. This circuit can be used to send notifications to a Telegram channel whenever one of the MCBs trips.
Connect the MCBs to the optoisolator
Connect the 4 MCBs to the optoisolator. The common terminal of each MCB should be connected to the A (anode) terminal of the optoisolator. The NC (normally closed) terminal of each MCB should be connected to the K (cathode) terminal of the optoisolator.
Connect the optoisolators to the NodeMCU
Connect the optoisolator to the NodeMCU as shown in the following diagram. The VCC (positive) terminal of each optoisolator should be connected to the 3.3V pin on the NodeMCU. The GND (negative) terminal of each optoisolator should be connected to the GND pin on the NodeMCU. The OUT (output) terminal of each optoisolator should be connected to a digital pin on the NodeMCU.
Create a Telegram bot
To create a Telegram bot, you will need to chat with BotFather, a bot that can create other bots. To do this, open the Telegram app and search for “BotFather”. Then, start a chat with BotFather and follow the instructions to create a new bot.
Once you have created your bot, you will need to get its token. The token is a long string of characters that will allow you to control your bot. To get your bot’s token, open the chat with BotFather and type the following command:
/token
BotFather will then respond with your bot’s token.
Configure your Telegram bot
To configure your Telegram bot to send notifications when an MCB trips, you will need to edit its configuration file. The configuration file is a .json file that is located in the Telegram bot’s directory.
To open the configuration file, you can use a text editor like Notepad or Sublime Text. Once you have opened the configuration file, you will need to add the following code to the on_message
section:
{
"chat_id": "YOUR_CHANNEL_ID",
"text": "MCB tripped"
}
Replace YOUR_CHANNEL_ID
with the ID of your Telegram channel.
Once you have saved the configuration file, your bot will start sending notifications to all of the users in your channel whenever an MCB trips.
Here are some additional tips for configuring your Telegram bot to send notifications:
- You can use the
chat_id
property to specify the ID of the chat where you want to send notifications. - You can use the
text
property to specify the text of the notification. - You can use the
parse_mode
property to specify how the text of the notification should be formatted.
Test your circuit
Once you have configured your Telegram bot, you can test your circuit by tripping one of the MCBs. If your circuit is working correctly, you should receive a notification on Telegram.
Here are some additional tips for creating this circuit:
- Use a high-quality optoisolators to ensure that they can handle the current from the MCBs.
- Use a breadboard with enough space to accommodate all of the components in the circuit.
- Make sure that all of the connections in the circuit are secure.
Reviews
There are no reviews yet.