Connecting an LED to a light wall switch. (by Samukelo Shezi)
Hi my mentor, Jonathan.
May I ask if you have any idea what can be done to connect a normal 5mm LED to a light wall switch, such that the LED will be on when the light is on, especially when there's no neutral wire in the vicinity?
Thanks, regards
Samukelo Shezi
South Africa
Always appreciating such wealth of knowledge you provide to us, FREE OF CHARGE!
(no subject) (by Jonathan Westhues)
Look at how clamp-on ammeters work. They run the current-carrying conductor through a hole in a magnetic (high permeability, like ferrite) core. This induces a magnetic field in that core, in proportion to the current. So by measuring that magnetic field, we can measure the current.
If we needed to measure the DC magnetic field, then we might use a Hall effect sensor, for example. But there are stray DC magnetic fields everywhere (like from the Earth's magnetic field), so that's difficult. DC-coupled clamp-on ammeters tend to have an adjustment somewhere to zero them, to compensate for that offset.
An AC-coupled measurement can be made by adding a few hundred turns of magnet wire to the core. That makes a transformer; so it steps down the current, and by attaching a current-sense resistor across the secondary we can convert that current to a voltage. So if you have a 1:100 transformer, for example, with a 10-ohm current sense resistor, then 2 V across that resistor corresponds to 200 mA in the secondary, or 20 A through the primary.
Note that a current transformer will generate a very high voltage if it gets open-circuited--if it steps down the current, then it must step up the voltage. This may become dangerous. Never let a current transformer open-circuit.
If you get almost any ferrite core, then you should easily be able to build a small current transformer and scope the output voltage across a current sense resistor. More careful design would be required to build something accurate, but it's to see the difference between zero current and nonzero.
Then it's just a matter of converting that voltage to whatever form you need; for example, peak-detecting it and comparing it against some threshold.