Uses a GCDuino (uses Uno board selection in Arduino IDE). Uses a ping sensor HC-SR04 and triggers from 40cm - 120cm range.
GCDuino reads an SD card WAV file and outputs sound on pin 9 as PWM signal.
Have tried to simplify and lower cost of the project as much as possible and use what I had on hand.
Modified GCDuino to run on 3.3volts so no level shifter required for SD card - I used SD card adapter as a micro SD card reader.
This project is based on many similar Arduino-SD-Wav projects.
See http://youtu.be/QEcmZhScNJE for the final result
This project was shown at our local http://www.goldcoastsciencefair.com.au/ on the Gold Coast Australia
A great crowd draw .Suprised quite a few people walking past!
Details
Still got to add schematic
Components
1×
GCDuino
Similar to Uno
1×
HC-SR04
Ultrasonic range sensor - less than $2 on ebay
1×
LM2596 buck converter
Convert 7-30volts in to 5volts for circuit - less than $2 on ebay
1×
3W class D amplifier PAM8403 mini board
Amplify the Dalek voice! - less than $2 on ebay
// --------------------------------------------------------------------------------- // DO NOT USE CLASS-10 CARDS on this project - they're too fast to operate using SPI // ---------------------------------------------------------------------------------
// --------------------------------------------------------------------------------- // set chipSelect to '10' if using the $2 SD card module or '4' if using the // Ethernet shield's microSD card instead. const int chipSelect = 10; // ---------------------------------------------------------------------------------
const int oldCard = SPI_HALF_SPEED; const int newCard = SPI_QUARTER_SPEED;
// --------------------------------------------------------------------------------- // set cardType to 'oldCard' if using an old SD card (more than a few years old) or // to 'newCard' if using a newly-purchase Class-4 card. int cardType = oldCard; // ---------------------------------------------------------------------------------
int wasPlaying = 0; int inSwitch = 7; int finished = 0; int start = 0; int pauseOn = 0; int trigPin = 4; int echoPin = 5;