Light Sensor
The Light Sensor is an input device that enables your project to sense light and darkness. For example, you can make the Sparkle turn on when it gets dark, trigger the buzzer in bright light, or create a spooky robot that only moves in the dark.
Get Started with the Light Sensor
1. Insert Batteries
Insert 3x alkaline batteries into the battery box. Slide the switch to check they’re in the correct way.
2. Add Power
Use a red and a black croc clip lead to connect the battery box to the Crumble.
3. Connect a Sparkle
Use a red, a black, and a green croc clip lead to connect the Crumble to a Sparkle.
4. Connect the Light Sensor
Use a yellow croc clip lead to connect the – side of the light sensor to the A input/output connector on the Crumble.
5. Connect to Power
Use a red croc clip lead to connect the other side of the light sensor to a + terminal on the battery box.
6. Get Code Ready
Connect the Crumble to a computer and open the Crumble app or head to code.crumble.tech.
7. Add Control
Snap an IF THEN ELSE block to a Program start block. Add an A is HI block and change it to A is LO.
8. Control the Sparkle
Tell the Crumble to turn the Sparkle on only when it is dark (A is LO).
9. Repeat the Check
Add your light sensor sequence inside a Do Forever loop to constantly check if it is dark or light.
10. Test Your Code
Turn your battery pack on and press the Green Triangle to send your code to the Crumble.
11. Turn it OFF
Press the red square or turn off the battery box to stop the light checks.
Top Tips
Simple tips that make a big difference when creating with the Light Sensor in your classroom.
Link to Real-Life
Connect learning to real examples like streetlights, night lights, or automatic screens that adjust brightness.
Make it Fun
Use the light sensor to control games or art by shining a torch or covering the sensor.
GEEK SPEAK
The Light Sensor is an input device that will enable your projects to sense light and darkness. For example, you can make the Sparkle turn on when it gets dark, trigger the buzzer in bright light, or create a spooky robot that only moves in the dark.
Try Now
Get started in minutes with quick projects and lesson units designed to make learning to code hands-on and creative.




