Create your very own Smart Safe Box made from Bolt Wi-Fi module, an LDR and a Buzzer ; which when opened starts buzzing and also sends a message on Telegram and a SMS on Twilio.
2. Introduction:Inspired from the safety alarm system present in cars, this project creates a Safe Box which emits a noise when the box is opened. When the Safe Box is opened, the buzzer starts buzzing and continues to buzz until it is disabled by us. In addition to this, a Telegram message and a Twilio SMS will be sent to us alerting us that someone has opened the box. With just a few components, we can create a smart Safe Box which can safely contain our valuables and alert us when someone opens it.
3. Demonstration:4. Connections and Construction for Safe Box:Connect one lead of LDR in 3v3 pin of Bolt Wi-Fi module
Connect other lead of LDR in A0 pin of Bolt Wi-Fi module
Connect one lead of resister in A0 pin of Bolt Wi-Fi module
Connect a jumper wire in GND pin of Bolt Wi-Fi module and the other end of jumper wire to any one of the pin in the bread board
In that column of bread board, connect the other lead of resistor and negative pin of buzzer
Connect positive pin of buzzer in 0 pin of Bolt Wi-Fi module
(For connecting buzzer use male to female jumper wire)
Make a small hole at the bottom of your Box. Place the Bolt Wi-Fi module and bread board connections inside the Box. Pass the USB cable wire through the hole in the box and connect it to the Bolt Wi-Fi module. The blue and green light should turn on and should be stable.
Here I’ve used a Ubuntu server installed with the help of VmWare. You could also install it with help of Virtual Box or you could create your own server using Digital Ocean.
We use Twilio and Telegram to send alerts.
5.1Twilio is a third party SMS functionality provider. I’ve setup a trial Twilio account which helps me in SMS delivery.
After creating your Twilio account and creating a new project, go to Project Info to get your SID and Auth token. When asked to select a feature/project type to get started with, select programmable SMS. Click 'Get a Number' and then 'Choose this Number' to get your from number. The SMS will be sent from this number to our phone number (Make sure your own phone number is registered on your Twilio account).
5.2Telegram is a messaging app similar to WhatsApp. You can send and receive messages along with files also. A channel is to Telegram what Groups are to WhatsApp. Bots are third-party applications that run inside Telegram. We will be using Bots to send alerts on our channel.
Install Telegram app from the Play store and create your own account. In the home screen, swipe the left side and select “New Channel”. Follow the steps shown to you and create a new channel, and keep note of the channel permanent link.
In the home screen, with help of search icon, search for “BotFather”. Choose the correct BotFather (it will have a blue tick beside it). Type /newbot. Then type a bot name and a bot username for your bot. The BotFather will send you a Bot token. Keep note of this Bot token.
On the channel you created, the bot will send alerts to us whenever some condition is satisfied.
We have to create two python files and a bolt product on your Bolt IoT Cloud:
5.3conf.py:
In conf.py file, store the bolt API key and bolt device id (fromcloud.boltiot.com)
Telegram chat id, telegram bot id (for telegram message)
Sid, auth token, from number and to number (to number is your own phone number) (for Twilio SMS)
5.4telegram_alert.py:
An LDR is a light sensor. It senses the amount of light falling on it.
In this program we obtain the light falling on LDR, which is the sensor value. If it exceeds a threshold value (set by you), the buzzer will start buzzing and a message is sent on telegram and a SMS is sent by Twilio.
5.5Disable buzzer:
Create a Product on your Bolt Cloud. Give it a product name and select “Output Devices” and “GPIO”. Then configure your product. In the hardware section, select the ‘0’ pin and give it a name ‘buzzer’. In the code section give it a suitable file name and select html as file type. Write down the following code.
Save your product and link it to your bolt device. You will be able to disable the buzzer by clicking the OFF button from your Bolt app on your phone.
When the box opens, the sensor value increases, thus crossing the threshold value. So the buzzer starts buzzing and a SMS (from Twilio) and message is sent to you on Telegram. From your Bolt app on your phone, you can click "OFF" to disable the buzzer.
Comments
Please log in or sign up to comment.