I’d like to use two methods to detect current. My apologies if I’m not using the correct lingo.
Let’s say I want to use an Arduino that “does something” if I plug a cord into an outlet and there’s power (110VAC). So I would be directly connected in some way.
An alternative to that would be to detect current flowing by placing a “sensor” near a power cord (AC) of something that is on. Maybe a lamp or electric motor.
Appreciate any suggestions you would have!
If the Arduino is powered from the outlet, the first requirement is easy.
Detecting current flowing in a cable without penetrating the cable is possible but it's difficult. Cables are designed to reduce radiating magnetic fields. Otherwise you would be losing a lot of power that isn't lighting your lamp. So other magnetic fields nearby may be stronger than the one you're trying to detect.
Can you plug your cable into a "detector" box which has a plug on the other side going to the outlet? Then you can access the individual conductors inside the box and get a reliable detection.
For AC they make things called CTs (Current Transformers) which are very cheap on ebay. You run one conductor through it, if you run the second the two fields cancel and you get nothing. If you want to amplify the signal wrap the wire around the CT a few times (through the hole). A bit of caution they are inductive and without a load on the output it will zap you much quicker then a cup of coffee. Also you need the load to develop a measurable voltage, which will be AC, this does not work on DC. Remember the output is AC you need to convert it to DC and add a filter to read it with the Arduino or use a special sensor. The filter tradeoff is a compromise on the speed of response.
Good Luck, Have Fun!
MorganS. I think that's a great answer! The fact that it's on, means we have power. That would be very simple.
I'm wondering if I could plug a 500ma 5VDC adapter into the outlet and connect the output directly to the analog input or would I have to put something in between since there's no load?
Yes, that will work with no load. But it may take a long time for the output to drop below the digital HIGH threshold when it goes off. (Minutes, possibly.) Add a 1k ohm or 100 ohm load resistor.
Will such a CT detect the tiny current that's needed for an Arduino to operate? Shouldn't be more than a few mA (most of which will be leakage of the adapter)