Arduino Light Instrument

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.

Components Needed:

1x Breadboard
1x Arduino
2x LDRs
2x 100 or 220 Ohm Resistor
2x 10K Resistors
2x Speakers or Piezo Buzzers

Components can be found at http://egrobotics.com/store/
This Project uses and Arduino Board and LDR Add-on Kit


The Code:

void setup() {
void loop() {
int sensorReading = analogRead(A0);
int sensorReading1 = analogRead(A1);
int thisPitch1 = map(sensorReading, 400, 1000, 120, 1500);
tone(10, thisPitch1, 10); // change the last value to change how long the speaker holds it's tone for.
delay(100); // Change delay time for different timing, but don't go under tone duration of 10.
int thisPitch2 = map(sensorReading1, 400, 1000, 120, 1500);
tone(11, thisPitch2, 10);


Go to www.instructables.com/member/EGRobotics/ for more fun projects!
<p>Good starter project!</p>

About This Instructable




More by EGRobotics:Electronic Christmas Tree Ornament Simple Electric Motor Electric Generator Powering LEDs 
Add instructable to: