Introduction: IoT Push Notification Using Rain Sensor With MicroBit

About: Hello there, I'm Abdulrahman Ahamed, a mechatronic engineer at Universiti Malaysia Pahang. I love making cool projects using different types of microcontrollers!

So many useful applications can be done with the rain/water sensor, in this tutorial, you will learn how to use both of rain sensor and the wifi module to send push notifications to your telegram app 💦🚨

Supplies

Step 1: Connection

By following the diagram above:

  • Connect the grove wifi module to P15 and P16
  • Connect the rain sensor to P0

Step 2: Code

Now, connect your REKA:BIT to your device and open MakeCode editor to start programming.

  • Add “ESP8266 Cytron” extension and follow the code block in the picture above
  • After completing the code, download it on microbit

You can also view and edit the code by clicking here!

Step 3: Send Message to Telegram

Follow the steps here to create a Telegram bot, get the API key of the Telegram bot and the chat ID.

If you want to learn more on how to send messages to Telegram, please check the video tutorial here

Step 4: Project Complete

Upon completing the project successfully, you shall receive a message notification on your Telegram application when the rain sensor gets wet.