6
\$\begingroup\$

I have a project where the requirement is that if a light switch is turned on, one load will be turned on, but if the switch is toggled first before being switched on, a second load will be powered as well. It would need to resets if left off for a bit. Basically a way for a user to control two loads with one switch. This on US mains power, 120VAC.

I'm comfortable doing this if I include a microcontroller, but that feels like overkill and then I need to have a power supply for it, and that's going to cost space I don't really have (I'll probably use a capacitive divider and MCU if there is no other way. The device will be double insulated.)

I feel like there is some clever circuit for this. I feel like there are (older?) products that may already have this behaviour, but I can't think of any specifically.

Are you guys aware of anything? Discrete or integrated? Or should I just go the MCU route?

To forestall concerns: I am an EE and am aware of and able to handle the relevant safety issues. (I'm just not as strong at this kind of circuit design)

EDIT:

This device is a light and fan combo that will screw into an existing socket (that's why it needs to be kinda small) and use existing wiring (so I can't change the switch), if you just want light, you turn on the switch normally, if you also want the fan, you toggle it once first (the light would blink, that's okay) and then switch it on, and now both will run until turned off (for say 2 seconds).

\$\endgroup\$
13
  • \$\begingroup\$ How do you propose to toggle a switch without momentarily activating the first load. You need to explain more details and think about this more. How does the circuit know that a toggle was previously made 3 years (or 3 seconds) ago and that the next full activation of the switch should activate load 2? Aha "to resets" means "to reset". The devil is in the detail so please do carefully clarify. \$\endgroup\$ Commented Oct 11, 2024 at 20:31
  • \$\begingroup\$ Would a 2P4T (two pole four throw) switch be acceptable? \$\endgroup\$ Commented Oct 11, 2024 at 21:26
  • \$\begingroup\$ There certainly is a circuit. You said you can do it with MCU. It's basically the same circuit you will use with MCU doing the logic, but without MCU doing the logic. The logic can be done with analog and digital chips to detect exact same sequence of timing than the MCU would. For example, capacitors store charge and can be used for memory. Or implement the logic with FPGA, that's certainly not MCU. Or is FPGA also not on the list? If not, please edit the list of things you don't want to use and things acceptable to use. \$\endgroup\$ Commented Oct 11, 2024 at 21:30
  • 2
    \$\begingroup\$ @Justme I guess that's what I came here to ask. I thought there might an IC that can do what I want that can handle the high voltages, or some clever analog solution. What you are describing, rectifying the AC to DC and using a buck regulator is pretty much exactly what I am trying to avoid. If you'll read my most recent comment you'll see why power supplies aren't going to work (unless they are tiny, which is why I mentioned using a capacitive divider) \$\endgroup\$ Commented Oct 11, 2024 at 22:06
  • 1
    \$\begingroup\$ Why can't you use an ON-OFF-ON toggle switch? \$\endgroup\$ Commented Oct 12, 2024 at 13:47

4 Answers 4

4
\$\begingroup\$

CMOS logic runs on microamps, so a non-isolated offline supply can be very small.

You need a diode-isolated holdup cap to power the circuit through the blackout, a second resistor-diode-cap to peak detect the AC line, and an R-C timer to hold the latch in the Reset state on first power-up, and release the Reset input so the next powerline dip can clock the latch that drives the output TRIAC. One CD4093 should do it.

What is the maximum motor power?

UPDATE2:

Here is a second-pass at a single-chip, non-microcontroller solution. This is based on something I designed years ago but never built.

DISCLAIMER: This circuit is dangerous. It has direct connections to the mains. Also, it has not been tested.

enter image description here

The circuit is a tradeoff of three R-C timers.

When the circuit is first powered on after being off for a while, R1-C1 holds the flipflop in Reset state for a while so that the flipflop is not set prematurely.

After the circuit is first powered up, R2-C2 determines how long mains must be missing to be detected as off. This signal Sets the flipflop. If mains is reapplied quickly, the flipflop drives the SSR (Solid-State Relay) to turn on the motor.

C3 limits the AC mains peak current to 12 mA. D2 + D3 clamp the maximum circuit voltage.

C4 is the power supply for the circuit. It is large enough to maintain Vcc at an operating level while the circuit delivers up to 10 mA into the SSR.

When operating, there are AC ripple sawtooth waves across C2 and C3. Circuit values are chosen such that the minimum voltage across C2 is above the threshold voltage for U1A. C3 is chosen so the minimum voltage across it is greater than the U1 minimum required operating voltage Vcc.

The R1-C1 time constant is longer than R2-C2. The difference between these two times sets the maximum time the mains can be off and the circuit detects it as a control bounce rather than turning everything off.

NOTE: There might be a conflict/interaction between the values of C2 and C3 because at 60 Hz they form a voltage divider. To compensate for this, C2 might have to be reduced in value.

\$\endgroup\$
5
  • \$\begingroup\$ MCUs run on microamps, too, so I guess this exercise is just for the intellectual challenge of it? \$\endgroup\$ Commented Oct 12, 2024 at 11:47
  • \$\begingroup\$ This sch was comes from something larger and doing other things, and I got a little carried away in editing. D1 originally was a bridge, and the TRIAC was a solid state relay. Corrected schematic coming. \$\endgroup\$ Commented Oct 13, 2024 at 14:54
  • \$\begingroup\$ Schematic corrected and text cleaned up. \$\endgroup\$ Commented Oct 13, 2024 at 15:14
  • \$\begingroup\$ @AnalogKid This is awesome! It looks like the closest solution available. Thank you! But, It appears that D1 is still a bridge, and there is still a SSR not a triac, did the post not update or something? \$\endgroup\$ Commented Oct 15, 2024 at 18:34
  • \$\begingroup\$ I changed D1 back to a bridge because a single diode was a mistake. I realize that a pre-packaged SSR probably will not fit in your space, but the SSR is in there because modifying the circuit to drive a TRIAC directly is a bit more complex. An intermediate option is an optocoupler plus a TRIAC. \$\endgroup\$ Commented Oct 15, 2024 at 19:41
4
\$\begingroup\$

It's an interesting problem. Fundamentally, you want to switch on the second load if the voltage switches on, off, on within a certain interval of time. And you want to do this without the complexity of creating a low-voltage power supply.

This requires two elements:

  • A memory element that decays within the specified time
  • An edge-triggered flip-flop that captures the state of the memory on each "on" event.

The first could be a simple capacitor charged through a rectifier.

The second is a bit more problematic. While it is possible to create edge-triggered logic using relays (here's a similar example: How to control a motor with only relays and push button?), it requires a minimum of three relays, which may not be better than using the MCU and its low-voltage power supply.

I suppose you could build a line-voltage solid-state edge-triggered flip-flop using high-voltage discrete transistors, but it would require a nontrivial number of them, and end up being fairly bulky anyway. And you'd still need a relay to control the load.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Yes! you've captured the essence of what I want to do very succinctly. And you basically describe what I vaguely had in mind to do. Sounds like a high voltage edge-triggered flip-flop isn't a thing I can get off the shelf.... I guess that's my answer then (unless others propose something? I'll give it a day or two). Thank you very much! \$\endgroup\$ Commented Oct 11, 2024 at 22:14
3
\$\begingroup\$

Yes. Choose your technology. But think about power consumption, size, and per-piece cost.

Relays -- sure, if you can find 120VAC actuated time-delay relays. You could probably realize this with three or four relays if anyone makes a time-delay relay any more (and if said time-delay relay doesn't have a micro buried in it, because that's cheaper these days).

Have your wallet handy.

Transistors (or vacuum tubes) -- sure, if you want to mess around with discrete-device logic. You'll need to built a power supply, possibly exactly the same one as you'd need for a micro.

IC's -- sure. You could do this all with 74HCxxx logic, even from parts that are still available today. You still need that power supply, and room on the board for several chips. If you're building the gizmo in the tens or hundreds of thousands, and the requirements are guaranteed not to change, this may be the most cost-effective solution. You still need that power supply.

Microprocessor -- wouldn't it be nice if there was one little cheap easily customizable logic part that did exactly what you wanted? Wouldn't it be nice if you could change how it behaved without doing a complete redesign of your circuit? Since you're building that power supply anyway -- why not use a six-pin micro?

\$\endgroup\$
2
  • 6
    \$\begingroup\$ I'm detecting a little (hopefully friendly) snarkines. :) Yes, I know an MCU is an easy solution, I just wanted to make sure I wasn't missing something more elegant. I feel like some engineer out of the 50s would be like, "oh yeah, if you put two SRCs back to back with a Triac and a capacitor, that will do what you want." some of those old analog guys could work miracles in ways that are over my head. Anyway, thank you for taking the time to answer. \$\endgroup\$ Commented Oct 11, 2024 at 22:27
  • 2
    \$\begingroup\$ I don't think you're going to find an easy way to get the time delay that doesn't involve a relay. Those 1950's engineers were smart, but they designed bulky stuff. \$\endgroup\$ Commented Oct 11, 2024 at 22:51
0
\$\begingroup\$

When I wrote this question, I thought I remembered devices that worked like this in the past (like the 70s), but when I looked into it, the closest devices I could find still used low voltage logic for control, and used capacitive dividers to get that low voltage in a small and economical way.

So I guess the practical answer to my main question is to just do the capacitive divider supply route to keep things small and inexpensive (and design it with the proper insulation to keep it safe) and just use low voltage logic, whether a microcontroller, or something like @AnalogKid 's answer.

I haven't come across anything simpler, smaller, or more cost effective.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.