LDR Light Sensor¶
An LDR (Light Dependent Resistor), also called a photoresistor, changes its resistance based on the amount of light falling on it. This allows your micro:bit projects to measure brightness and respond to changes in ambient light.
What It Does¶
The LDR outputs a varying voltage depending on light intensity. Your program can read this as an analog value (ranging from dark = low value to bright = high value) and use it to trigger actions such as turning on lights or adjusting displays.
Real-World Applications¶
Light sensors are used in countless real-world systems, such as:
- π‘ Automatic Street Lights β Turning on at night and off in the morning.
- π± Smartphones β Adjusting screen brightness based on ambient light.
- π Smart Homes β Controlling curtains, lamps, or garden lighting automatically.
- π€ Robotics β Light-following robots or obstacle detection.
- π Security Systems β Detecting changes in light for alarms or monitoring.
Using an LDR, students learn how to make their prototypes react intelligently to environmental light conditions.
β With the LDR, you can build projects that respond to lightβfrom night lamps and alarms to smart energy-saving devices.
Connection to the breakout¶
-
Connect the LDR to the port 3v3, GND and P2 (Blue)

-
Connect the OLED to the port P20, P19 , GND and 3v3 (Yellow)

-
Connection of LDR and OLED with the breakout board
