Build a Real Bell-striking Clock for Your PC and a Fire Extinguisher-striking Clock.
Intro: Build a Real Bell-striking Clock for Your PC and a Fire Extinguisher-striking Clock.
A brass bell, a small relay a few more things and a real bell can strike the hours on your desktop.
Though this project runs on Windows and Mac OS X also, I idecided to install Ubuntu Linux on a PC I found in the trash and work on that : I had never worked with Linux before, I learned some Processing language and wrote a sketch to run an analog clock on it.
Then I interfaced the bell to the serial port of the PC and built this bell striking clock.
Read further and learn how to make a fire extinguisher striking clock also.
In the video the clapper strikes a bit too fast for the camera...
Though this project runs on Windows and Mac OS X also, I idecided to install Ubuntu Linux on a PC I found in the trash and work on that : I had never worked with Linux before, I learned some Processing language and wrote a sketch to run an analog clock on it.
Then I interfaced the bell to the serial port of the PC and built this bell striking clock.
Read further and learn how to make a fire extinguisher striking clock also.
In the video the clapper strikes a bit too fast for the camera...
STEP 1: Processing
Processing Processing is both a programming language and an integrated development environment aimed at electronic arts and visual design. It is based on Java and is open source as most good things are now. It can be downloaded from Processing's home page.
In its basic use it is very simple to learn and gives "instant gratification of visual feedback" as aptly written in Wikipedia.
I'm not much of a programmer but it took a few hours to me to get to the result from scratch thanks to a great deal of examples and tutorial.
Many stunning visual artistic performances are given with the aid of Processing and many of them have their Processing source code available for download. One of my preferred is Substrate : I spent a lot of time looking at the drawing build under my eyes.
The code i wrote is very basic : it creates a canvas, assigns color for the background. Every hand of the clock is drawn the same vertical position with respect of the coordinate system, the trick is to displace and rotate the coordinate system. A common trick I saw on many examples : the angle of rotation is in linear ratio with the seconds, minutes and hours.
At the hours a burst of space characters is sent to the serial port. The number of characters per burst being the number of strikes I want the bell to ring, the hours actually.
You don't really have to learn Processing to replicate this toy. In the analog_clock.zip attached you'll find the applications ready to run on Linux, Windows and MAC OS X.
For windows just extract the application.windows directory and run the exe. That's it.
The program will look for the first COM port available (serial port COM1 if you don't use it) and attach to it. The character to drive the bell will come out of it.
In its basic use it is very simple to learn and gives "instant gratification of visual feedback" as aptly written in Wikipedia.
I'm not much of a programmer but it took a few hours to me to get to the result from scratch thanks to a great deal of examples and tutorial.
Many stunning visual artistic performances are given with the aid of Processing and many of them have their Processing source code available for download. One of my preferred is Substrate : I spent a lot of time looking at the drawing build under my eyes.
The code i wrote is very basic : it creates a canvas, assigns color for the background. Every hand of the clock is drawn the same vertical position with respect of the coordinate system, the trick is to displace and rotate the coordinate system. A common trick I saw on many examples : the angle of rotation is in linear ratio with the seconds, minutes and hours.
At the hours a burst of space characters is sent to the serial port. The number of characters per burst being the number of strikes I want the bell to ring, the hours actually.
You don't really have to learn Processing to replicate this toy. In the analog_clock.zip attached you'll find the applications ready to run on Linux, Windows and MAC OS X.
For windows just extract the application.windows directory and run the exe. That's it.
The program will look for the first COM port available (serial port COM1 if you don't use it) and attach to it. The character to drive the bell will come out of it.
STEP 2: The Bell's New Clapper
The support for the bell is made from Meccano. The pictures should tell it all.
The bronze bell I found at a hardware store and sounds pretty nice. I unscrewed the orginal clapper and replaced with a 4mm 120mm long screw with washers and bolt.
The relay is a miniature one. I removed the copper contacts from the armature and glued a thin u-shaped steel wire. A small screw and nut complete the clapper.
The bronze bell I found at a hardware store and sounds pretty nice. I unscrewed the orginal clapper and replaced with a 4mm 120mm long screw with washers and bolt.
The relay is a miniature one. I removed the copper contacts from the armature and glued a thin u-shaped steel wire. A small screw and nut complete the clapper.
STEP 3: Electronics, Just a Little Bit - No, Really !
The serial port is interfaced through a simple transistor interface to the relay. Every character sent to the serial port makes the relay click. Larger relay may require two space characters per click, others may require a larger Baud rate than the current 300 for a shorter pulse.
I modified the relay removing the contacts and gluing a sort of clapper made with steel wire and a nut and bolt. Simple but effective.
The tricky part is to find the best position of the relay-clapper to make it hit the bell without damping the oscillations.
I put everything on Meccano for faster modification and alignment.
As I said the schematic is very crude : almost any low / medium power NPN transistor will do.
The diode in parallel with the relay prevents the back EMF from relay coil to destroy the transistor.
The power source is provided by a USB port of the PC, 5Vdc are available at pins 1 and 4 of the connector. The PCB mating connector I took from a dead printer. In case an USB port is not available, an external DC voltage wall adapter is fine. The adapter voltage must match the relay and not exceed the transistor rating. Any regular Radio-Shack wall adapter should do, but the USB is more attractive to me.
Larger relay provide larger clappers to hit larger bells. A stand alone version I built and based on Arduino-compatible hardware is described in my blog. In this case any good sounding thing is fine to be used as a bell : in my case I used a CO2 fire extinguisher.
Not being designed as an Instructable I did not post it here though.
In my blog you can find some directions, schematic, code and a video.
Ding !
I modified the relay removing the contacts and gluing a sort of clapper made with steel wire and a nut and bolt. Simple but effective.
The tricky part is to find the best position of the relay-clapper to make it hit the bell without damping the oscillations.
I put everything on Meccano for faster modification and alignment.
As I said the schematic is very crude : almost any low / medium power NPN transistor will do.
The diode in parallel with the relay prevents the back EMF from relay coil to destroy the transistor.
The power source is provided by a USB port of the PC, 5Vdc are available at pins 1 and 4 of the connector. The PCB mating connector I took from a dead printer. In case an USB port is not available, an external DC voltage wall adapter is fine. The adapter voltage must match the relay and not exceed the transistor rating. Any regular Radio-Shack wall adapter should do, but the USB is more attractive to me.
Larger relay provide larger clappers to hit larger bells. A stand alone version I built and based on Arduino-compatible hardware is described in my blog. In this case any good sounding thing is fine to be used as a bell : in my case I used a CO2 fire extinguisher.
Not being designed as an Instructable I did not post it here though.
In my blog you can find some directions, schematic, code and a video.
Ding !
36 Comments
OchukoE 9 years ago
hi, i want a program to ring a school bell. can you do it for me?
and at what cost? my email ochuko415@gmail.com
beehard44 12 years ago
Just a suggestion
5Volt 12 years ago
Ciao
A.
Rob K 15 years ago
So far it is just a relay, it doesn't click, . Can you explain this a litte better for me
Larger relay may require two space characters per click, others may require a larger Baud rate than the current 300 for a shorter pulse.
Where does this exactly get changed. I looked at where it might be but just messed up the .pde.
It is a fairly good size 5v relay. 115ma coil. 240v 16A. I was able to make it click like crazy when I ran the MiniPOV programing.
5Volt 15 years ago
Anyways, since it is the pulse on the serial port that makes the relay click, too short a pulse would not give time enough to the relay to move, It's just like hitting an open door with a fist : the door would not shut. To shut it a more gradual and prolonged push is necessary.
The relay seems OK, try replacing it with an LED + 150 Ohm resistor : you should be able to see it blink very shortly, stare at it in a very dim light. If not ( which I suspect ) the serial pulses are not going out through the serial port you are using. Look at the bottom of the Processing window (the console, at the bottom of the one with the code) and look at the list of the serial ports that processing has access to. Make sure you are using the first one in the list.
In case you can't or don't want whatever the reason, just change the 0 between square brackets in the line
port = new Serial(this, Serial.list ... , 300);
with the number you are using and which is in the list in the console window, possibly 1 or 2.
I haven't tried through USB to serial port converters, are you using one of these ?
If the LED blinks, it probably means it is too short for the relay, in case just change the lines (two of them one at the top and one at the bottom of the source code)
port.write(" ");
with
port.write(" ");
where I added 2 more spaces within the inverted commas. In case add more spaces. The LED should blink quite visibly now.
port.write(..) is the instruction that pushes a space character into the serial port
port = new Serial(this, Serial.list ... , 300);
tells the system you want to use the first serial port available with 300 baud speed.
Make sure you are powering the circuit, in case try with an external 5Volt supply (3 AA batteries will do)
Hope this helps.
Ciao
P.S. I did not write completely the line with the "..." not because I'm lazy (which I am) but because for some reason the Reply editor refused to accept brackets (round and square ones)... Do not copy and paste the lines above, just do your typing ! (one number and/or 1-2 spaces)
Best
Rob K 15 years ago
So far it is working when I apply 5 volts to the other side of the diode on pin 3 of the serial port( at least the circuit is right). I have always been partial to the if it low voltage and low amps Check it With Your Tongue. I didn't feel anything when the clock did its thing. It is a USB to serial converter. The computer and the and the Processing program finds it as COM8. or as 1 in the black text field below all of the code.
Below is a picture of the modified relay (striker). It works fairly well after I stretched one of the contacts and bent the actuator a little. It has 2.5mm (10 gauge US) copper wire JB welded to it. One piece for a striker and another piece for a stand that will be screwed to the base.
I am taking pictures as I go(so far at 22). I get this done, it is going into a big slide show. The pictures can be found here on my flicker SET page.
http://www.flickr.com/photos/20102150@N06/sets/72157613856120191/
It would not let me do a name of link for some reason.
Thanks again
Rob
Rob K 15 years ago
5Volt 15 years ago
Rob K 15 years ago
5Volt 15 years ago
Rob K 15 years ago
5Volt 15 years ago
Rob K 15 years ago
Jack of Most Trades 16 years ago
5Volt 16 years ago
Doc Holliday 16 years ago
technodude92 16 years ago
5Volt 16 years ago
More likely a motor with a cam and positional switches.
For now post pictures of the bell here within a comment. Photograph the bell together with some dimensional reference (like yourself) near the bell so we can see the beast you'll be dealing with.
To play tunes you just need a few bells with electromechanical actuators: as always depending on the size of the bell it might be a cam motor or electromagnet. Each actuator would be driven by a low/medium power relay and the relay would be driven by an interface to a computer or standalone clock. The interface would be more complicated than the current.
The one described here can be modified easily with more outputs. The PC's serial port isn't.
Ciao
5Volt 16 years ago
Doc Holliday 16 years ago