This activity is simply adapted from the LED Dimmer activity, but you will be using the light sensor in place of the potentiometer.
Note that the light sensor input will have to be “scaled” so that when the sensor is covered (dark) the LED will fully lit and when it is uncovered the LED is fully off.
This design process model is based on the Ontario 2008 Technological Education curriculum.
From the curriculum:
“Although processes such as this involve a framework of sequential steps, they are typically iterative processes that may require a retracing of steps, diversions to solve specific problems along the way, or even a return to the start of the process if it becomes clear that the situation needs to be clarified and the problem redefined. Problem solvers soon discover that the process calls for an open mind, the freedom to be creative, and a great deal of patience and persistence.”
The graphic above is based on one created by Jackie Griffith. Thanks to Jackie for allowing me to adapt it.
Here’s a comical look at the design process! (click to view full size)
Some programming basics we will need to know for our program:
Assignment
Write a program that builds on the basics we learned about in our Blinking LED circuit, this time using the value returned from our sensorValue variable as the “on” delay value (set the “off” delay value to 500). Use pin A0 for the input from the potentiometer.
After you have this assignment completed, call your instructor over to have it marked.
Assignment 2
Add the statement
Serial.begin(9600);
to your setup() function and the statement
Serial.println(sensorValue);
to your loop() function.
Run this program, then call your instructor over for a discussion on how to convert this value to a voltage value. Modify your program accordingly.
After you have this assignment completed, call your instructor over to have it marked.
This overview is a good introduction to the Arduino.
Watch the tutorial and reproduce the experiment that is done in the video.
Note! Do not plug in the USB cable until you have had your circuit checked by the instructor.
Your circuit should look similar to this:
This is a schematic for your circuit:
This is the code you should have:
Extension Activity
Experiment with your program to determine the minimum delay you can have before the LED no longer appears to be blinking? What “rate” does this correspond to?
Questions
What is an Arduino?
What counts as the “input” for this assignment?
What is the “output”?
If the delay is changed to 500 milliseconds, what is the flashing rate?
How would you modify your program to use a different pin as the output?
Note!
After you have the experiment completed, call your instructor over to have it marked.
You must be logged in to post a comment.