Fire Alarm System is designed to alert us to an emergency so that we can take action to protect general public. Fire alarms are found in offices, factories, and public buildings, they are a part of our everyday routine but are often overlooked until there is an emergency at which point, they might just save our lives. Alerts can be send to office staff, building people, factory workers and also direct to fire department. After detecting fire, we can immediately call fire brigade or now a fire extinguisher is almost present everywhere. Till fire brigade come and take control public can use extinguisher to reduce property loss to some extend.
But, there are some old buildings like mine which does not have any such facilities. So here is the FIRE ALERT SYSTEM for my house to be safe which sends SMS on mobile when fire detected.
HOW IT WORKS?Now you will think, how this device works? Here is the answer.
When you power on this device Green LED gets ON which gives us a signal that everything is fine and no need to worry. A certain threshold for temperature is set to know whether fire is there or not. If temperature sensor detects very high temperature and beyond threshold Green LED gets OFF and Red LED and buzzer gets ON and it sends alert text message on your mobile phone. This continues till situation gets clear. As situation gets clear again, red LED and buzzer gets OFF and green LED gets ON. The device reads value after every 10 secs.
- Connect LM35 on breadboard. It has 3 legs, hold it in the position such that its flat side faces you and identify the pins of the sensor as VCC, Output and Ground from your left to right.
- Connect VCC to 5V on bolt module, Output to A0 analog pin on bolt module and Ground pin to Gnd pin on bolt module using male-male jumper wires.
- Connect red and green LED on breadboard and connect a resistor to longer leg of both LED. Connect longer leg of red LED to GPIO pin 1 on bolt module and longer leg of green LED to GPIO pin 0 on bolt module using male-male jumper wires. Connect short leg of both LEDS to ground using wires.
- Connect longer leg of buzzer to GPIO pin 2 on bolt module and short leg to ground.
2.1Set Your Bolt Device On
- To power on Bolt device on use USB cable by connecting it directly to PC or adaptor. Set up your bolt by creating bolt account. Follow the steps given in the link to set bolt device https://cloud.boltiot.com/docs. Check if both blue and green lights are on bolt device.
2.2 Get your API KEY and DEVICE ID
- Login to your bolt could account http://cloud.boltiot.com/.
- Copy your Device ID.
- Go to API section and copy your API KEY.
Twilio is the third party SMS functionality provider. It allows developers to send and receive text messages and calls.
- Open Twilio https://www.twilio.com/.
- Click on 'Sign Up' to create account. Enter firstname, lastname, your E-mail Id and your password and accept its terms and condition. Click on 'Start your free trial'.
- Verify your Email Id and Mobile No. to proceed. Go to your dashboard.
- To get trial No. click on 'Get a Trial Number'.
- Click on 'Choose this Number' to get your trial number.
- You will get your trial no and click on 'Done'. Copy your Account SID and AUTH TOKEN and Trial Number which is underlined. Click on show button to view your Auth Token no.
- Here for this project I have used VMware software for writing python code. You can use any other software for it.
- Download software from link https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/12_0
- Also download Ubuntu Server ISO. http://releases.ubuntu.com/16.04/ubuntu- 16.04.6-server-i386.iso
- After downloading the software, instakk VMware with default setting and accepting their terms and condition.
- Open VMware, click on 'Create a new Virtual Machine'.
- In Installer disc image file, select the location of ubuntu server iso which we have downloaded with VMware software by clicking on browse and click on next.
- Enter your fullname, username, and password. Remember this username and password as you will need it to login in to your server. CLick on next. When asked for disc size, select 10GB and select 'store virtual disc as single file'.
- Finsh the process and it will take some time for installation.
- After installation completes, open ubuntu server, login in your machine and install all the python libraries.
To update packages- Execute below command on server.
sudo apt-get -y update
To install python3 pip3- Execute below command.
sudo apt install python3-pip
To install boltiot library - Execute below command.
sudo pip3 install boltiot
5. Write Python Code- Open your VMware workstation, login in to your server.
- Create a new file to store all Twilio credentials and bolt API key and device id by executing below command and save the file by pressing Ctrl+X
sudo nano conf.py
- Now create a new file to write our python code to send alert.
sudo nano fire_alert_system.py
Comments