Summary
I got annoyed by our doorbell (very loud and heartstopping schrill sound) and I startet building one using a arduino controller but then I realised that it would be much more fun to be able to change/ install doorbell sounds via network on the doorbell, no SD card removing and plugging into the cardreader and plugging back in, just ssh or ftp into your doorbell and upload a new soundfile!
When the new Raspberry Pi model A+ came out it was setteled and I needed a nice enclosure for the electronics and the two loudspeakers.
You even can play internet radio, or make announcements with it.
Updated the python script, added a sql-lite db for logging rings added a command to pause my mpd music player via network in case somebody rings and I hear music and overhear the "bell".
Instructions
Printing the case isn't easy but its doable, I included my gcode file created with Simplify3D for my Makergear M2 printer. I printed this with PLA and used a raft.
The Raspberry Pi Model A+ is mounted on two slides (see included file) which fit into the enclosure.
The doorbell button is connected to GPIO7 and is beeing read via event_detect (interrupt) in python (see small included script). I soldered a 20nF ceramic cap between GPIO7 and GND to block interferences coming in over the cabel and also a 4.7k pullup resistor to 3.3V.
The loudspeakers are driven by a Stereo 3.7W Class D Audio Amplifier - MAX98306 which I bought here:
http://www.exp-tech.de/Shields/Audio/Stereo-3-7W-Class-D-Audio-Amplifier-MAX98306.html
The loudspeakers are 3" 4 Ohms 3Watt and have to be glued into the case:
http://www.exp-tech.de/lautsprecher-3-durchmesser-4-ohm-3-watt?___SID=U
Usually in Germany there is a little 8V/1A AC transformer in the electrical cabinet for the standard doorbell. I replaced it with a 5V/ 2.4A DC switching supply for DIN-Rail from Reichelt electronics:
The python script uses sox (play) to play the sound files, so you have to install a few things first:
sudo apt-get install sox lame libsox-fmt-mp3
after that you should be able to play sounds:
play some-soundfile.mp3
use alsamixer to change the volume.
The script expects the soundfiles in the folder "/home/pi/door-bell/sounds" and plays them randomly.
标签
模型来源
