Skip to main content

xPlora: Street Light

Street Light Feature Image

Introduction​

When you walk or drive on a road at night, you’ll see glowing lamps lighting up the road. Those are street lights, and they help us see clearly when it’s dark.

Street lights turn on when it’s dark outside and turn off when it’s bright again. They don’t need someone to flip a switch….they have a special sensor that can tell if it’s day or night. When the sun goes down, the light comes on automatically.

This helps save energy and keeps the roads bright only when needed.

Street lights are very important in cities, towns, and even small roads. They help drivers see the road clearly so they don’t bump into anything. They also help people who are walking or riding bikes stay safe at night. And they make people feel safer when they’re outside after dark.

In this project, you will build your own mini street light using a light sensor. You’ll be able to see how the sensor can tell when it’s dark and turn the light on.

Build the project​

In this section we will explore how to use UNDA.Xplora to build a simple automatic street light.

Components​

To build the project you will need:

ComponentDescription
1 x Light Sensor (LDR)
LDR
1 x White Led
LED
1 x resistor (220 Ohm)
220 ohm resistor
1 x resistor (10Kilo-Ohm)
10 Kilo ohm_resistor
4 x jumper wire
jumper wires
1 x battery connector
battery connector
1 x battery
battery
1 x Unda Xplora
undaXplora

Step 1​

Connecting the LED on the breadboard

streetlight_step_01
  1. Placing the LED: Take the white LED from your Unda Xplora Kit. Identify the positive and negative pin of the LED. The positive pin has a longer leg than the negative pin. Insert the LED on the breadboard with the negative leg of the LED placed on the negative bottom breadboard rail and the positive leg placed on the breadboard at pin b26.

  2. Inserting the resistor: Pick a 220-ohm resistor and plug one of the resistor's end into breadboard pin c26 next to the positive led og the LED. Plug the other end of the resistor into breadboard pin f26.

  3. Connecting a jumper wire: Take a jumper wire and plug one of it's leg into digital pin D4 and insert the other leg into breadboard pin h26 next to the resistor.

Step 2​

Connecting the Light Sensor on the breadboard

streetlight_step_02
  1. Inserting the Light Sensor: Pick the Light Sensor from the components casing. The light sensor has two legs and it also has no polarity and thus you can connect it in any orientation. Insert the one of its' legs into breadboard pin c8 and then plug the other leg of the light sensor into breadboard pin c4.

  2. Connecting the sensor to a resistor: Pick a 10K (10 Kilo-ohm) resistor from the components casing. Insert one of the ends of the resistor into any pin on the bottom negative breadboard rail. Plug the other end into breadoard pin a8 next to one of the legs of the light sensor.

Step 3​

Wiring the Light Sensor

streetlight_step_03
  1. Connecting the Light sensor to analog pin: Pick a jumper wire of any colour of your choice and plug one of its' end into analog pin A3 of your UNDA.Xplora. Plug the other end of the jumper wire into breadboard pin e8 next to the second pin of the light sensor.

  2. Connecting the Light sensor to power: Connect the sensor to power by inserting another jumper wire from any 5V pin of your kit to breadboard pin e4 next to the first pin of the light sensor.

Step 4​

Connecting the circuit to Ground

streetlight_step_03
  1. Connecting to Ground(GND): Take another jumper wire from the Tinker Components casing. Plug one end of the jumper wire into any GND pin of the kit and then proceed to plug the other end of the jumper wire into any pin of the bottom negative breadboard rail.

Run the Project​

Once you are done with building the project, connect the battery to the the battery connector and then plug it to the power port of your Unda Xplora to power it on.

Follow the steps below to load up the Street Light Project.

Open Project

From the main window open the projects

Open Project

Observation​

This project utilizes a Light Sensor to control an LED based on light levels. Once the project has been loaded, the first observation will be dependenant on the current light level and thus you can expect either of the observations:

  • Day-time Behavior: When the project is powered on during the day, there is bright light and thus LED remains off because the light sensor detects high levels of light. In order to turn the LED on, cover the light sensor with your finger to block the light.

  • Night-time Behavior: Powering the project at night or in low-light conditions, the LED turns on automatically as the light sensor detects limited or no light. If you want to turn the LED off, shine a torch or any light source onto the sensor to increase the light level.