Things You'll Need
Instructions
Connect an arduino to the top half of the breadboard in the center pins. Place the opto-isolator chip under the arduino on the breadboard so that the dot on the chip is in the upper-left corner.
Attach a PC sync cable to the external flash and the stripped side of the cable to the two pins adjacent the opto-isolator on the breadboard. Set one side of a current-limiting resistor in the digital-out pin located to the right of the arduino and the other to the first pin located left of the opto-isolator chip.
Place a pin below the current limiting resistor in a ground pin connection. Connect a resistor to ground just below the left corner of the arduino.
Input the red lead of the Piezo sensor to the arduino's analog-in pin and the black lead to a ground connection on the breadboard. Connect a 1 megaOhm resistor directly under the Piezo sensor's red and black leads so that it is parallel to the Piezo's connections.
Type the following code into the arduino to allow it to program the camera for sound:
Set your SLR camera's aperture for high exposure and lower the external flash output to its minimum settings. Use a tripod to steady the camera for the clearest possible shot. The arduino will trigger the SLR camera and flash to take the photo once a sound is made, such as that of a popping balloon or glass shattering.
void loop() {
If if (digitalRead(BUTTON_PIN) == HIGH)
{
mode = ACTIVE;
digitalWrite(LED_PIN, LOW); // show we're ready
digitalWrite(CAM_TRIGGER_PIN, HIGH); // open the camera shutter
}
if ((mode == ACTIVE) && (analogRead(SENSOR_PIN) > SENSOR_THRESHOLD)) //
{ //If we're in ACTIVE mode and we sense a pop:
delay(flashDelayMS);
digitalWrite(FLASH_TRIGGER_PIN, HIGH); // fire flash
delay(50);
digitalWrite(FLASH_TRIGGER_PIN, LOW);
mode = STANDBY;
digitalWrite(LED_PIN, HIGH);
}
}