What is a light sensor?
|A light sensor is a resistor that modifies its value when there´s a lesser or greater quantity of light.
The Zum Kit light sensor returns values between 0 (total darkness) and 800 (full light). Remember that it´s an analogue component and it must be connected to pins A0, A1, A2, etc.
They are commonly used to control lights automatically, to detect object and to prevent, for example, the light door from closing, and in bar code readers, etc.
Switching on an emergency LED
Imagine that we had to make a lighting system on the door of the entrance to a little country house. They need the light to only come on when it´s dark, meaning when it starts to get dark, or when it´s very cloudy.
The first thing we need to do is to connect the components:
First we need to check that the quantity of light is low and program the LED to come on when below a certain level. On the other hand, during the day, we need to make sure the LED is switched off.
There´s even more
- Here are a few more ideas so you can keep on practising:
- Every night it´s the same old story. If “there´s monsters in the room” or “it´s very dark and scary”… your nephew will always wake up terrified in the middle of the night by the darkness and the nocturnal monsters lurking around. But you´ve got the solution. Using your knowledge of electronics and programming, you can design a system to detect when there´s not much light and switch on a lamp. With this installed in little Luis´s room, problem solved.
- Continuing with your Christmas project, now add the light sensor to automatically switch off the carols and the LEDs when it gets dark. Now you can enjoy a truly peaceful Silent Night.
- Think about how you would program an automatic alarm to go off when it´s time to wake up, using the buzzer and the light sensor
In the next lessons, you will see how many projects exist which include this component and get some surprising results. So now you know… Go into the light! Continue with the course!