This project has primarily Four functionalities i.e.
1.Turning on & off Street Light (Led) automatically when light in surrounding is change which are continuously monitor by LDR.
2.Making call to emergency service when Emergency Button(push button) For some time(minimum around 1 minute).
3.Controlling Street light using google assistant (To control at our will for e.g. to turn on or off for checking purpose)
4.Status of street light using google assistant & telegram bot.
When Light near Surrounding is less/low it will turn on the street light(LED) & When Light is more/high it will turn off the Street light.
*TO AVOID HAVING ERROR KEEP SENSOR AT TOP OF STREET LIGHT AS IF KEEP BELOW/MIDDLE OF STREET LIGHT IT WILL NEVER GET OFF EVEN IF SUN RISE AS IT WILL ALWAYS GET LIGHT IN SURROUNDING DUE TO LIGHT
2. DemonstrationDemonstration Video:-
3.1.1. Register your Bolt device to the Bolt cloud.
3.1.2. Create a free account on Integromat.
3.1.3. Install Integromat Apk in phone & give all permission.
3.2. Make hardware connection as shown in figure belowFor better pressing the button in complicated circuit use male to female jumper to move button aside so it will be easy to press it
3.3. Create Flow(For Light turning on & off)3.3.1. Log in to your Integromat account.
3.3.2. Click on Create a new scenario.
3.3.3. Search and select "Bolt IoT".Click go to next step
3.3.4. Click on question mark & select Bolt IoT
3.3.5. On Connection you will see “Add”.Click on it.
3.3.6. Enter your API key by clicking on the Add button as shown below. You can find your API key on your Bolt Cloud dashboard.
3.3.7. Now in commands select Read Analog Input. Enter your Bolt Device Name & write A0 in pin as parameter.
3.3.8. From Options select Tools & Click on “Flow Tools” & select “Router”.
3.3.9. It will be auto link with previous Bolt. Now click on plus sign.
3.3.10. On both question mark select “Bolt IoT”. & repeat the procedure 1-6, Now in commands select “Read Digital Output”. Enter your Bolt Device Name & write “4” in pin as parameter.
3.3.11. Now the part where value Change is In one Bolt module (Consider as module 2) write “High” in state as parameter. & in other (Consider as module 3) as “Low”
3.3.12. Now click on link (dotted line) between bolt iot(Module 2) & Router & select set up a filter. In condition select 1.value & from drop-down menu of equal to select “Less than or equal to” & write threshold (max value after which LED should Glow/Turn on) & give label as “Turn On”.
3.3.13. Repeat the same step on in another bolt iot (Module 3) only change from drop down menu of equal to select “Greater than” & label as “Turn off”.
3.3.14. Now come Important part From Scheduling option, Scheduling Setting.
3.3.15. Now in interval write “15” (This will work as Light will not change quickly).
3.3.16. In controls Click on “Save”.
3.4.1. Repeat Step 3.3.1 to 3.3.6
3.4.2. Now in commands select “Read Digital Input”. Enter your Bolt Device Name & write “1” in pin as parameter.
3.4.3. Click on right side on Bolt Module to add another module.
3.4.4. In search Box write “Android” & click on “Android” Module. Select “Make a call”.
3.4.5. In Device Select the device from Which you want to make call.
3.4.6. Now Write phone number on which you want to make call(Emergency Service) in Phone Number. Click ok
3.4.7. Click on link between Bolt & Android & set up a Filter. Give Label as “Make a call”, Condition “1.value” Equal to “0”.
3.4.8. Now in interval write “1”. (If didn’t have paid subscription. Then you can keep minimum time as 15 Minutes. Even then if you want to work it for 1 min use this trick Clone Scenario 15 times, Run one Scenario then run another Scenario after 1min Continues till all 15 Scenario if want interval less than Make changes in above trick that increase clone Scenario & run Scenario after desire interval)
3.4.9. In controls Click on “Save”.
3.5.1. Go to IFTTT to create a new applet
3.5.2. Click on +This
3.5.3. Choose Google Assisant Select Say Simple Phrase
3.5.4. Type the phrase you want to trigger the action. I used 'Turn on street lights' and click on 'Create Trigger'.
3.5.5. Now Click on +That
3.5.6. Select Webhooks and then Make a web request
3.5.7. Enter the API URL https://cloud.boltiot.com/remote/API_KEY/digitalWrite?pin=4&state=HIGH&deviceName=DEVICE_ID(Write your API & Device ID)
3.5.8. Method will be GET
3.5.9. Content type will be Application/json
3.5.10. Click on 'Create Action' and then Click on 'Finish'
3.5.11. Repeat all steps to turn off the street lights Make change in link that Change state to “LOW” & phrase as Turn off Street Lights
3.6.1. Log in to your Integromat account.
3.6.2. Click on Create a new scenario.
3.6.3. Search and select "IFTTT, Bolt, TELEGRAM BOT".Click go to next step
3.6.4. Click on ? mark & select “IFTTT”.Click on Add in webhooks column of IFTTT. Click on copy address to clipboard.
3.6.5. Go to IFTTT to create a new applet
3.6.6. Click on +This
3.6.7. Choose Google Assisant Select Say Simple Phrase
3.6.8. Type the phrase you want to trigger the action. I used 'Status of Street Lights' and click on 'Create Trigger'.
3.6.9. Now Click on +That
3.6.10. Select Webhooks and then Make a web request
3.6.11. Enter the URL which is copied before(at step 3.6.4)
3.6.12. Method will be POST
3.6.13. Click on 'Create Action' and then Click on 'Finish'
3.6.14. Now comeback to integromat
3.6.15. Click on add another module & select BOLT
3.6.16. Repeat steps 3.3.5 & 3.3.6
3.6.17. Now Select “Read Digital Input” Write your Device Name & write Pin as “3”.
3.6.18. Now from Options select Tools & Click on “Flow Tools” & select “Router”.
3.6.19. It will be auto link with previous HTTPS Now click on plus sign.
3.6.20. In Both Question Mark Places Select Telegram Bot.
3.6.21. Visit the Bot Father to create a new Telegram bot
3.6.22. Create a new Telegram bot using the Bot Father.
3.6.23. Create a new Telegram bot
3.6.24. To create a new Telegram bot, send command /newbot.
3.6.25. Specify a friendly name
3.6.26. Give the Telegram bot a friendly name.
3.6.27. Specify a username
3.6.28. Give the Telegram bot a unique username.
3.6.29. Copy the access token
3.6.30. Copy the Telegram bot's access token.
3.6.31. Enter the Telegram bot's access token in token
3.6.32. Now enter chat id Here is the process:
3.6.33. Add the Telegram BOT to a group or send a message to your BOT.
3.6.34. Send a Message to the group.
3.6.35. Get the list of updates for your BOT:
3.6.36. - https://api.telegram.org/bot**YourBOTToken**/getUpdates
3.6.37. - Ex: https://api.telegram.org/bot4015948918:AAFUeg1k9NfeMDMYa6hjnfkon3w90n802sq9w/getUpdates
3.6.38. Look for the "chat" object:
3.6.39. {"update_id":8393, "message":{"message_id":3, "from":{"id":7474, "first_name":"AAA"}, "chat":{"id":, "title":""}, "date":25497, "new_chat_participant":{"id":71, "first_name":"NAME", "username":"YOUR_BOT_NAME"}}}
3.6.40. This is a sample of the response when you add your BOT into a group.
3.6.41. Use the "id" of the "chat" object to send your messages.
3.6.42. In one Telegram Bot Module(Consider Module A)
3.6.43. Click on Add & Enter Token Which we got Previously
3.6.44. Now Enter Chat Id which we got previously
3.6.45. In Text Write “Street Light is On”.
3.6.46. Do the same in another Telegram Bot Module(Consider Module B) Only change is in text write “Street Light if Off”.
3.6.47. Now last part remain which is setting up Filter. Click link between Router & Telegram Bot(Module A).Set up a filter Give label “is on”.Condition “1.value” keep equal to as “1”.
3.6.48. Do same between Router & Telegram Bot(Module B). only change equal to “0”.
3.6.49. Keep scheduling Setting as Immediate
3.6.50. Click on Save
3.7.1. Turn on Schedule of All scenario
That’s it your all are Done.
Comments