Automated Street Light
Project Overview
Automation is rapidly changing the landscape of the world. Whether they are in-home lights or street lamps, automation can save a lot of power and time when it comes to electronics that we need in our daily life.
To create this solution, I used the ATTINY85 microcontroller and LR(light resistor) to automate street lights using a central-smart system.
My Contribution
I prototyped an effective solution forStreet light Automation by automating my street lights, in most areas of Pakistani street lights are whether controlled by society or a person.
Usually switched on, manually using the mechanical switch which is quiet pain and due to harsh weather mechanical switch internal corrode or don't function properly so this is a smart switch that turns on-off-on its own according to the condition of light.
Schematic Overview
To design the circuit for my project, I used materials such as ATTINY85 as the micro-controller, 2 led red and green for indication, 10K Resistors, LDR(light dependant resistors) for light detection, and jumper cables to emulate the project.
To build the schematics I used proteus for drawing the circuit diagram and tested it using Proteus as it follows standard industry practices to build integrated circuits. Afterward, I tested the prototype using Proteus to validate that both software and hardware were working seamlessly together as needed.
Once the tests resulted positive, I moved on to design its PCB using Easy EDA on a double-layer DIP PCB board to build the final product.



PCB Design for LDR Smart switch
Here is the basic circuit board I made for this project that has 2 indicator led dip attiny85 chip and a reset button and a LDR Switch but there are many flaws here.
You can see there are 2 ports for powering the board i was thinking of using an external powersupply for this board to function properly. But in the future, I was thinking of onboard switching power supply so there is no need for external adapter to power this thing up.




PCB Design in Easy EDA
Here i use Easy EDA to design basic PSB Board and add components accordingly.




ATTINY85 is little different from an Arduino this microcontroller contains less io pins but uses same code structure like Arduino
Get LDR readings
This piece of code get value of light from room and store them in a variable in void loop() function.
There is also a function that map values of fixed light that lies between 0-1-24 to 0-255.
Light off
This part of the code makes a decision of current light read by LDR using a void loop if its daytime lights turn off.
Lights on
This part of code make deision when light in surrounding is dim it turn on lamp
Servo library has a built-in function in its library that reads the current position of the Servo motor this function fetch position data of the servo and sends it to the user on its app telling the current state of the door lock and keeping user updated.
To fix this issue, I programmed a timer using an RTC module instead of using LDR. This empowered the device to turn on when it was evening and turn off when it was close to morning. Furthermore, this feature can be later optimized by using internal Wifi modules to synchronize the time to make actions happen, more accurately.
In case of fault, manual automation can also be used through a mobile app, and vice-versa.
​