Arduino-powered Audio Doorbell

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

Moderators: adafruit_support_bill, adafruit

Arduino-powered Audio Doorbell

Postby jarruda » Tue Nov 27, 2012 1:22 pm

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 1393 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 4:36 pm, edited 3 times in total.
jarruda
 
Posts: 24
Joined: Sun Jan 29, 2012 11:40 am

Re: Arduino-powered Audio Doorbell

Postby adafruit_support_bill » Tue Nov 27, 2012 1:42 pm

Sounds like a great project. But the video link isn't working.
User avatar
adafruit_support_bill
 
Posts: 16617
Joined: Sat Feb 07, 2009 9:11 am

Re: Arduino-powered Audio Doorbell

Postby jarruda » Tue Nov 27, 2012 1:51 pm

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
jarruda
 
Posts: 24
Joined: Sun Jan 29, 2012 11:40 am


Re: Arduino-powered Audio Doorbell

Postby MattMiddleton » Thu Nov 29, 2012 11:10 am

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?
MattMiddleton
 
Posts: 3
Joined: Wed Aug 29, 2012 7:03 pm

Re: Arduino-powered Audio Doorbell

Postby jarruda » Fri Nov 30, 2012 9:27 am

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. :)
jarruda
 
Posts: 24
Joined: Sun Jan 29, 2012 11:40 am

Re: Arduino-powered Audio Doorbell

Postby sarahline » Sun Mar 03, 2013 6:20 pm

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!
sarahline
 
Posts: 3
Joined: Thu Dec 13, 2012 1:15 am

Re: Arduino-powered Audio Doorbell

Postby jarruda » Tue Mar 05, 2013 10:49 am

Hi sarahline,

Sure! http://pastebin.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.
jarruda
 
Posts: 24
Joined: Sun Jan 29, 2012 11:40 am


Return to Arduino

Who is online

Users browsing this forum: No registered users and 9 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]