Papa Soundie Audio Player Hookup Guide
Hardware Example Project: The Gag
I've been having too many "customers" coming through my office lately so I thought of creating a deterrent. The project senses when someone walks through my door and plays the quintessential convenient store bell. A counter keeps track of the number of customers and when it reaches 100 a cheering and clapping audio file is played and a bag holding balloons and confetti is untied by a servo motor releasing a party on the unsuspecting coworker.
The Game Plan
For this project you will need the following the parts:
Hardware Hookup
The Fritzing diagram below provides the wiring for the project:
Solder and wire the circuit together.
When the PIR sensor detects movement, the Papa Soundie plays the respective audio file under the conditions set. When the 100th customer enters, pin 10 is sent HIGH. Pin 10 is attached to the Servo Trigger. The servo is used to pull the loose string which holds the bag holding the balloons and confetti closed. Here's a picture of the circuit mounted above the door.
Example Sketch
Copy and paste the following code into the Arduino IDE. Hit upload, and see what happens! Make sure to select the correct board and COM port when uploading.
language:c
#include "SparkFun_PapaSoundie.h"
#define PIR_DOUT 9
int count = 0;
int UNTIE = 10; //High signal to motor driver
PapaSoundie sfx = PapaSoundie();
void setup() {
Serial.begin(115200); // Serial is used to view Analog out
// Analog and digital pins should both be set as inputs (not actually necessary for Analog):
pinMode(PIR_DOUT, INPUT);
pinMode(UNTIE, OUTPUT);
Serial.println("Getting ready");
sfx.begin();
}
void loop() {
Serial.println(count);
int motionStatus = digitalRead(PIR_DOUT);
Serial.println("Looping");
if (motionStatus == HIGH)
{
sfx.playFileNumber(1);
motionStatus=LOW;
delay(1000);
count = count +1;
if (count == 100)
{
motionStatus = LOW;
sfx.playFileNumber(2);
digitalWrite(UNTIE, HIGH);
delay(1000);
sfx.playFileNumber(2);
delay(1000);
sfx.playFileNumber(2);
delay(1000);
count = 0;
digitalWrite(UNTIE, LOW);
}
}
}
The Coup De Grace
This project was in no way a deterrent to keep people from entering my office; in fact, it was the opposite.
What's worse, I was left with the mess. On second thought, this would make a great feature to any party.