4

Introduction:


Photocell is a kind of special resistor based on internal photoelectric effect. Its value of resistance is opposite to the brightness of the light, the brighter of the light is, the lower of the value of the resistance will be. Usually photocell is the core component of a photoswitch. In the following experiment, we are going to use photocell to control the brightness of 5*5 LED screen on micro:bit.

Components List:


Hardware:

**Tips: If you want to buy all components above, then you will need Elecfreaks micro:bit Starter Kit.**

Major Components Introduction


Photocell

Photocell is a kind of special resistor made of semi-conductor materials like Cds or CdSe based on internal photoelectric effect. The brighter of the light is, the lower of the value of the resistance will be. with the intensity of light increasing, its resistant value decreased sharply, and the minimum light resistant value can drop down to below 1KΩ. Photocell is very sensitive to light. When there is no light, its resistant value arrives to its maximum and its dark resistant value usually can reach 1.5MΩ at max.

Experimental Procedure


Hardware Connection

Connect your components according to the picture below:

You would see as below after you finish the connection:

Software Programming

Click to open Microsoft Makecode, write the following code in the editor.

Program as the picture shows:

Details for the code:

Reference

Links:https://makecode.microbit.org/_3tFFoPhLF7hX

You can also download the links directly:


Result


Turn on the light, the LED screen on micro:bit shows nothing. Turn off light, the LED screen displays an icon.

Elploration


If we want to use photocell to control a LED, how to design circuit and program?

FAQ