a.k.a. "The King of Ding", harbinger of the Internet of Dings
Why? I need a Raspberry Pi to slap a bell in response to a particular trigger.
In my case, it's for a radiothon. When a nonprofit community radio station gets a phone call, you can hear the phone in the background. When they get an online donation, you hear nothing.
Something is better than nothing, so I made this project, which slaps a bell upon a triggering condition.
Why, yes! How did you know?
Watch these videos for more on the build:
- The Raspberry Pi Internet of Dings Notification Bell - coming soon! (June 2021 - "Clarence 2.0")
- The Raspberry Pi Bell Slapper - a software-controlled bell (December 2020 - "Bell Slapper Mark I")
I thought you'd never ask!
The bell is hit by a solenoid, specifically the uxcell 4.5V mini Push-Pull Solenoid I bought from Amazon.
The Pi tells the solenoid to trigger, and a little circuit I built as a hacked-together Pi HAT fires off a short pulse of energy to hit the side of the bell directly.
In 2020, the original "Mark I" version of the bell was slapped quite differently, using a servo. Read the Mark I README for more information about that version of the bell.
I'm currently slapping a boring old call bell. This call bell. But any bell you could mount to be slapped would work.
I'm glad you asked! You'll need to gather some parts and solder together a little control circuit, since the Pi can't drive a 1A solenoid directly through a GPIO pin.
- Raspberry Pi Zero W
- Micro USB Power adapter
- 5V Push-Pull Solenoid
- Double-sided Prototyping board
- IRL7833PBF MOSFET Transistor - 30V 150A
- 1A 50V Diode
- 10K Ohm Resistor
- Electronics hook-up wire
- 2x4 8-pin female headers
These are the tools I used to put everything together (though you can use any suitable substitute):
- Weller WES51 Soldering Station
- Adjustable Circuit board holder (not necessary but helpful)
- Ender 3 v2 3D Printer
TODO: How did I assemble everything?
Well, now we're getting to the meat of it.
It's easy enough to slap a bell with your hand; there's no point in making a Raspberry Pi do it if you just want to slap the bell once or twice.
I built this project to monitor an email inbox. So I wrote a Python script, email-check.py
. That python script does all the magic of translating "new email arrives" into "the bell has been resoundingly slapped".
To make this script work, you need to do two things on the Pi:
- Copy the
config.example.yml
file to a file namedconfig.yml
, and modify it with the email credentials for the account to be monitored. - Make sure Pip is installed: ``sudo apt install -y python3-pip`
- Run
python3 -m pip install imapclient pyyaml
to install required dependencies.
Then run ./email_check.py
, and prepare to be amazed! Or not, especially if it doesn't work.
You might also need to install Pip, if you get an error on the
python3 -m pip
command. To do that, runsudo apt install -y python3-pip
.
Well now we're really getting somewhere useful!
For now, I'm just using cron. Fire up the ol' crontab editor (crontab -l
) and add the following line:
* * * * * /home/pi/pi-bell-slapper/email_check.py
Then every minute the script will run!
Note: If you have any errors, cron will email them to localhost (make sure you have something like
postfix
andmailutils
installed to catch and read those emails). Other cron output goes into the syslog (check/var/log/syslog
).
If you're using a Pi like the model A+, which doesn't have built-in WiFi, and you're using a cheap USB WiFi dongle to connect to the Internet, there's a chance it will go into a sleep mode after a minute or so—follow these directions to stop the thing from sleeping.
Of course I was inspired. You don't think I came up with all this on my own, did you? Alex Meub's Office Bell Ringer was my inspiration. Go read that post if you want to discover how I was inspired.
The enclosure design was inspired by Aaron Patterson's Analog Terminal Bell.
Why are you so interested in my inspiration? Go find your own.
I'm Jeff Geerling, and I approve of this repository.