For this project, you will need:
- two speakers
- arduino + USB cable
- an arduino sound sensor
- arduino shield
- wires to connect speakers, and wires for the arduino
To make it as fancy as in the pictures above, extra materials will be required:
- wooden poles and plates
- nails + hammer
- insulation material
- wood glue
- two slats (+/-80cm)
- measuring rod
Step 1: Step 1: Building the Setup
This is how we made our setup:
1. Get a +/- 80cm long wooden plate.
2. Connect two blocks of wood on each side of the plate. They can easily be connected with nails, use around 3 for stability!
3. Fix a pole on both of these blocks (so two poles in total), so that there will be 60cm between the speakers on the poles. Also, these poles can be easily connected with the nails
4. Connect a speaker on each pole, at the same height. A tip: use tie wraps for this.
*Optional: lay two thin slats upon the poles (using wood glue). This can function as a 'rail' for the arduino and the sound sensor.
*Optional: cover the setup with insulation material. This can also be glued upon the materials. We covered the ground plate and the poles for optimal results.
Step 2: Step 2: Programming the Arduino
One way to program your arduino:
1. Connect the arduino to the laptop with a USB cable
2. We used an arduino shield to connect the sound sensor to the arduino
3. Open the arduino app or go to the online arduino code editor.
4. Make sure to connect arduino with the app.
5. Now enter the following code, and click upload:
const int pinAdc = A0;
//Serial.println("Grove - Sound Sensor Test...");
long sum = 0;
for(int i=0; i<32; i++)
sum += analogRead(pinAdc);
sum >>= 5;
Step 3: Step 3: Testing the Setup!
Now its time for testing!
1. Get your setup built in step 1
2. Connect your arduino with the sound sensor. Also, connect the arduino with the laptop (using USB)
3. Connect the speakers with a laptop, or a sound generator.
4. Set a tone of 1200Hz (For the reason, see the video)
5. Now slowly move the arduino on the 'rails' from one speaker to the other
You should see two steep valleys when performing the measurement!