loading
Wish your computer had all the bells and whistles?  You can get at least half-way there with this project, a USB-powered and -controlled bell that can be used for email notification or a manner of other things that require a satisfying "ding".

This project essentially consists of a microcontroller affixed inside the base of a counter bell, that pulls on the bell's clapper with an electromagnet, and communicates with the computer over USB.  WAIT! COME BACK! Don't run away, I haven't told you how easy this project is yet!

This project is reasonably easy,

Here's a video of the bell in action, I am sending myself some emails, and as they appear in Thunderbird, the bell goes ding.


Some skills required:
1. soldering - you'll need to solder just six electrical components together
2. electronics knowledge
3. knowledge of programming is entirely optional if you use the same microcontroller as I do since I've made all the code and firmware online so you can quickly download it and load onto the microcontroller over USB

Materials required (details to follow):
1. A counter bell of some sort with a steel clapper
2. A short bolt (to make a solenoid/electromagnet)
3. Some thin (less than 26 AWG) enamelled wire (about 2m)
3. A transistor
4. A resistor
5. A large capacitor (because USB probably won't supply enough power in one go to fire the electromagnet
6. A diode (flyback diode, as safety to avoid things blowing up)
7. A Forebrain (LPC1343 microcontroller) dev board (or you can use an alternative microcontroller/dev board if you want to have a go at coding it yourself)
8. Some prototyping board and wires

You will also need a soldering iron, some type of tape or adhesive to attach things to other things, and possibly some kind of cutting tool to cut a slot out of the base of the bell for the USB plug.  And of course a computer (sorry, I only supply source and binaries for WIndows, the bell appears on a computer as a generic USB HID device, for which all modern operating systems have drivers built in for, so it would be relatively easy to code it for Linux or Mac).

Note: the bell does not check your email for you; you will need some sort of program on your computer to check your email and then activate the bell when you receive new mail.  For Windows, the Thunderbird mail client works perfectly for this, or alternatively a utility called POP Peeper (more on this later).

Here is another video where I am triggering the bell manually from the computer. The bell plunger occasionally gets stuck, but I've since fixed that with some WD40.


WARNING: This project involves powering a home-made solenoid via the USB port, which may risk damage to your computer if your solenoid draws too much current.  I highly recommend using a cheap powered USB hub.  I accept no responsibility for any injury to you or damage to your equipment or property should you choose to attempt this.  Please proceed AT YOUR OWN RISK.

Step 1: Parts: the Bell

You'll need to get your hands on a bell of sorts.  Most importantly, it needs to have a clapper that you can easily activate with an electromagnet.  The one I purchased from eBay turned out to be absolutely perfect.

Pushing down on the top arm of the clapper would send the bottom half kicking out and striking the stainless steel bell.  I figured I could place an electromagnet underneath top arm of the clapper and attract that downwards to ding the bell.

If your bell is different from this, you'll need to figure out a way to mount your electromagnet, and if the clapper isn't steel or iron, you may be able to get around it by affixing a magnet to the clapper and attracting/repelling that instead.

Step 2: Parts: Electromagnet

You will need something to use as an electromagnet.  I've found that winding your own solenoid coil using a short bolt and a length of copper wire is perfect for this.

Make sure that your electromagnet will fit in the space between the clapper and the base!

I used a spare steel bolt I found somewhere (thought it transpired that the bolt was not spare and was in fact the missing bolt from my chair), and wrapped about a meter and a half to two meters of enamelled copper wire onto it, using double-sided tape between the layers to ensure that they didn't slip off while I was winding the copper.

Without some archaic electromagnetism equations and careful measurement, it is difficult to predict how many turns of copper is required to make an adequate and safe solenoid/electromagnet.  For this reason, I highly recommend testing the solenoid before using it, and finding the current draw if possible.

Just to reiterate in case you missed it at the first step: WARNING: This project involves powering a home-made solenoid via the USB port, which may risk damage to your computer if your solenoid draws too much current. I highly recommend using a cheap powered USB hub. I accept no responsibility for any injury to you or damage to your equipment or property should you choose to attempt this. Please proceed AT YOUR OWN RISK.

Step 3: Parts: Electronics

You need four electrical components.  I will be describing these very briefly, but ultimately I will have to leave it to you to make your own educated decisions on which components to use (or use exactly the same ones that I did).

A transistor
Choosing the right transistor for a project is a whole book in itself.  Fortunately, for this project, most transistors with a pulse current rating of at least a few amps, and an hFE above 40 should probably work.  I'm using a BDX53B Darlington transistor which I had lying around from other projects, it's not ideal, but it does the job.  A TIP29 transistor would probably also work.

If you are using a MOSFET, you should add a pull-down transistor of about 1k after the gate resistor, otherwise the pull-up current of Forebrain in programming mode may be enough to fire the MOSFET.

If you don't know your transistors, I would suggest learning about how to choose the right transistor or asking someone about whether a certain transistor is suitable for this application or not before continuing, as the wrong choice might not work, damage something, or in the worst case blow up in your face.

A capacitor
A largeish aluminium electrolytic capacitor is required to supply some of the peak pulse currents required when the solenoid activates.  The voltage rating must be above 5V, and I would recommend at least 470uF.  I am using a 10V 2200uF capacitor

A diode
A diode is necessary to avoid flyback voltage spikes when the solenoid is switching.  I'm using a 1N4004 general purpose diode

A resistor
Is needed to allow the microcontroller to drive the transistor.  The value you should use depends on the the transistor you are using, if you don't know which resistor to use, I would suggest that 150ohms would probably work for most BJT devices, or 10ohms for a MOSFET.  I am using a 150ohm resistor


Step 4: Parts: Microcontroller

This bit is easy, I'm using a Forebrain dev board, which contains a 32-bit ARM Cortex-M3 microcontroller.

For those of you who don't know what microcontrollers are, they are little chips that can be programmed to carry out a whole number of things - from keeping time inside a digital watch, to running a microwave, to running your car.  Forebrain is a development board carrying a microcontroller, it is designed so that you can easily use these useful little chips in your project without having to spend too much time soldering to impossibly small pins on the chip.

When you get a new Forebrain unit (the can be purchased from http://www.universalair.co.uk/, they will be blank, and will not do anything useful.  Software needs to be written and compiled (on a PC), and then downloaded onto the Forebrain unit before they start doing anything.  The software that runs on microcontrollers is typically called "firmware", and the act of loading firmware onto a microcontroller is sometimes called "flashing", and has nothing to do with indecent exposure.

Because I've already written the software to make Forebrain act as a USB-controlled bell, you can simply download my compiled firmware (I'll tell you how later), and load it directly onto Forebrain over USB without ever having to look at a line of code. The whole process should take minutes, does not require any new software, and does not require you to learn any new skills or see a line of code.

Step 5: Build: Install the Stripboard

Ok, time to start building.

I cut down some stripboard in a rough circle, to fit into the space in the base of the bell.  All the components will be soldered onto this circle of stripboard, and Forebrain will sit underneath it.

To secure it in place, I actually pushed some thumb tacks through the rivet holes in the bell base and into the pin holes on the stripboard and then soldered them in place (sorry, no photos of this, you'll notice the thumb tacks in later pictures).  An alternative would be to use hot glue or epoxy resin.

Step 6: Build: Install the Electromagnet

Mount the electromagnet onto the stripboard somehow, and position it under the clapper so that there is enough room for the clapper to swing at the bell.  If your solenoid is too long, you might have to cut a hole in the stripboard, if it's too short, you will had to add some spacers in there.

To secure it, hot glue or epoxy resin would be a good choice, I cut up some plastic, and used that to anchor mine down (didn't have any glue)

At this point, you could try to test to see the if the solenoid will pull the clapper down, you may need to screw the plunger in first otherwise the clapper will be too far away.  Use a regulated power supply if you can (or one that won't be damaged if the solenoid draws too much current, three or four old alkaline AA batteries would work).

For the third time: WARNING: This project involves powering a home-made solenoid via the USB port, which may risk damage to your computer if your solenoid draws too much current. I highly recommend using a cheap powered USB hub. I accept no responsibility for any injury to you or damage to your equipment or property should you choose to attempt this. Please proceed AT YOUR OWN RISK.

Step 7: Build: Install the Other Electronics

The three pins on the lower right of the Forebrain board is where you can get the GND and 5V supply from, and the firmware is set up to use Port 2, Pin 11 to drive the transistor.  See the circuit diagram attached.

Careful of the polarity of the capacitor, and the pinout of the transistor!

Solder the other components in based on the circuit diagram.  Make sure the bell does not touch any of the components when it is replaced.  Bend the pins and install components horizontally if necessary

Step 8: Build: Install Forebrain

A small gap needs to be cut into the base for the USB cable to pass through.  I did this with a dremel, but feasibly you could use a file, or a small saw.

In my case I also ground down the front corners of Forebrain to fit the curvature of the base better.  This isn't for the faint of heart to cut into your dev boards like that, but I can tell you with reasonable certainty that as long as you don't go too far, you won't hit anything vital (worst case is that the USB LED stops working).

Then solder the remaining wires connecting Forebrain to the board as per the circuit diagram in the previous page, there should only be three: 5V and GND from the USB, and Port 2 Pin 11 to the resistor.

Step 9: Build: Flashing the Firmware

Now would be a good time to load the firmware onto Forebrain since you still have access to the buttons.

1. Gingerly connect the USB cable from Forebrain to the computer (Forebrain comes supplied with a retractable cable!).  Make sure the solenoid hasn't come on, if it does, you will want to immediately disconnect the USB and check your circuits.

2. Once the USB is connected, and the solenoid hasn't come on, and nothing has broken, you can make Forebrain enter programming mode by holding down the button marked PRG while pressing the button marked RST (with the USB port facing upwards, PRG is on the left, the RST is on the right).  You may need to do this twice for it to work.

3. If all goes well, the top-right LED on Forebrain should light up, and Forebrain will appear on your computer as a flash drive called "CRP DISABLED".   Opening up this drive will reveal a single solitary "firmware.bin" file, delete this from the drive (you have to delete this otherwise the computer will complain about there not being enough space).

4. Download the firmware file that I wrote from: https://github.com/downloads/meseta/Ding-for-Forebrain/firmware.bin or alternatively if you want to play around with the code itself, you can find all the sources at https://github.com/meseta/Ding-for-Forebrain , Instructions on how to use Forebrain can be found at: http://www.universalair.co.uk/guides

5. Now drag this downloaded "firmware.bin" file into Forebrain's drive (the one called "CRP DISABLED"), if it complains about there not being any space, make sure the "firmware.bin" file already in the drive is deleted first.

6. Once the file has copied, you can now unplug Forebrain, or hit reset (RST button).  The next time you plug Forebrain into the computer (or press RST), Windows will recognise it as a "USB Input Device".  Windows may attempt to search online for the drivers, before eventually realising that it actually already has them pre-installed.  Forebrain is using a generic USB HID profile, so no special drivers are required.

Step 10: Build: Finish the Hardware

Once the hardware is loaded, you can install Forebrain more permanently (hot glue is a good choice).  I have duct-taped mine since I plan on installing some LEDs as well (I will add steps to this instructable if I do).

You won't need access to the buttons again since I've thoughtfully added an extra command in the ding.exe to tell Forebrain to go back to programming mode.

Once you have plugged Forebrain in and it's recognised as a generic USB device, you can get the app that'll make the bell go ding from here: https://github.com/downloads/meseta/Ding-for-Forebrain/ding1.zip

Unzip this somewhere, you will get a ding.exe, and a dll file. Running the ding.exe program will send a signal to Forebrain to ding the bell. If something like this happens, then congratulations!

Step 11: Configure (Optional)

If you hear some movement when you run ding.exe, but no ding, then you can try increasing the pulse time that drives the solenoid.  To do this, ding.exe can be used to tune the signal time.  Fire up a command line, navigate to where you are keeping ding.exe, and launch ding.exe with some parameters:

ding.exe 254 50

Will set forebrain to drive the solenoid with a 50ms pulse.  Likewise, ding.exe 254 10 will use a 10ms pulse, and ding.exe 254 99 will use a 99ms pulse.  The maximum pulse duration that can be set is 100ms to avoid drawing too much current from the USB port.  Once you set the pulse duration, it is stored on Forebrain's EEPROM, so it will be remembered until you change it.

You can also tell Forebrain to re-enter programming mode by running ding.exe 255 , on receiving this command, Forebrain will disconnect itself from USB, wait a few seconds, and then reconnect in programming mode.  After you load the firmware, you will want to hit RST, or if you can't reach that, simply unplug and replug the USB cable.

Step 12: Configure: Email Notifications With Thunderbird

Now that you have a USB controlled bell, you'll want to configure it to be used for something!  Any program that'll let you run the ding.exe program as a method of notification will work.

For Thunderbird users, here are some instructions:
1. Download the FiltaQuilla extension, this will give you access to new filter options, including launching an application

2. Go to Tools>Message Filters

3. Create a new filter to match "Status is New" (and maybe also "Not Junk" would be helpful)

4. Set the perform actions to "Run file" (made available by the FiltaQuilla extension), and set the file to the ding.exe application.

5. Also remove the "@SUBJECT@,@MESSAGEID@" part that gets appended to the end of the ding.exe location

6. Repeat for other mail accounts if necessary

7. Sit back, and start sending yourself emails

Step 13: Configure: Email Notifications With POP Peeper

For those who don't use Thunderbird as a mail client, another option is to have a small utility like POP Peeper sit in your task tray checking your emails and launching ding.exe when it gets any new ones.  POP Peeper supports IMAP.

POP Peeper has the ability to launch an "E-mail Client" when you get new mail.  We will tell POP Peeper that ding.exe is an "E-mail Client" to make it do our bidding.
1. Download and install POP Peeper from http://download.cnet.com/POP-Peeper/3000-2369_4-10069858.html or http://www.poppeeper.com/ (don't forget to check the "SSL" option during install if you intend to connect to any mail servers via SSL or TLS)

2. Set up the mail accounts that you want to check (or import them).

3. If you're using IMAP, you can have it accept real-time (i.e. Push) email notifications by checking the "Use IDLE" in the account details, otherwise you can change the mail check period in the options.

4. In Options>General, set ding.exe as the email client

5. In Options>Noitification, set "When I receive new Email:" to "Run E-Mail Client"

6. Minimise, sit back and start sending yourself emails.

Step 14: Links

Some links in previous steps all in one place:

Notification bell Firmware for Forebrain: https://github.com/downloads/meseta/Ding-for-Forebrain/firmware.bin

Bell trigger app for Windows: https://github.com/downloads/meseta/Ding-for-Forebrain/ding1.zip

Source code: https://github.com/meseta/Ding-for-Forebrain

Where to buy Forebrain: http://www.universalair.co.uk

How to use Forebrain: http://www.universalair.co.uk/guides

Thunderbird mail client: http://www.mozilla.org/thunderbird/

Filtaquilla plugin for Thunderbird: https://addons.mozilla.org/en-us/thunderbird/addon/filtaquilla/

POP Peeper utility: http://www.poppeeper.com/
<br> I believe you could execute the ding.exe in outlook following these instructions:<br> <br> <a href="http://www.inboxactions.com/index.php/component/content/article?catid=14&id=74">http://www.inboxactions.com/index.php/component/content/article?catid=14&amp;id=74</a><br>
If I needed one to check a certain folder (label) in gmail and ding, can this be done? How much would you charge to make me one? Could there be an option to manually change the folder (label) it checks so that if I wanted alerts for a different folder?
Can I use any other microcontroller?
How hard was it to get your electromagnet's position 'tuned' so that it pulled the clapper hard and far enough?
not very hard, it worked very well and was quite strong, it worked first time. Though I think it was lucky coincidence that the bolt was about the right length.
How long was the bolt? I tried making one from at 1/4-20 bolt, but it doesn't pull the clapper hard enough.
I think mine was a half-inch bolt, and I went crazy with the windings
Did you ever measure the resistance of the coil, or measure the current draw of the electromagnet when it is on?
Yes, I made sure that the steady state current draw was &lt; 0.5A as per USB 2.0 spec, however I couldn't measure transients due to lack of equipment. However I did use the largest capacitor value I could find, and a small amount of resistance on the USB input to minimise the risk of damage/brownouts upstream when the electromagnet switches on.
Most USB ports will shut down if the current they supply exeeds something like 150ma (milliamps) <br><br>In between &quot;dings&quot; the capacitor would recharge to supply power sufficient to &quot;wack the clapper again't the bell&quot; Use a series Resistor to limit charging current.
Gotta tell you , I think your choice of avatar is a blast. Those characters crack me up. The artist is coming to my area, and I'd love to see him perform. The radio station has a contest and the prize is two tickets to the show ($130.00 per ticket) That would be a really fun contest to win!
I had an idea similar to this. When you get a email, it sends a signal to a small device in your pocket and alerts you somehow. Anyways, NICE JOB! :D
you mean something like a smart phone?
probaly the same thing, ya. :P
Your tech abilities are amazing! The bell is such a fun and innovative design.
Wonder if just a usb printer cable and logic chip latches would save using a microcontroller and a lot of unneeded code writing. Might do a version using the standard parallel port for linux. On another point, an optoisolator should work to keep the computer safer.<br>
Could do, but you should take a look at the code first, to make it work it's literally just:<br> <br> <em>int main(void) {<br> &nbsp; USBInit();<br> }<br> <br> void USBOut(unsigned char USBData[], unsigned int USBLength) {<br> &nbsp; Port2Write(PIN11, 1);<br> &nbsp; WaitDelay(50);<br> &nbsp; Port2Write(PIN11, 0);<br> } </em><br> <br> And for the ding.exe app (using Signal 11's cross-platform HID API, code looks identical for Windows and Linux) it's<br> <br> <em>int main(void) {<br> &nbsp;&nbsp; unsigned char buffer[2] = {0,0};<br> &nbsp;&nbsp; hid_device *handle;<br> <br> &nbsp;&nbsp; handle = hid_open(0x1fc9, 0xbe11, NULL);<br> &nbsp;&nbsp; if(handle) {<br> &nbsp;&nbsp;&nbsp;&nbsp; hid_write(handle, buffer, 2);<br> &nbsp;&nbsp; }<br> &nbsp; return 0;<br> }</em><br> <br> Using the Signal 11 open source USB lib there, and Forebrain's hardware abstraction code.<br> <br> I've added a bit more code to store the pulse time into Forebrain's on-board EEPROM, to allow changing of the pulse time over USB, as well as increased the number of bytes sent to allow for any future pulsing of LEDs.<br> <br> I would think that building something with logic chips, coding for parallel port, and trying to neatly package for a parallel port would be quite a bit more work!&nbsp; I'd suspect you'd want to use hardware astables instead of relying on the computer to send the turn on/off signal since you want to guarantee the pulse time; you don't want your thread to be delayed half-way through!<br> <br> I've had Forebrain communicating with Linux over USB HID previously as well with no problems (was using Forebrain as a hardware random number generator).<br> <br> With USB connectivity, there is no reason to use optoisolators since the bell is not connected to any other power source.&nbsp; optoisolating USB is also problematic since it is differential signalling, some sort of USB isolation IC would be required.&nbsp; Isolating power transfer is possible with isolating DC/DC converters, I use these in my USB-controlled fridge.<br>
to protect the USB source, May I recommend a Limiting resistor on the 5V line to the transistor (and Main Electro). The larger this Capacitor the greater the turn on &quot;in Rush&quot; or charge current will be.. this could be as bad as the firing of the solenoid . with a little redesign you could have a sizeable storage for the solenoid that is more isolated from the USB but still have the circuit USB powered..
Could you also build a mac version of ding.exe?<br>I would love to make one!
Yes. Mac version PLEASE!!
Hey, I'd love to, but I'll need to get my hands on a mac first! I'll see if I can borrow one off friends or colleagues.
The capacitor in your diagram is 470 micro farads, yet your initial BoM listed a 2200 uF capacitor. Which is correct?
I suggested using at least 470uF, but preferably larger, the one I ended up using is 2200uF.
Nice idea. I can even see steampunkers using it with minimal cosmetic changes.
Or you can connect the USB to a device which converts electrical outlet voltage to USB voltage.
Great!
Neat idea. I really like it. you could also have the microcontroller trigger an event on the computer when the bell is rung with a simple switch, or perhaps even by measuring induced current on the coil when the bell is rung manually. <br><br>For a linux machine, I think this could be redesigned to not even need a microcontroller, just a bit of code to cycle power to the usb port.l See:<br>http://stackoverflow.com/questions/1163824/linux-usb-turning-the-power-on-and-off<br><br>For any OS that lets you cycle the capslock light in response to an email, you could use a cut-up USB keyboard instead of a microcontroller, as in this old project of mine:<br>https://www.instructables.com/id/USB-controlled-mini-lava-lamps/<br>
I know, people keep saying that I don't need a microcontroller, etc. Nobody seems to read the instructable any more, I do mention that I will put pulsing LEDs on the thing.
This is sweet! Perhaps an indicator LED would be helpful, you know, just in case you're out of the office and you miss the bell, that way you know that you have an email. Also, you can buy circular protoboard at radioshack here's the link:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.radioshack.com/product/index.jsp?productId=3173937">http://www.radioshack.com/product/index.jsp?productId=3173937</a><br>
Yeah, I'm definitely putting LEDs under there for some gentle coloured pulsing. That way it'll also be able to distinguish which mail account received the email.
Maybe an RGB LED that can change colors for the amount of emails recieved!
Exactly! I have these high intensity Super-flux red, green and blue LEDs from a previous instructable: https://www.instructables.com/id/Mood-vase/
Well there you go! You could probably diffuse one and it would be sufficient. Gotta love brainstorming! ( :
Would adding a resettable fuse help with the current draw problem?<br><br>Or maybe a large capacitor to tank the energy required for the coil, and release that energy instead of drawing it from the USB port, all you need to add to your circuit is one resistor on the +5V line and then turn up the capacitance on that capacitor.<br><br>Thanks for the introduction to Forebrain. I always love seeing new ARM dev-boards. And thanks for the introduction on POP Peeper.
Yup, I agree, a resettable fuse would be safer for the computer. Although I don't have any current draw problems with mine; I am using a 2200uF capacitor, and the USB port seems happy enough supplying the current.<br><br>I did do as you suggested, I had a 0.47ohm resistor on the +5V line, and a 0.33F ultracap. But seeing as the thing seemed to work fine with a regular large aluminium electrolytic and without the series resistor, I decided to just go with those out of simplicity (and more common to get than really large capacitances and really small resistances)
I don't fully understand the math, so may be completely wrong, but wouldn't too large a cap provide current too &quot;slowly&quot; to the solenoid? Or is that just ESR? Since the cap+solenoid effectively creates a RLC tank circuit, if the resonant frequency is too low?
It is just ESR, and larger caps tend to have lower ESRs (though I think a lot has to do with physical dimensions rather than capacitance value).<br><br>The current from an ideal cap is i = C dv/dt, which only says that the current is a function of the change of voltage, a larger cap will give you more current for the same change in voltage. Or conversely a smaller drop in voltage for the same current.<br><br>The circuit doesn't form an RLC tank circuit since there's a flyback diode parallel to the inductor, which dissipates the reverse current.

About This Instructable

35,622views

157favorites

License:

More by meseta:Email notification bell Bending a credit card into a phone stand using a lighter Mood vase 
Add instructable to: