1.INTRODUCTION:
This Light Intensity Monitor is used to know the light intensity or brightness of a place, if intensity increases beyond the certain level this whole system sends an alert message through Twilio(as sms), Mailgun(as email) and at the same time gives a perfect graphical structure of intensity of the surrounding in different graphical ways so we can visualize the data side by side. This whole system is very useful in many ways,
1.it helps to know that which place is suitable for plants growth
2. to know the intensity of light in an area
2.SOFTWARESETUP:
- Twilio:
Twilio is a third-party SMS functionality provider. It helps to send and receive text messages by using API key.
1. Creating an account in Twilio:
a.Open https://www.twilio.com/ in browser.
b. Click on sign up and fill all the details required and after that click on 'Start your free trial'.
c. To verify they will ask for your phone number. Choose India as an option in the and then enter your phone number.
d. Click on 'get a trial number'.
e. Then a popup will appear. Click on Choose this number
button.
f. Then a popup will appear which will have the final number. Copy this number and save to notepad for future references.
That's it. In this way anyone can successfully make an account on Twilio.
- Mailgun:
Mailgun is an email automation service. One can send an email using the API keys. Therefore, for the notification purpose with the help of python, we can send an email request.
1. Creating an account on Mailgun:
a.Open https://www.mailgun.com/ in browser.
b. Click on Sign Up
button.
c. You will get the scree same as the photo.
d. Fill all the necessary details.
e. At the time of filling don't forget to make the payment option free.
f. After clicking on that box you will get the screen as shown below.
g. Now click on 'Create Account'.
h. You will get a verification mail having a link. Click on that link to verify your mail.
i. After verification choose in India and add a phone number.
j.After verification, click on Add Recipient
button in the Sandbox Domain.
k. Click on 'Invite new recipient'.
l. Enter your email_id.
m. After adding email_id a new sandbox will be generated. Click on the ID of the newly generated sandbox.
n. The new screen will have all the necessary credentials that you want for sending an email.
That's it. You have successfully made an account on Mailgun.
- Ubuntu:
a. Firstly, download VMWare Workstation.
VMWare Download link - https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/12_0
b. Install VMWare.
c. Download, Ubuntu server iso.
Ubuntu Server ISO link - http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-i386.iso
d. Install Ubuntu.
e. Now, in VMWare make Ubuntu as virtual machine and select Ubuntu and after 'that play virtual machine'.
f. After this, you have to upgrade your Ubuntu server to 18.04 as it provides lots of new features and is better for this project. Type following lines on the terminal:
sudo apt-get update
sudo apt-get upgrade
g. Then, you will see a menu pane, where you have to select Ubuntu desktop and now all the packages will install and may take some time depending on your network.
h. Finally you will see your Ubuntu desktop.Enter Login credentials and you are done.
- BoltIoT:
a. Bolt Iot is used here to visualize all the graphical representation and to get alert notifications.
b. You have to register to use its cloud platform. Go to this.. www.cloud.boltiot.com
c. Click on Sign Up.
d. Enter your details in the Sign Up page shown above. Enter your name, email id (login ID for Bolt cloud), and password in the fields. Do confirm your password by typing it again in the Confirm Password field and then click on the Register button.
e. Once done with the registration you will receive a verification email and do the verification process then you can proceed.
f. You will be given a basic tour of the Bolt Cloud features on the Dashboard.
g. Now, click on API in the menu and you will find your API key copy it somewhere and keep it safe and save the unique Bolt id that you will see on the main window adjacent to online /offline label and will start with BOLTxxxxxxx.
h. Now, install Bolt app in the android and login into it.
i. Now in the Ubuntu terminal on your desktop that you created, you will have to type following commands to install Bolt packages to use the bolt device from a remote server. Which works on MQTT for communication with the server. You will have to install the pip package manager to install all python tools.
sudo apt-get -y update
sudo apt install python3-pip
sudo pip install boltiot
3.BOLTHARDWARESCHEMATIC:
We will now keep the hardware set ready.
1. Insert one leg of LDR (light density resistor) into 3.3V and another leg into 'A0' pin( GPIO pin).
2. Then, insert one leg of resistor into Gnd and another leg into 'A0'.
Remember that this to component does not touch each other.
3. Now, connect the Bolt wifi module with the USB cable and give it a power supply.
4.INTENSITYMEASURINGANDSENDINGALERTMESSAGEANDVISUALIZATION:
This is the main part where we can know how to check the intensity and as well as visualize that in a graphical manner.
- LinkingtheWiFimodulewithandroid:
a. Open Bolt app and click on add device
b. After that a few screens will guide you to setup process and then click 'Ready'
c. At this point you have to Turn On your device Location/GPS setting and also to Turn Off your Mobile Data.
d. Once the location is turned ON, the mobile phone will automatically connect to the Bolt Module's Hotspot. This can be verified by checking that LED's blinking rate on the ESP8266 Chip will be faster. At this point you have to switch of your mobile data.
e. Once you have turned Off your Mobile data, click on "CONTINUE".
f. Now we have to connect the Bolt device to a local WiFi Network which will be displayed by the app on the screen or we can add an WiFi network.
g. Enter the correct password for the WiFi selected from the previous screen. Click Connect once you enter the password. The bolt will restart and connect to the WiFi. You can verify this by checking that the BLUE LED and GREEN LED on the ESP8266 chip becomes stable.
h. Now, click on done.
i. Now, login to the cloud account on laptop/PC and get the dashboard for doing all the experiments.
- Visualizationofdata:
Open www.cloud.boltiot and click on 'Product'. Then click on 'add product'. Now, fill all the details about the project and write the code and save that.
Then, again come to the product page and click on 'deploy configuration' and after that 'view the device'. Now, you are cable to see the graphical representation.
All codes are written in JavaScript.
a.BarGraph:
a.1. Code:
a.2. Graphical Representation:
b.LineGraph:
b.1. Code:
b.2. Graphical Representation:
c.AreaGraph:
c.1. Code:
c.2. Graphical Representation:
d.SteppedGraph:
d.1. Code:
d.2. Graphical Representation:
e.ScatteredGraph:
e.1. Code:
e.2. Graphical Representation:
f.HistogramGraph:
f.1. Code:
f.2. Graphical Representation:
g.TableGraph:
g.1. Code:
g.2. Graphical Representation :
h.GaugeChart:
h.1. Code:
h.2. Graphical Representation:
i.MultipleGraph:
( for Line and Bar Graph)
i.1. Code:
i.2. Graphical Representation:
- Sendingalertnotification:
When light intensity increases or decreases from the maximum level and minimum level then this system sends alert notification o Twilio and Mailgun using Bolt ID, Bolt API key and api key of Twilio and Mailgun. To send these notifications we use VMWare Workstation to run the code and the code is written in Python3.
a. Login to Ubuntu.
b. Make a file writing 'sudo nano file_name' and write Mailgun api key, sandbox URL, sender_mail( should be mailgun@your
sandbox
URL
), Twilio API key, device_id, api_key of bolt device, to_number, from_number.
c. Now, write the whole for sending alert notifications.
Code:Here, maximum limit of intensity is 400 and minimum limit is 100. Time sleep is 5, it means after 5 seconds the monitoring system rechecks the light intensity of the surroundings.
Output:5.Conclusion:
In this way one can make a Light Intensity Monitoring System and can be alerted by it when the crucial time comes.
Comments