User Tools

Site Tools


workshops:arduino_for_the_curious:stage_3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
workshops:arduino_for_the_curious:stage_3 [2017-04-05 12:52] – external edit 127.0.0.1workshops:arduino_for_the_curious:stage_3 [2017-04-10 11:26] Simon
Line 4: Line 4:
  
 This stage involves the following new components. This stage involves the following new components.
-  *  Light Dependent Resistor - [[ldrs|more info]]+  *  [[ldrs|Light Dependent Resistor]]
   *  Speaker   *  Speaker
  
Line 12: Line 12:
 We are now going to start on our first real sensor - the light sensor!  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). It'resistance changes based on the brightness of light shinning on it. The brighter the light the lower the resistance. +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. 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.
  
-  *  Create your voltage divider circuit as shown in the below diagram. The voltage output is made to Arduino analog input A1. Two 10K Ohm resistors in parallel results in a suitable 5K resistance. +  *  Create your voltage divider circuit as shown in the below diagram. The voltage output is made to Arduino analog input A1. Two 10K Ohm [[https://en.wikipedia.org/wiki/Resistor#Series_and_parallel_resistors|resistors in parallel]] results in a suitable 5K resistance. 
  
 {{workshops:fritzing_ldr.png?0x400}} {{workshops:fritzing_ldr.png?0x400}}
Line 22: Line 22:
   *  Change your Arduino program to read the value on A1 instead of A0 and upload it. Now, instead of the rotation sensor determining the flashing speed/which lights which are on, the light levels on the light sensor will.   *  Change your Arduino program to read the value on A1 instead of A0 and upload it. Now, instead of the rotation sensor determining the flashing speed/which lights which are on, the light levels on the light sensor will.
  
-| {{workshops:challenge_yourself.jpg?200x0}}| **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? |+| {{workshops:challenge_yourself.jpg?200x0}}| **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? |
  
  
Line 31: Line 31:
 By following this [[http://arduino.cc/en/Tutorial/Tone2|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). By following this [[http://arduino.cc/en/Tutorial/Tone2|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 you breadboard is getting a bit crowded then remove a few of the LEDs for the time being.+Tip: If your breadboard is getting a bit crowded then remove a few of the LEDs for the time being.
  
-| {{workshops:challenge_yourself.jpg?200x0}}| **Easier****(1)** Change the program to use the potentiometer instead of the LDR to change the tone. |+| {{workshops:challenge_yourself.jpg?200x0}}| **Easier** \\ **(1)** Change the program to use the potentiometer instead of the LDR to change the tone. |
  
  
Line 40: Line 40:
  
  
-Congratulations. Now you can go onto the next stage! [[stage_4|Stage 4]].+Congratulations. Now you can go onto the next [[stage_4|stage]]!.
  
workshops/arduino_for_the_curious/stage_3.txt · Last modified: 2017-04-10 11:30 by Simon

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki