Image of eBits Academy network illustration

School Arrival Notifier

  • February 17, 2022
  • |
  • Robert Bogdan

This project builds a small WiFi tag that can notify your phone when it connects to a configured home or school network. It demonstrates network-based presence detection, not proof that a child has arrived safely. Network loss, service outages or a discharged battery can delay or prevent notifications; do not use it as a safety-monitoring substitute.

To be able to do this project, you need the following components. They are all to be found at ebits.

 Quantity  Component Link
1 1800mAh LiPo battery with protection circuit Link — current range; check compatibility
1 ESP32 LOLIN32 V1 Link
Or
1 School Arrival Notifier Kit Link — current range; check compatibility

 

GitHub: https://github.com/r0bigun/Key-Tag

 Table of Contents

  • Signal App
  • Bot Setup
  • Setup on ESP32
  • Understanding Signal Message API
  • Sending Message to Signal App with ESP32
  • Battery
  • ESP32 Module (Voltage divider)
  • Generalisation
  • Troubleshooting
  • Battery Life
  • Demonstration Video
  • Signal App

    Signal offers messages, groups, stickers, photos, files and voice calls with end-to-end encryption between participants. This project uses third-party CallMeBot, not an official Signal bot API. The provider receives the message text and phone number in the HTTPS request. Consult its current documentation, availability and privacy terms before configuring it; historical onboarding steps may no longer apply. ESP32 will monitor WiFi connection, and based on that it will send a message about the arrival of your child, depending on which WiFi is connected.

    Bot Setup

    The first step will be to download the Signal app from Google Play or the App Store. (Skip this step if you're already using the signal app).

    The bot that we will use in this project is known as Callmebot. Steps to add bot to your Signal app are as followed:

    1. Use only a contact currently listed by the provider at CallMeBot. Do not use historical contact numbers from screenshots. You can name the verified contact Ebits Bot. 
    2. Follow the provider’s current onboarding procedure. The old command “I allow callmebot to send me messages” is shown only as historical context and may no longer apply.                                                          

    If the provider still supports this integration, obtain your own API key through its current registration process and keep it private. Use placeholders in shared code. 

    After supported onboarding is complete, test the integration with your own credentials; service availability is not guaranteed.

    Setup on ESP32

    To program ESP32 using Arduino IDE, we have to install the ESP32 board to Arduino IDE first. This assumes that you have the Arduino IDE installed on your computer. If you do not have it, the following guide is available: Setting up ESP32 for Arduino and Platform IOFollow the guide up to step 4, including it, then download this driver so that your computer can recognize the ESP module.

    How to install the USB driver:

    1. Click on the download icon in the right corner
    2. Unzip the file
    3. Run the installer which you unzipped, depending on which operating system you have 32 bit or 64 bit
    4. In the Arduino IDE when the CH340 is connected you will see a COM Port in the Tools > Serial Port menu, the COM number for your device may vary depending on your system.

    Before selecting your specific board, install the ESP32 board-support package (not a sketch library). You can do that by selecting Tools -> Board -> Boards Manager… -> write “esp32” in the search section -> press “Install button”.

    To select the ESP32 board , first make sure you have connected it to your computer. Choose the exact board matching your hardware. The image shows WEMOS LOLIN32 Lite; LOLIN32 V1 and Lite are different boards, so verify pinout, USB-UART chip and charger before selecting.

    We will require you to copy the code from GitHub and paste it into our Arduino IDE.

    Understanding Signal Message API

    Below is the API format to send a text message to the Signal app.

    https://api.callmebot.com/signal/send.php?phone=[phone_number]&apikey=[apiKey ]&text=[message]

    [phone_number]: Your Phone number, including the country code. Ex. +4512345678

    [apiKey]:  Your API key that you received in the “Bot Setup” section, second step.

    [message]: Message text to send. URL-encode query parameters; spaces may use +, while a literal + in the country code must be encoded as %2B.

    Example:

    https://api.callmebot.com/signal/send.php?phone=YOUR_PHONE&apikey=YOUR_API_KEY&text=Hello+from+eBits

    If supported by the current service, requesting this URL with your own URL-encoded values sends “Hello from eBits” to Signal. Never share a URL containing your real API key.

    Sending Message to Signal App

    The following code will send your message to the Signal app, when the tag connects to a configured home or school network. Therefore you will receive a message from “Ebits bot” about the event and level of the ESP32 battery.

    Before we build and compile, there is information that must be entered in the code for the ESP32 to connect to your internet and also to the Signal Bot. Now enter your unique information, but keep "".

    After that, you have to add your registered Signal app mobile number with country code, to the phone section and add your API key to you to apikey section. (Same API key that you received by bot).

    Do the same thing in the “void School()” section.

    In the end just upload the code.

     

    If all the information that is specified above has been changed correctly, the Tag from the start should connect to your home WiFi and go to deep sleep mode. Therefore, it will wake up every 5 minutes checking for the WiFi connection.

    Once the connection is lost(child is on his way to school), Tag is trying to reconnect to available WiFi(in our case it is school) until it gets connected successfully, by sending a message about the event. You will receive a message in your Signal app depending on which WiFi it will be connected to.

    Battery

    To supply our ESP32, we need such a type of battery — current range; check compatibility, which has the advantage of being small in size and large in capacity. Use the exact mating battery connector or a suitable adapter with verified polarity. Do not cut or force an incompatible connector. Confirm the board’s charging voltage and current match the cell. 

           

    Note: Charging LED behaviour depends on the board version; consult its documentation instead of relying on colour alone.

    ESP32 Module (Voltage Divider)

    The example uses WEMOS ESP32 Lite. Measure the complete board’s sleep and active current; regulator, LEDs and firmware determine actual battery life.

    Last but not least, a cool feature is that you are able to get the level of the battery transmitted by the message to your phone, just by using theory of rule of voltage divider and soldering 2 resistors on the board. Isn't it amazing?

    Below its shown the mini circuit that you have to solder and then attach to the esp board as in follow image:

    Generalisation

    After you are done with setting up step by step, you are free to plug the battery with the respective polarity marked on the board. The black cable - minus and the red - plus. From the pictures below, it can be seen that a 3D-printed box has been designed, which is small  and it won't take up much space in your child's bag.

    The box can be downloaded and printed, with an option to change the box dimensions with the parameter settings in Fusion 360.

    Battery Life

    The battery of the device can last about 1-2 days, depending on how big it is distance from home to school. Because in that time ESP is consuming more power than usual by trying to reconnect to available WiFi.

    Troubleshooting

    If registration fails or reports a full bot, consult the provider’s current documentation. Do not automatically trust replacement numbers received in an unsolicited message.

    If you lose an API key, follow the provider’s current recovery or rotation procedure. Do not rely on historical commands to recover it.

    Demonstration Video

    Leave a comment

    Please note, comments need to be approved before they are published.