Step 16Build the circuit
Cut the speaker off of your wireless doorbell receiver. Leave as much wire connected to the receiver as you can.
Wire that as analog in to the Arduino. See the schematic for what parts are necessary for this and what wires go where.
Program the Arduino with the following code (source file attached below):
*
*
* Based on:
* http://www.arduino.cc/en/Tutorial/Knock
*/
int relayPin = 13; // led connected to control pin 13
int ringDetect = 0; // the knock sensor will be plugged at analog pin 0
byte val = 0; // variable to store the value read from the sensor pin
int statePin = LOW; // variable used to store the last LED status, to toggle the light
int THRESHOLD = 50; // threshold value to decide when the detected sound is a knock or not
void setup() {
pinMode(relayPin, OUTPUT); // declare the ledPin as as OUTPUT
Serial.begin(9600); // use the serial port
}
void loop() {
val = analogRead(ringDetect); // read the sensor and store it in the variable "val"
if (val >= THRESHOLD) {
digitalWrite(relayPin, HIGH); // turn the led on or off
delay(8000);
digitalWrite(relayPin, LOW); // turn the led on or off
}
delay(100); // we have to make a delay to avoid overloading the serial port
}
ApplauseSign1.zip60 KB| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|





































































