Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
sanjiv paul
Published

Automatic street light

The street lights would be on at night and off in day automatically.

BeginnerFull instructions provided308
Automatic street light

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
LDR, 5 Mohm
LDR, 5 Mohm
×1
LED (generic)
LED (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
PHPoC Bread Board
PHPoC Bread Board
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Snappy Ubuntu Core
Snappy Ubuntu Core

Story

Read more

Schematics

circuit diagram

this is circuit diagram of hardware

Code

automatic street light

Python
this is code for the project
import conf
from boltiot import BOLT
import json, time
mubolt= Bolt(conf.api_key, conf.device_id)
led= mybolt.digitalWrite('1', 'LOW')
response = mybolt.analogRead('A0')
data - json.loads(response)
print("sensor value is"+str(data['value']))
prinnt (response)
sensor = int(data['value'])

while True:
   if sensor < 10:
      led = mybolt.digitalWrite('1', 'HIGH')
    else:
      led = mybolt.digitalWrite('1", 'LOW')
      

Credits

sanjiv paul
1 project • 2 followers

Comments