If you have ever seen Murder by Death (1976) or the "Billy Lipps" episode of Psych, you already know that a doorbell that screams can be very entertaining. Once you have the necessary materials, it should only take a couple of hours to configure your home's doorbell the same way, which is what you will need to greet trick-or-treaters this Halloween.
- [optional] Doorbell
- Speakers (powered)
- Keyboard+Display (HDMI)
- Wire cutter/stripper/tape
- Raspberry Pi model B/B+ (with case and power supply)
- Long thin speaker wire
- Stereo audio cable (3.5mm)
- [optional] Push-button switch (if not using your existing doorbell)
This doorbell customization is meant to be temporary. A more permanent approach might involve boxing the RPi with a small speaker, and including a wireless network adapter for remote access.
The "speaker wire" is just a wire for the doorbell signal. It is not used for the speakers in this tutorial. Note that you might need shielded wire (possibly shielding the RPi itself). My wire was not shielded and unfortunately we experienced many "false alarms" when the doorbell rang with no one there.
- Material cost (assuming you have the prerequisites): ~$50 (USD).
Step 1: Hook Up the Raspberry Pi and Install Raspbian
- The keyboard and display should be connected to the Pi at this time
- Raspbian should have the default configuration (boot to command line)
- Login as the default user [pi] with the default password [raspberry]
Step 2: Create a Directory "/home/pi/doorbell" for the Program Files
- pi@raspberrypi ~ $ mkdir doorbell
pi@raspberrypi ~ $ cd doorbell
Step 3: Copy the Program and Sound Files to This Directory
Note: To avoid setting up network access or using putty, shutdown the RPi ("sudo shutdown -h now"), insert the SD card in your computer, and copy the files directly to the SD card. The files will appear in the "/boot" directory when you restart the RPi.
Step 4: Make Both Script Files Executable
- pi@raspberrypi ~/doorbell $ chmod +x doorbell.py
pi@raspberrypi ~/doorbell $ chmod +x doorbell.sh
Step 5: Configure Raspbian to Auto-login and Auto-start Doorbell.sh [Ref#3/#4]
I believe that the approach described in Ref #3 only works on Raspbian Wheezy. For Raspbian Jessie, I recommend using the 'crontab' method described in Ref #4. This might work with Wheezy as well.
To use the 'crontab' method...
- Enter 'crontab -e' to open the crontab editor
- Add the line "@reboot /home/pi/doorbell/doorbell.sh"
- Save the changes and close the crontab editor
- Enter 'crontab -l' to confirm that the changes were applied
Step 6: Strip the Speaker Wire at Both Ends
Step 7: Connect One End of the Speaker Wire to the Raspberry Pi
- One wire goes to pin 14 (GND)
- One wire goes to pin 16 (GPIO 23)
- Some pin connection hardware may be needed
Note: At this point, you can do the last two steps as a test by touching the wires together by hand.
Step 8: Decide How to Connect to the Doorbell
Select ONE of the following options:
[A] Use a separate wired (unpowered) push-button switch
[B] Cut power to the home doorbell and connect to the existing switch
[C] Use your existing doorbell wiring as-is -- Additional circuitry may be required!
!!! WARNING: Connecting the Raspberry Pi to an unknown powered circuit can easily destroy it !!!
When in doubt, simply choose option [A]. It is the easiest and does not involve any risk to the doorbell or RPi. I am using option [B], as it is more authentic, and only two bedrooms (in addition to the doorbell itself) need to go without power during the trick-or-treating. Option [C] is riskier and more difficult (it is not covered by this tutorial).
Step 9: Option [A] : Use a Separate Wired Push-button Switch
- A typical push-button switch has two leads (closed when button is pressed)
- Connect the speaker wire to these two leads and secure with electrical tape
- Mount the switch at the front door, so that a visitor will use it instead of the existing doorbell
- Run the speaker wire from the switch and back to the Raspberry Pi (inside)
- Try to make it all look as authentic as possible!
Step 10: Option [B] : Cut Power to the Home Doorbell and Connect to the Existing Switch
Note: This approach applies if your doorbell is wired and powered by the electrical wiring in the home.
- Locate the central breaker box for the house/apartment
- Flip the switches on/off to determine which one powers the doorbell
- Make sure that the doorbell circuit is OFF (and stays off) before proceeding
- Open the doorbell chime box [image] and disconnect the two incoming wires
- Connect the speaker wire to these two wires and secure with electrical tape
Note: DO NOT restore power to the doorbell circuit until AFTER the wiring has been returned to its original state. Powering the doorbell circuit with the RPi connected could easily destroy it!
Step 11: Install the 3.5mm Audio Cable: RPi Audio Output --> Speaker Input
Step 12: Turn on the Powered Speakers and Then Plug in the Power to the Pi
At this point, there is no need for a keyboard, display, or network connection
When done booting, it will play the first sound in the list ("wait for it......")
It then plays a random sound from the list each time the doorbell rings