Crazy Watch – Exploring electronics fundamentals
“It is good to have an end to journey toward; but it is the journey that matters, in the end.” ― Ernest Hemingway
A few days ago my son came back from school with something that he had build in a Tech-Ed class. You had to carry a copper ring across a maze made of wire without “waking up the monster”. If you touch the wire, closing the circuit, the eyes (LEDs) would light up.
I know it is pretty simple to make a LED shine, but what got me intrigued was that the “eyes” were blinking in an alternate fashion! I was surprised because that was the very first thing my son did in an electronics class and I thought they would not start electronics in school with a 555 timer or a micro-controller. How the hell is that thing blinking? Hang on… I’ll get to the Crazy Watch soon. I promise.
The circuit had 4 resistors, 2 capacitors, 2 LEDs, 2 transistors and a diode for protection. After Googling it a bit I finally discovered the “Astable MultiVibrator” (AMV for short).
Now, I just needed to understand how it works. You can find a detailed explanation here.
I already had the concept that the combination of a resistor controlling the flow of current supplied to a capacitor could be used to time things, as the capacitor needs a certain time to charge up, and I started to play with my oscilloscope (got to use that thing!) to see that charging happening.
The yellow line bellow (1) shows the data from the negative lead of the capacitor and the blue line (2) shows data from the positive lead of that same capacitor.
I was expecting to see a diagonal line representing the capacitor charging (220uf/5V/10KOhm) but note that the diagonal line is happening in the negative lead and that it dipped way into negative territory! The voltage in the negative side of the capacitor suddenly dove close to -3V and the flat line was around +0.6V.
Turns out that this is a characteristic of capacitors. The voltage potential, in the capacitor, cannot change instantly. That is, if the capacitor is charged at 3V the potential difference between the positive and the negative plate is 3V and that will require a certain time to change (charge/discharge).
If you look closely to the AMV circuit, the positive lead of the capacitor is connected to the emitter of the transistor, and the voltage, in that area, is what comes from the diode (around 3.6V) when the transistor is “off”.
When the transistor turns “on” the circuit now has a path to ground and the voltage at that point is now zero. The capacitor cannot change its internal voltage instantly and takes the other plate to negative territory to maintain its potential difference (voltage).
Notice that when the diagonal line reaches approximately +0.6V it becomes flat. That’s because +0.6V is the voltage that turns “on” the transistor (no pun intended) to which that lead is connected, re-initiating the cycle. The base-collector junction of the transistor starts conducting, becoming the least resistant path, and keeping the negative plate of the capacitor from charging above that level.
Well, what does it all have to do with a “Crazy Watch”, you ask! With the AMV we got ourselves a timer! Why don’t I build an “electronic” watch using that principle? Something that moves a needle as the circuit oscillates?
Easily said than done… but I set up my AMV in the bread board anyways and added a coil made of 14 turns of 0.1mm enameled copper wire, a current limiting resistor, a permanent neodymium magnet and I had what I thought was a proof of concept. I can build this thing!
Note in the video that the coil is attracted to the permanent magnet when current is flowing and goes away due to gravity (the weight of the other end of the wire) when the current, and the magnetic field, disappear.
I cannot depend on gravity if I want this to move around. I needed a way so the coil is attracted or repelled as needed. My first prototype had the coil mounted in the needle and would have 12 permanent magnets laid out side by side in reverse polarity (North-South-North… and so on). The rings would be my positive and ground rails. As the needle needed to spin around, the connection with the power source couldn’t be fixed. That didn’t work too well.
In the second prototype, the permanent magnet is mounted in the needle and I now have 12 coils laid out in a way the polarity is alternated between one and the next.
I didn’t want to make this more complicated and add a bunch of components, so now the whole thing is a continuous piece of wire where for each 14 turns, I put the coil upside down hence inverting the polarity. That is not really optimal as at least 8 coils would do no work at any given time but would still drain power. Well, I wanted to have fun and learn, not sell this thing so… good enough.
At this point I can turn the coils on and off and have six north-poles and six south-poles but I need those poles to alternate to generate some lateral movement otherwise the needle will stay up and down in the same spot all the time.
You may know that, same as a brushed motor, to reverse the polarity in an electromagnet (my coils in this case) you need to reverse the current direction. That is to say, if you have positive connected to wire A and negative to wire B, to invert the direction of current, you have to connect negative to wire A and positive to wire B. which I can do pretty well by hand but it’s not really practical.
Now I need a way to, given two signals (the pulses from my AMV), send the current in one direction or the other. You probably had to do this before to drive your RC car back and forth. Chances are you used an IC driver like the L293D or another version of what’s known as an H-Bridge circuit.
I wanted to keep my experience using only discrete components. It would be too easy just go to my bin and get the old L293D.
The trick here is: you need a circuit that is able to “sink” or “source” current using a common wire. In other words the 2 ends of the coil will be alternating between positive and negative.
An H-Bridge is a simple but clever circuit where you need 2 NPN transistors and 2 PNP transistors. You can find those probably in 99% of the cheap RC cars sold for children.
I didn’t have PNP transistors so I got them from an RC car that I bought at a thrift store. Those are for the back and forth and left and right car movements, so you should find at least 4 of each (PNP/NPN) transistors there:
The final result
As you can see, the “watch” doesn’t really go only clock-wise, that’s why I decided to call it “Crazy”. Also it doesn’t move at 1 second delay (I could probably get close to that with combinations of resistors and capacitors).
It occurred to me to try and control the movement with independent coils and something like a shift register circuit… That will be for another weekend.
Very cool! Quite the journey indeed – from a blinky eyes “monster” toy, through electromagnets and an h-bridge circuits to end up with a “crazy” watch that seems to have its own idea of time…