Are you tired of checking your postbox everyday for letters? Then you are in the correct place to learn how to make your own postbox alert module. Then you can wait for a notification on your phone, when you will have a letter in your postbox. It is an easy and fun project for you and your family.
This module as a microcontroller is using ESP8266 or ESP32. This microcontroller has a built-in WIFI and Bluetooth, so this is how we are going to send messages to your phone by Signal App.
The microcontroller is connected to the KY-033 tracking sensor. The sensor module detects whether there is a light-reflecting or light-absorbing surface in front of the sensor. So when a letter or paper is in front of the sensor. It will sense it and you will receive a message on your phone. This module is powered by a 18650 battery and it will be charged with a mini solar panel so you don't have to change it.
Now lets have fun with the building part :D
Required Components
The full list of the components for this Project.
ESP8266 or ESP32 | 1 |
KY-033 TRACKING SENSOR | 1 |
18650 battery holder with charger | 1 |
18650 battery | 1 |
6W Solar cell with USB port | 1 |
Female to Female dupont cables | 3 |
Micro USB to USB Cable | 2 |
Case for the module made by cardboard | 1 |
The sizes of the case needs to be: 16x3x4cm(LxWxH)
Guide
You will need to install Arduino IDE from this link. With this you can program your ESP8266, ESP32 and more other microcontrollers.
Setting up the ESP8266 or ESP32 on Arduino IDE
First you need to set up your microcontroller on Arduino IDE, you can check this Link for ESP8266 set up or this Link to set up the ESP32 until step six.
Cable Diagram ESP8266 and KY-033 Sensor
Setting up the KY-033 Sensor and testing
To test the KY-033 Sensor you can use the code from this Link.
SETTING UP WIFI ON ESP8266
Setting up wifi on ESP8266 is quite simple and there are many guides.
From this photo you can see the name of my WIFI and the password. So you can replace them with your WIFI credentials.
Here you can see the start of the code. The function above is called void setup (). Here is where we are starting the serial communication, so we can read there whether a fob connection has been created. We are doing this to ensure that the ESP can connect to the WIFI.
NOTE: If the postbox is too far from your home the ESP may not have WIFI connection. Therefore, to be sure you can take the ESP where the postbox is, you can check if it has a WIFI connection. It may be required to use a WiFi range extender or change the place of the router.
Setting up the Signal App Bot
First step, install the Signal App to your phone. Google Play App store
About Signal App Bot
From a user perspective, the experience of using Signal is just like WhatsApp, Facebook Messenger, and other popular chat apps. It is a messaging app with features like one-to-one messages, groups, stickers, photos, file transfers, voice calls. Your conversations in Signal are start-to-end encrypted, which means that not even the owners of Signal can monitor them. Only the people in the conversation can see them. Besides this, the Signal app allows us to use a bot to send messages automatically for them.You can interact with the bot, and the bot will interact with the signal app using a specific API, by sending HTTPS requests.
ESP8266 will monitor WiFi connection, and based on that it will send a message if you get a letter to your postbox.
Guide
Add the number “+34 603 21 25 97” to your contact list and give it a name that you want (let’s say ‘Postbox or Signal Bot’ for example)
Then send the following message to that contact:
“I allow callmebot to send me messages”
You should get a reply “New user registered”, followed by an API key, then you can send messages to your phone with the received link.
https:/api.callmebot.com/signal/send.php?phone=<yourphonenumber>&apikey=xxxxxx&text=This+is+a+test
In this part of the code you need to change the credentials to your phone number with the country code and write the apikey that you received from the message. Then you can change the text that you want to send as a message to your phone.
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]: Text message you want to send ( all space ‘ ‘ need to be converter to ‘+’)
Example:
https://api.callmebot.com/signal/send.php?phone=+4512345678&apikey=526310&text=Hello+from+eBits
Calling the above URL in any browser search bar, you will get “Hello from eBits” as a message in the Signal app if your phone number and API key are correct.
Final test
You can have access to the full code from this Link. After you change the needed things in the code and you wire up the sensor to the ESP8266 or ESP32 and test it.
When an object is in front of the sensor it will start the communication with the Signal App and it will send the message to your phone. Then until you pick up the items in front of the sensor it will not send anymore messages to your phone. Later you can pick them up and the ESP will make a reset and it will be ready for incoming letters in your postbox to send a message again.
This is an example photo of how you will get messages on your phone.
Here you can see an example of how it needs to be placed in the postbox. You have to put it in such a way so when the paper is in the postbox it will be in front of the sensor for the best results.
The solar panel can be put where the light shines the most on it and the cable placement depends on your postbox.