Building a Smart Master/Slave Switch

Here is an inexpensive and easy-to-build master/slave switch for integration into powerstrips for the automatic switching of “slaves” upon the status of the “master.” A built-in sensor monitors the current drain of the master unit, and when the current exceeds a pre-defined level, the slave outputs are automatically switched on. This device is, in fact, designed for use in desktop PCs. When the desktop PC is switched on, all peripherals (like the monitor screen, printer, scanner, multimedia speakers, etc.) are switched on automatically!



Circuit Description

The circuit is designed around two key components: a current transformer and a compact SMPS module. The current transformer (CT) is a 5-A/1,000:1 type with a built-in “burden resistor,” and the SMPS module is a 5-V/3-W type (HLK-PM01). The current transformer is specifically designed for monitoring current, and you can wind a few turns of mains-insulated wire through its core to derive a useable output from the secondary. When the current transformer senses plentiful load current from the master unit, an electromagnetic relay (RL1) wakes up to power everything connected to the slave and falls asleep again when the master unit is turned off.



As shown, the circuit is designed for 10-A relays, having a coil resistance of 400 Ω or more, although it may drive coils with lower resistance as well. A coil resistance of 200 Ω is the suggested minimum value.


Actually, sensing load current of the master unit can be a little tricky, but the employment of the current transformer makes it flexible. Because the 5-A/1,000:1 ratio (5 A to 5 mA) CT has a 200-Ω burden/load resistor across its output, the AC current can be calculated by measuring the voltage drop across the resistor; i.e., we get an output of 1 V at 5-A load current (primary current divided by the turns ratio and multiplied by the value of the burden resistor). Take note, when using the CT, the number of primary turns (wire loop) needed depends on the type of CT itself and the current that the master unit draws. With the transformer mentioned here, just start with one to three turns and try to increase/decrease the number of turns for lower/higher load currents. Besides, you can replace the onboard 200-Ω burden resistor of the CT with a higher-value resistor (or a trimpot) because it’s unneeded here to care more about the inherent saturation and frequency response issues* of the current transformer.



*When we fool the current transformer into seeing a bigger current than is actually present by looping the wire being monitored through it two or three times, the current that it sees will be doubled or tripled. Because the current transformer used in this design has a theoretical maximum current sensing capacity of 5 A, attempting to sense a larger current will have two effects. First, the output voltage could rise, and the other effect of exceeding the 5-A limit forces the transformer to saturate and degrades its linearity. For designs to accurately measure the value of the current being observed, this would matter; however, all we care about here is if it is active or not.


Construction Hints

The circuit is designed to use inexpensive components (I bought key parts from eBay traders), and most are not critical. However, unlike commercial devices, this master/slave switch requires a somewhat troublesome “initial trimming” of the load threshold. As mentioned earlier, you can remove the burden resistor to add a trimpot (1K or the like) across the output of CT if you want a fairly broad range of load threshold adjustments.



For real-world applications, it would be neater to actually custom-build a unique PCB being that the usual veroboard is extremely unsafe with mains voltages. The finished design can then be enclosed in a suitable insulated container. The current transformer can be placed close to the master plug being monitored. Keep in mind that it is sensing currents at fatal mains voltages, so care must be taken to ensure that everything dealing with the mains side is done to proper wiring/safety standards and should be kept separate from everything else. Beware: One small mistake could mean the end of you or someone else!


Save Power!

In many electronics labs, there is a plethora of instruments/power tools that are used together — e.g., a dust extractor used with a rotary tool or jigsaw. This circuit can also be used there to automatically run all of the slave devices “in tune” with the master unit.


CT Test in Lab

I ran some random tests on the current transformer module with the onboard 200-Ω burden resistor. At full current (5,000 mA), I got 1,000 mV across the burden resistor — exactly as expected — with a single turn.



And, with five turns on the primary, the observed output across the burden resistor was about 5,000 mV at 5,000-mA primary current. Because the burden resistance is placed in parallel with the secondary winding, voltage across it was monitored rather than the current through it because it’s easier to have an output voltage to work with than an output current.

One Comments

Join the conversation!

Error! Please fill all fields.
  • Xen

    Why is there a diode (D1) next to the CT?

    I mean the only effect it can have is to provide zero current flow when the phase is high on the lower side, but it appears that any current would be drained to ground and nothing would flow through the diode anyway. So on the ‘high cycle’ for the lower side there’d be no current or voltage across the burden resistor, effectively there’d be no voltage in the circuit at all?

    Oh I misunderstand how this works. In the ‘high part’ of the cycle (for the top part) the ground does not act as a sink, but as a source. Part of the current that goes through the CT (about 1/6th) goes through the transistor, to the ground, and comes back via the ground at the CT.

    In the ‘high part’ of the cycle for the bottom part, current is flow down through the CT and there is an upward draft through the burden resistor.

    But that means the voltage at the junction (to ground) would be, say, 1.5V and again about 1/6 of the current would flow through the right side, but nothing being drafted from ground?

    But that would imply that if anything, in this half-cycle, goes through the transistor, it would only be limited by the diode, end up at (say) 0.8V, end up at 0.1V after the transistor, and then pulled up again by ground, but that could never happen because you’d sit in a loop. So the only thing that could happen is that 1/6th is pulled up through the right side resistor.

    Which does, perhaps, keep the voltage high? Or high enough.

    But that seems impossible, on the edge case (ie. 0.7V) the R1 resistor doesn’t do a thing, so on the equivalent “lower cycle” the diode would just pull it down to 0V and the transistor would be… inactive… so I still don’t see the purpose of that diode’s existence.

    However during normal ‘operation’ (not an edge case) I guess it could keep the transistor activated and prevent it from oscilating? But if no current flows there, that doesn’t work either — I thought the purpose of the capacitor was to prevent oscillation of the PNP transistor.

Looking for the latest from TI?