Table of Contents

Components

This stage involves the following new components.

Excited by Light

We are now going to start on our first real sensor - the light sensor!

The light sensor we are using is called a Light Dependent Resistor (LDR). Its resistance changes based on the brightness of light shining on it. The brighter the light the lower the resistance.

Using the Arduino's analog input pins we can get a measure of the light levels in our program, and use it to change the way our LEDs flash.

challenge_yourself.jpg Harder
(1) When the delay is long because there's a lot of light, you'll probably notice that it takes a long time for the Arduino to react to the lights being switched off for example. This is because your code isn't running while it's delaying and so it can't shorten the current delay if the environment changes. Can you fix that?

Making sound with Light

By following this sound tutorial you'll create a light controlled noise machine (the tutorial refers to a 4.7k resistor, use two 10K resistors in parallel as you did above).

Tip: If your breadboard is getting a bit crowded then remove a few of the LEDs for the time being.

challenge_yourself.jpg Easier
(1) Change the program to use the potentiometer instead of the LDR to change the tone.

Next Stage

Congratulations. Now you can go onto the next stage. Stage 4!.