EG Robotics LDR Kit Project Book Projects Page # Night Light 2 Security Box 3 Light Guitar 5 The Fearful Robot 6 Juke Box 8 The LDR Project book contains 5 projects that can be used with your LDR Kit. Some Projects require more parts but can be adapted easily to work with only what is in your kit. For Help with these project ask on www.EGRobotics.com/hub/ Components in Kit: 1x Mini Breadboard 1xSpeaker 6x Various LED's 5x 220 Ohm resistors 5x 10K Ohm Resistors 4x LDR's 10x Wires (The Components in this kit are subject to change.)
14
Embed
EG Robotics LDR Kit Project Book · EG Robotics LDR Kit Project Book Projects Page # Night Light 2 Security Box 3 Light Guitar 5 The Fearful Robot 6 Juke Box 8 The LDR Project book
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
EG RoboticsLDR Kit Project Book
Projects Page #
Night Light 2
Security Box 3
Light Guitar 5
The Fearful Robot 6
Juke Box 8
The LDR Project book contains 5 projects that can be used with your LDR Kit. Some Projects require more parts but can be adapted easily to work with only what is in your kit.
For Help with these project ask on www.EGRobotics.com/hub/
Components in Kit:
1x Mini Breadboard1xSpeaker6x Various LED's5x 220 Ohm resistors5x 10K Ohm Resistors4x LDR's10x Wires
(The Components in this kit are subject to change.)
This project helps you create an automated night light. The lights will turn on automatically when the room is dark, and off when the room is light.
3x 220 Ohm Resistors1x 10K Ohm Resistor3x LED's
Here is the diagram:
Here is the Code:void setup() { Serial.begin(9600); pinMode(3, OUTPUT); }
void loop() { int sensorValue = analogRead(A0); if (sensorValue < 200) { digitalWrite(3, HIGH); } else { digitalWrite(3,LOW);
}
Security Box.
This project creates a security system for a box or container. Place the LDR in a dark container. When the container is opened the buzzer will sound letting everyone know that the container has been opened if the container is quickly closed the buzzer will turn off but an LED will remain on letting the user know someone opened the container. Reset the board to reactivate the alarm.
1x Speaker or Piezo Buzzer1x LED1x LDR1x 100 or 220 Ohm Resistor1x 220 Ohm Resistor 1x 10K Resistor
Diagram:
The Code:void setup() { pinMode(13, OUTPUT); delay(2000);}void loop() { int sensorValue = analogRead(A0);if (sensorValue > 300) { digitalWrite(13, HIGH); analogWrite(3, 100); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second
analogWrite(3, 150); // turn the LED off by making the voltage LOW delay(1000); } else { digitalWrite(3, LOW); }}
Light Guitar!
This project creates an instrument that’s pitch is determined by the light level. Move your hand over the light or air strum over it at different heights to block more or less light creating different pitches.
2x LDRs2x 100 or 220 Ohm Resistor2x 10K Resistors2x Speakers or Piezo Buzzer
Here is the diagram:
Here is the code:
void setup() {
Serial.begin(9600);}void loop() { int sensorReading = analogRead(A0); int sensorReading1 = analogRead(A1);
The Fearful Robot is scared of being in the dark. As the room gets darker you can see his heart beat faster and faster When it gets to dark the robot flat lines it. Turn on the lights to calm him down or bring him back to life.
3x LED's1x 100 or 220 Ohm Resistor3x 220 Ohm Resistors1x 10K Resistor1x LDR1x Speaker or Piezo Buzzer
Diagram:
The Code:int flashrate = 0;
void setup() { pinMode(13, OUTPUT); delay(2000);}
void loop() {
int sensorValue = analogRead(A0); int flashrate = sensorValue * .9; if (sensorValue > 80 ) {digitalWrite(3, LOW); digitalWrite(13, HIGH); delay(flashrate); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(flashrate); } if (sensorValue < 80 ) { analogWrite(3, 150); digitalWrite(13, LOW); } }
Juke Box
This project creates a jukebox that is turned on by inserting coins. This project requires extra materials that can be found around the house. You will also need to install the tone library found at:http://rogue-code.googlecode.com/files/Arduino-Library-Tone.zip
For Help installing libraries go to:http://code.google.com/p/rogue-code/wiki/InstallingArduinoLibraries
Build it:
Cut a whole in the top of a jar large enough for coins to be inserted. On the underside of the lid tape a LED shining across the hole and onto a LDR. Cut a piece out of the edge of the lid for the wires to escape. This is the coin detection mechanism as the coin goes through it blocks the light.
1x 100 or 220 Ohm Resistor1x LED1x 220 Ohm Resistor1x 10K Resistor1x LDR1x Speaker or Piezo Buzzer
// All of the songs are commented out before uploading pick the song you would like by removing the “//” before it. Find more tones at http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation
// BPM usually expresses the number of quarter notes per minute wholenote = (60 * 1000L / bpm) * 4; // this is the time for whole note (in milliseconds)
// now begin note loop while(*p) { // first, get note duration, if available num = 0; while(isdigit(*p)) { num = (num * 10) + (*p++ - '0'); } if(num) duration = wholenote / num; else duration = wholenote / default_dur; // we will need to check if we are a dotted note after
// now get the note note = 0;
switch(*p) { case 'c': note = 1; break; case 'd': note = 3; break; case 'e': note = 5; break; case 'f': note = 6; break; case 'g': note = 8; break; case 'a': note = 10; break; case 'b': note = 12; break; case 'p': default: