Light Sensor

What are light sensors?

Where do you see light sensors being used?

The input from light sensor can be used to do many things like turn on a light automatically or turn off a light.

Project: Sense the Light in the room and change the color of LED pixels based on the color of light.

A device that can sense the amount of light in a room. Assignment:

  • If the light sensor reading is below 50 turn all neo pixels color to gray.
  • If light sensor readout is above 175 turn all neo pixels to yellow.
  • If light sensor readout is anything else all neo pixels to light blue. Objective: Explore Light Sensor from the above assignment.
e3-1 e3-2 e3-3 e3-4 e3-5 e3-6 e3-7 e3-8 e3-9 e3-10 e3-11 e3-12 e3-13 e3-14

Try taking CPX:

  • dark places like a closet.
  • moderately lighted place like in a room with lights ON.
  • closer to a lamp where it is bright and see how pixels change colors.

Take it further: Modify the light sensor program to run only when Button A is clicked. Hint, use On Button block from INPUT Blocks.

  • Make the program run only once per click.
  • Make the lights change color based on the light level WITHOUT using if-else-block and color the pixels directly.
Thanks! We hope you found what you are looking for. Please feel free to contribute via Github.