Introduction: Automatic Street Light Using LDR or the Light Sensor

About: STEMpedia is a place bringing project-making tools at one place- kits, online courses, coding platforms, controller app and tons of free learning resources.

It can never be overstated that learning by doing is the best way to learn. And we’re back again with a simple yet super fun to make DIY LED street light project for kids to make and learn a thing or two about LDR working and application and coding. We’ll be using components from the evive Starter Kit and some other DIY material to make the street light and write the code for it in PictoBlox - our Scratch based graphical programming software with advanced hardware interaction capabilities. You can download PictoBlox from HERE.

Ready for some fun-filled learning by doing? Let’s begin!

Step 1: List of Supplies


  • evive
  • LDR / Photoresistor
  • LEDs
  • Resistor (10kohm and 220ohm)
  • Jumper Cable
  • Corrugated Sheet
  • Straws
  • Hot Glue


Note: All the above electronic component can be found in evive Starter Kit, where you can make project like this and many other.

Step 2: Making the Base of the Street Light

Start making the base for our street light. The base for our automatic street light will be a 10cm * 8cm * 5cm size box.

Take a corrugated sheet of the size 20cm*20cm. (Fig 1)

Note: You can even use normal cardboard to make the base instead of the corrugated sheet.

Mark a rectangle of 10cm * 8cm in the center of our sheet, this will make the making of the box easier. (Fig 2)

Just remove the corners and your sheet will look like Fig 3. You will notice that the two side edges out the four edges are 1cm bigger, cut those 1 cms off to make it equal from all the sides.

Note: Keep one of the corners for making the head portion of the street lamp.

Fold along the markings done using a ruler. And glue them together using hot glue.

With this, your base of the street light is completed. (Fig 4)

Step 3: Testing the LDR / Photresistor

Before using the LDR, we need to test it first whether it's working fine or not.

To test the LDR, we are going to use the Pin State Monitor feature of evive as we can see the status of both analog and digital pins directly, which gives it an edge over Arduino.

Connect LDR with evive as given below:

  • Firstly insert a 10k Ohm resistor in one of the pins on the breadboard on evive.
  • Then insert LDR into the breadboard such that the last leg of the resistor and the first leg of the photoresistor are in the same column.
  • Then, connect the free leg of the resistor to the GND of evive.
  • And the free leg of the photoresistor to +5V of evive.
  • Finally, connect the common column to Analog Pin 0 of evive using a male-to-male jumper cable. (Fig 1)

Once the connections are done:

  • Switch evive ON.
  • Then select Pin State Monitor from the firmware.
  • As we have connected our LDR to Analog Pin, select analog pin states from the options.

Now observe the value in front of 0. You may see that the value increases when the light is ON and it decreases as soon as the lights are OFF (intensity of the light decreases) in the above gif.

Step 4: Introducing LDR

We will need an arm to be the link between the pole and the head of the street light. We are going to use straws for the same purpose.

Cut a small portion of the straw to make the arm. Make a slit of approximately 1cm at one end of it as shown in Fig 1. This will help fix our head to the pole.

We will need a small piece of the corrugated sheet to make the housing for our LDR and LEDs. So, cut out a small U-shaped piece.

Create two holes into the U-shaped corrugated sheet or the lampshade using the header of the male jumper cable.

Insert the LDR legs into the given hole so that it sits fixes perfectly on the top of our lamp. (Fig 2)

Connect the legs of LDR with jumper cable and pass the wires through the arm. (Fig 3)

Step 5: Completing the Head of the Street Light

Now, it's time to add the LEDs for our LED Street Light. Take the 2 LEDs and insert their positive terminals into one male-to-female jumper cables and negative terminals into another.

Note: make sure to connect them parallelly.

Now pass the wires through the straw. By using the hot glue attach LED to the head Now let's attach the tail to the head of led street light.

Step 6: Making the Pole

For making the pole of our smart street light we would use another straw.

Note: Try and use a straw with a large diameter for accommodating our jumper cables.

Take the straw and mark its dimension on to the base by a pencil and cut the small hole for our straw to fit in lightly. Use hot-glue from the other side to fix the pole.

Step 7: Completing the Assembly

Now, let’s complete the assembly of street light by connecting all the parts. For connections, we would need to extend the jumper cables.

Now after extending the wires lets pass it through the pole.

Finally, glue the arm or the head of the smart street light to the pole using hot glue.

Step 8: Making the Connections

For final connections –

  • Place a 220Ω and 10kΩ resistor on the breadboard.
  • Connect +ve of led to the one end of 220Ω resistor.
  • Then, connect -ve of led to the GND on evive.
  • Connect one end of LDR to +5v on evive
  • Connect one end of LDR to 10kΩ resistor
  • Connect another end of the 10kΩ resistor to GND
  • Finally, connect A0 on evive with the common of LDR and resistor this would create signal by using a voltage divider circuit.

Step 9: Writing the Graphical Code

To make the project simpler, we will be writing the code in PictoBlox- a Scratch blocks-based programming software.

The program will start executing as soon as evive starts up. The TFT display of evive will show the status of the surrounding light.

The LED connected to Digital Pin 13 should turn ON as soon the reading from the LDR i.e on the Analog Pin 0 is less than 500 and should turn OFF as soon as the value exceeds 500.

Or download the code given below:

Step 10: Conclusion

With this, your DIY smart street is ready!