I am trying to design a timer for a 220V AC appliance (a coffee grinder); my goal is to learn about analog circuit design, I know how do this easily with an Arduino or equivalent.
I am starting from a current transformer that detects when the grinder is running, and a relay that can open the grinder power supply.
This is what I am trying to achieve:
- When someone starts the grinder, the circuit starts counting down from 10s
- After 10s, the relay stops the grinder
- 3s after that, the circuit goes back to the initial state
- If the user stops the grinder, the circuit must come back to its initial state (I haven't even attempted this last requirement below)
Here is the circuit I came up with, using the parts I have around:
- The CT generates 5.5V across the burden resistor, at 50Hz, with a duty cycle of 5% (roughly 1ms pulses)
- The power supply on the right is 5V DC
- The first 555 timer is triggered by the CT, and expires after about 10s
- The second timer is supposed to start after the first one goes off, and when on it will open the NC relay so that the grinder is disabled for 3s.
As you can see I have tried to get fancy with the 555 reset pins, but the circuit as shown doesn't work:
- the circuit from timer 1/OUT to timer 2/RST is trying to make sure that timer 2 is disabled until timer 1 is triggered (so that the grinder can be started at all). The 10uF capacitor was an attempt to keep timer 2 enabled for a short time after timer 1 goes off, until timer 2's output goes high; unfortunately the 555 OUT sinks current and drains the capacitor right away.
- the circuit from timer 2/OUT to timer 1/RST prevents the 10s to start while timer 2 is in its 3s shutdown time. OUT and RST are connected on timer 2 so that timer 2 keeps itself auto-enabled as long as its output is high.
The simulation is here on falstad.com. Any suggestion welcome 🙂
Edit: I do understand the 555 is obsolete and not the right part for the job; if I were to implement this, I would obviously use an IC. I am simply trying to get better at manipulating signals using simple analog components: changing a low into a high, boosting a current or a voltage, delaying…
Edit 2: The flyback diode across the relay has been omitted above.
Edit 3: Here is a better diagram, and some changes based on the answer below that at least make the circuit work in my simulator:
C7 is making sure that the T2 555 is in reset while the circuit powers up. After that, it should only ever trigger from C6 when T1's output goes low.
M2 keeps T1 in reset, as long as T2's output is high.
Best Answer
It's been a while since I worked with a 555 timer, but I'll try to make sense of this. It's hard to understand everything going on because the circuit is arranged very poorly, there are no part numbers or reference designation on anything, and the unusual (I assume simulation) parts are not labeled. Here are a couple of primary reasons why what you have will not work as is:
Here are a few things that need to be fixed:
Additional Information
Normally, I would end my answer here, but I had a bit of time and curiosity got the better of me. Before I go over a working example, let me be clear on a few things.
Revised Circuit - Simulated Appliance Power
I'm using LTSpice for my simulations. I don't have models for relays so I'm simulating all of that using transistors and voltage controlled switches. Here's the appliance power circuit.
Here are the resulting power and trigger waveforms.
You should see that as soon as "start" goes high, the "power" also turns on, and the CT pulses start immediately. The "start" is timed to pulse twice, but that's not important right now.
Dual 555 Timers
The initial 555 timers are pretty straight forward. Timer 1 is setup to give a 110ms pulse, and timer 2 gives a 55ms pulse. These times are arbitrary - just doing something reasonable for the simulation. Whenever timer 1 output is low, timer 2 is triggered.
The voltage divider at at the timer 2 output is just so the outputs have different levels in the waveform - easier to see what's happening. As you might expect, timer 2 is instantly triggered, and then again whenever the timer 1 pulse is over. We'll fix that next, but for now, here's the waveform.
Controlling Timer 2 Power
Remember that transistor controlled voltage switch from the beginning to keep the appliance powered on from the start pulse? We can use that again here. Timer 1 output can turn on M5 (NFET) which turns on M6 (PFET) to switch power to timer 2. That way, timer 2 is off until timer 1 pulses. Then, this power signal can feed back into the M5 gate to keep it on. A diode is used to prevent that power from screwing with the timer 1 output. I use another divider to monitor the power line (power2) so the waveform is easier to see.
Controlling the Appliance Power
Now, we can use the timer 2 output to turn off the appliance by feeding it's output into the base of the M4 NFET (see the first picture), but we have a new problem: timer 2 stays on FOREVER because timer 1 is always low because the appliance is kept off. Bummer.
Final Adjustments - Timer 2 Power
To fix this, we can adjust how timer 2 is powered. Rather than feeding it's power line back into the M5 gate, we can use a capacitor at the gate to keep it on for so long. The value of the capacitor will determine how long timer 2 is powered after the timer 1 pulse is over. I'm using 6uF (C6) which gives us just slightly less on time than the 55ms pulse from timer 2 (timer 2 looses power a few ms before its pulse would end).
Some things to keep in mind - if the value is too big, timer 2 will end, but its pulse but stay on until the cap discharges anyway. Also, it will take some time for the timer 1 output to charge it up. Setting the time constant to be less than the total pulse time of timer 2 will set the actual time of the timer 2 output pulse. I won't get into the details of how to calculate the capacitor value. If you want to learn, check out this excellent RC time constant tutorial. There are also lots of related questions here on stack exchange.
Here is our final, complete circuit and the resulting waveform.
So here's what's happening:
Real World Gotchas