Arduino-powered Audio Doorbell

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
jarruda
 
Posts: 25
Joined: Sun Jan 29, 2012 12:40 pm

Arduino-powered Audio Doorbell

Post by jarruda »

So when I bought my house, I noticed it had probably the most boring doorbell on the planet. Then I saw the adafruit's Wave Shield and saw inspiration.

This is my first actually completed hobby electronics project, so I'm pretty proud of it, even if it's really simple.

http://youtu.be/lDCDayKyOQA
(Is it possible to embed a youtube video on these forums?)

Main Parts:
Pre-R3 Arduino Uno
Wave Shield 1.1
Velleman 3 Watt Mono Amplifier # K 8066
guts.jpg
guts.jpg (161.41 KiB) Viewed 4031 times
Power for the doorbell comes from a 16V transformer off mains power (120V). It's run through a 50V 4A bridge diode rectifier into an electrolytic cap and a ceramic cap to smooth the pulsed DC, then two diodes to drop the voltage by ~3V before powering the mono amplifier and being split off for the UNO's Vin.

The doorbell is connected like any other button, sending 5V out to the doorbell and in to a digital pin configured as an interrupt. Using a pullup resistor and pulling the pin to ground wasn't used to lower the demand on the linear regulator running on voltage that's a bit higher than I'd like. To further reduce power usage, the atmega328 is put into PWR_DOWN sleep in between doorbell rings.

Also, thanks to adafruit_support for providing help!

My next project is a little more ambitious, a thermostat that can use a wireless sensor for temperature readings.
Last edited by jarruda on Tue Nov 27, 2012 5:36 pm, edited 3 times in total.

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino-powered Audio Doorbell

Post by adafruit_support_bill »

Sounds like a great project. But the video link isn't working.

jarruda
 
Posts: 25
Joined: Sun Jan 29, 2012 12:40 pm

Re: Arduino-powered Audio Doorbell

Post by jarruda »

The video page on youtube has a banner for me that says, "Sit tight! Your video edits are about 90% done. Come back to this page in a little while." Though it's still showing me an older version of the video. Is the link working for you now? Alternative: http://www.youtube.com/watch?v=lDCDayKyOQA

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino-powered Audio Doorbell

Post by adafruit_support_bill »

The link is working now. Nice looking project! :D

MattMiddleton
 
Posts: 3
Joined: Wed Aug 29, 2012 8:03 pm

Re: Arduino-powered Audio Doorbell

Post by MattMiddleton »

This looks awesome! Our doorbell is not only super generic, but rather quiet (can't hear it if you're in the basement). Is your code available somewhere online?

jarruda
 
Posts: 25
Joined: Sun Jan 29, 2012 12:40 pm

Re: Arduino-powered Audio Doorbell

Post by jarruda »

MattMiddleton wrote:Is your code available somewhere online?
It's not, but it's nothing special. It's mostly just adafruit's wave shield sample code, but here's the meat of what is specific to the doorbell:

Code: Select all

void loop()
{
  dir_t dirBuf;
  FatReader file;
  
  root.rewind();
  while (root.readDir(dirBuf) > 0) {
    if (dirBuf.name[0] == '.') 
      continue;

    if(file.open(vol, dirBuf) && !file.isDir()) {
      putstring("Enqueued ");
      printName(dirBuf);
      putstring_nl("");
      
      beginSleep();
      
      if (wave.create(file)) {
        wave.play();
        putstring("Playing...");
        while (wave.isplaying) {
          delay(100);
        }
        putstring_nl("Done.");
      }
      
      sdErrorCheck();
    }
  }
}

Code: Select all

void beginSleep() {
  putstring_nl("Going to sleep.");
  delay(100);
  
  set_sleep_mode(SLEEP_MODE_PWR_DOWN); 
  sleep_enable();
  digitalWrite(ledPin, LOW);
  
  // Debounce the interrupt;
  // Also allow someone holding the button to continue playing audio (skip sleep)
  while (digitalRead(intPin) == LOW) {
      PCintPort::attachInterrupt(intPin, &interruptHandler, RISING);
      sleep_cpu();
      delay(10);
  }
  
  sleep_disable();
  digitalWrite(ledPin, HIGH);
}
In order to sleep (to lower power consumption; this project was originally going to be battery-powered), I had to use the PinChangeInt library in order to wake the Arduino since the external interrupt pins were in use by the wave shield.

Sidenote to adafruit_support:
It'd be nice if this forum allowed embedding of youtube videos or had a plugin to do syntax coloring on posted code. :)

sarahline
 
Posts: 3
Joined: Thu Dec 13, 2012 2:15 am

Re: Arduino-powered Audio Doorbell

Post by sarahline »

Is there a chance you could post all of your code? I am trying to figure out how to put my Arduino to sleep after it plays a sound that is triggered by a button.

Thanks!

jarruda
 
Posts: 25
Joined: Sun Jan 29, 2012 12:40 pm

Re: Arduino-powered Audio Doorbell

Post by jarruda »

Hi sarahline,

Sure! http://BANNED.com/wbNiaQ1H

I'm not 100% positive this is the last revision of the code, but glancing over it, it appears to be what I have running on the device. Hope this helps.

User avatar
burpees_NH
 
Posts: 74
Joined: Wed Dec 15, 2010 5:31 pm

Re: Arduino-powered Audio Doorbell

Post by burpees_NH »

This is great! Is it possible to buy the circuit board which provides DC power from the 16VAC supply? (I realize this is supposed to be a simple circuit which does not need explanation, however I've never built one, and the rectifier is not really central to my mission so much as connecting up a DIY doorbell).

jarruda
 
Posts: 25
Joined: Sun Jan 29, 2012 12:40 pm

Re: Arduino-powered Audio Doorbell

Post by jarruda »

scottinnh wrote:This is great! Is it possible to buy the circuit board which provides DC power from the 16VAC supply? (I realize this is supposed to be a simple circuit which does not need explanation, however I've never built one, and the rectifier is not really central to my mission so much as connecting up a DIY doorbell).
If you take a look at a the orange perf board in the picture you can see the whole circuit - a bridge rectifier and a two capacitors make the 16 VAC -> VDC. After that I placed two diodes just to drop the voltage a couple of volts to make it more tolerable for the Arduino's regulator. Everything there is available at a local RadioShack.

If you're willing to change the transformer that feeds the doorbell to something like 12V, you can even remove the diodes.

User avatar
atteroAnimus
 
Posts: 1
Joined: Thu Dec 11, 2014 3:42 pm

Re: Arduino-powered Audio Doorbell

Post by atteroAnimus »

This is genius.

I am very impressed. I am a n00b when it comes to electronic components. I wonder if you wouldn't mind posting that picture again with some callouts to which component is what on on your circuit board? I absolutely love this project.

User avatar
noobee
 
Posts: 2
Joined: Thu Jun 04, 2015 10:04 am

Re: Arduino-powered Audio Doorbell

Post by noobee »

Can you provide a link to the part numbers you used for the bridge rectifier and capacitors. As well as the diodes.

Thanks

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”