Current Sensor Utility line

I'm looking to build a simple current sensor. I don't need to actually see how much current is flowing through the line but rather if its flowing. I'm looking to put it on one of the utlity legs coming into my house. When the power comes back on the device would sense and light something up or send a message.

Help getting started....

1. I have a 200amp service, do I need a current sensor rated for 200amp if all I want to do is know if there is power on the line?

2. Which current sensor would work best to interface with an arduino?

I think at first I'll just right the code to light a led or something when voltage is detected. Possibly move to sending a message or email when it's detected.

Thanks for the help!

Robert Wall's picture

Re: Current Sensor Utility line

Do you want to detect the presence of voltage, or the fact that current is being drawn? These are two entirely different things. You can have a voltage and draw no current, but not vice versa.

If you want an indication of current, it's a rather tricky problem because as you suggest, whatever you install will need to detect the smallest useful load - say 10 W or 40 mA, whilst being able to withstand 200 A. I would suggest a 200 A split core current transformer, but with a non-linear burden, say 4.7 V zener diodes. This arrangement would give you essentially a square wave of constant amplitude for a wide range of current, but what the minimum is that you could detect would be hard to predict. This voltage would need to be rectified and fed into a digital input of the processor.

If all you are interested in is an indication of the presence of a voltage, the situation is somewhat simpler. If you want a non-contact method, I would suggest a capacitive pickup - nothing more than a length of well-insulated wire wrapped around the outside of the incoming line conductor, feeding into an operational amplifier, the rectified output of which will drive a digital input of the processor.  If you are prepared to make a connection to the electricity supply (and you have the knowledge and experience to do it safely and your local regulations allow it), then you could do something as simple as connect a neon lamp and detect the light output with a photo-resistor, which would be very simple.

There's a possible third way: do you have a meter provided by your electricity supplier that is capable of indicating what you want to know? If so, detecting that - a rotating disk or a flashing LED, might be easier.

I can't really take this any further without knowing a bit more about what you are prepared to build.

rc3477's picture

Re: Current Sensor Utility line

Thanks for the response. What I'm looking for is just to see the presence of voltage. The main breaker would be off in this situation so there shouldn't be current flowing right? I just need to be notified when that line is "hot" so to speak. Tapping into the line is definitely something I don't want to get into, something non invasive is what I'm aiming for. I was looking into possibly something like a voltage tester for outlets. I'm not entirely sure of the tech behind it, but its a non contact sensor and beeps when its comes near a line that is hot. This would obviously be stationary though.

Thanks again

Robert Wall's picture

Re: Current Sensor Utility line

You obviously need to get at the supply cable upstream of your main breaker if you want to detect that a supply is available. What I'm suggesting depends on there being separate line and neutral conductors.

I've never taken a voltage tester apart (I wouldn't own one - I prefer to rely for my safety on something a lot simpler that doesn't depend on batteries, a neon screwdriver!) but the operating principle has to be similar to my non-contact voltage method.

I'll try an experiment in the next day or two to see if the analogue input of the processor itself is sensitive enough to pick up a reliable voltage without any additional electronics - it's worth a try.

Robert Wall's picture

Re: Current Sensor Utility line

I'll try an experiment in the next day or two to see if the analogue input of the processor itself is sensitive enough to pick up a reliable voltage without any additional electronics - it's worth a try.

Using a spare analogue input on an emonTx, I wrote a quick sketch to read the input 200 times and record the max and min count. With no connection, the swing (max - min) was fairly consistently in the 250-300 region. With a length of wire held onto the input pin, the swing was consistently 1023. That was working just on pickup. The experiment was rudimentary to say the least, and further experimentation is clearly needed. But it seems that the principle is sound.

Just one thought: this is all going to be battery powered, isn't it?

rc3477's picture

Re: Current Sensor Utility line

Yes most likely battery powered. Running off of a car battery, it would only be turned on once the utility power goes out. Something like this is what I'm aiming for http://www.nooutage.com/thp108.htm which is no longer made due to not being loud enough. Or like this http://measure-current.com/ 

Robert Wall's picture

Re: Current Sensor Utility line

What you are looking at there are two totally different concepts. http://measure-current.com/ is a Hall effect current transducer, sensing the magnetic field arising from flowing current and carrying out the same function as a current transformer, and it measures current.  As you rightly point out, with your incoming breaker open, it will read nothing irrespective of whether the supply is present or not. It will read current when you close the breaker and start to draw a load - by which time you know the supply is on because things will start to work!

The first device http://www.nooutage.com/thp108.htm is much more like what I think you want and what I described, with an insulated wire picking up the electric field that will be present when the main conductor is energised, whether or not a current is flowing.

rc3477's picture

Re: Current Sensor Utility line

I realized that after posting lol thanks for clarifying though. I'm new to monitoring these types of things. The first device is definitely what I'm looking for though. I only need to know if there is power there not whether current is flowing.

jstoaks's picture

Re: Current Sensor Utility line

I believe you could simply use a 5Vdc wall wart to supply a 5v input, If the pin input is high = Voltage present. If low = No Voltage present.

OR

Use a Normally open-high coil voltage relay or contactor. I dont know what power system you use. But say a 110 volt relay energized from the 110 volt closing the switched circuit supplying 3.3v or 5v to the input and signaling a TRUE condition

Thinking more of a electro/mechanical logic function.

rc3477's picture

Re: Current Sensor Utility line

The main breaker would be off when this device is on. So plugging something into an outlet wouldn't work. The sensor would have to be on one of the utility legs coming into the panel before the main breaker.

jstoaks's picture

Re: Current Sensor Utility line

I'm not sure why the main breaker would be off, in your first post you stated ..

"I'm looking to put it on one of the utlity legs coming into my house. When the power comes back on the device would sense and light something up or send a message."

When you say "when the power comes back on - send a message"

 

Sorry if I misunderstood, But it seemed to me you wanted to indicate a TRUE condition statement.

 

best regards

 

J

Robert Wall's picture

Re: Current Sensor Utility line

jstoaks 

In his post of Thu, 01/11/2012 - 20:14, rc3477 clearly stated that the main breaker would be off and he required a non-contact means of sensing.  Please read all the thread before you confuse the issue. The main breaker may be off for a number of very good reasons. The one that readily springs to mind is because he has a backup supply (just like a PV installation) that cannot  be allowed to backfeed into the mains.

I agree that a relay or contactor connected on the incoming side of the main breaker would be much simpler and probably more reliable, there are however obvious safety and possibly regulatory requirements that are likely to make that a non-viable option.

rc3477's picture

Re: Current Sensor Utility line

thanks for clearing that up robert thats exactly the case. I have an arduino that I'm not currently using so I might try what you had done as your test. Could you send me that sketch you created? Also did you use any specific type of wire on the analog input ?

Robert Wall's picture

Re: Current Sensor Utility line

You're in luck - I hadn't thrown it away!

//Set input pins
int inPin5 = 4;
int inPin6 = 5;

int max5, max6;
int min5, min6;

int adc;

void setup(void)
{
    Serial.begin(115200);
}

void loop(void)
{
    min5 = 1024;
    max5 = 0;
    min6 = 1024;
    max6 = 0;

    for (int n = 0; n<200; n++)
    {
        adc = analogRead(inPin5);
        if (max5 < adc)
            max5 = adc;
        if (min5 > adc)
            min5 = adc;
            
        adc = analogRead(inPin6);
        if (max6 < adc)
            max6 = adc;
        if (min6 > adc)
            min6 = adc;
    }
    Serial.print(max5 - min5); Serial.print(" ");Serial.print(max6 - min6); 
    delay(1000);
}    

The wire was actually a multimeter test lead without the multimeter on the end.  You should use wire insulated to at least the peak value of your mains - you'll probably use ordinary 600 V equipment wire, and you must make sure there's no conductor sticking out at the end that could contact the live line. My laptop supply is unearthed and floats at around 80 V, it was picking up the field from that. You need to get the Arduino quite close (under 1m) and you should use the minimum length wrapped around the incoming line (not neutral) cable consistent with it working, because you are relying on the built-in protection diodes in the chip to prevent damage to the input (although realistically you will never get enough current to overload them with just a few turns wrapped around the cable - unless you suffer a lightning strike).

I was using a standard emonTx (cct diagram is available elsewhere on this site) and the free analogue inputs are 4 & 5 (zero-based). You only need one of them, of course. All that sketch does is show the swing on the input every second. If your Arduino is battery powered, to extend the battery life you might want to copy the emonTx code where it sleeps between readings, thus minimising current drain. Then of course you need to detect a swing greater than an appropriate threshold (which you will need to determine when you get it into position with your 'aerial') and drive an output to do something useful. Looking at your profile, I assume you're happy with coding that.

 

rc3477's picture

Re: Current Sensor Utility line

very cool !! thanks for the help, when I get this up and running I'll post back.

rc3477's picture

Re: Current Sensor Utility line

Ok so here we have my implemented code. It's still rough but it works pretty well. I'll be testing a few different "calibration" methods I have found, one actually on the arduino.cc site using a five second calibration period on boot up. The code writes the sensorvalue to the lcd screen, helpful for trying to pin point the value at which you want the on or off leds to fire up when its not plugged into a laptop. sensor value changes when running off of usb vs. battery pack or wall wart. I checked the values while in its permanent location and enclosure before setting it.

 

 


//inclue lcdLibrary
#include

//intialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

//set input pin

int sensorPin = A4;

int ledPowerOn = 3;
int ledPowerOff = 2;

int sensorMax;
int sensorMin;
int sensorValue;

void setup(void) {

//set up the LCD
lcd.begin(16, 2);

//Serial.begin(9600);
//set ledPin as an output
pinMode(ledPowerOff, OUTPUT);
pinMode(ledPowerOn, OUTPUT);
}

void loop(void) {

sensorMin = 1023;
sensorMax = 0;
sensorValue = 0;

for (int n = 0; n<200; n++)
{
sensorValue = analogRead(sensorPin);
if (sensorMax < sensorValue)
sensorMax = sensorValue;
if (sensorMin > sensorValue)
sensorMin = sensorValue;

}

if (sensorMax - sensorMin < 100)
{
digitalWrite(ledPowerOff, HIGH);
digitalWrite(ledPowerOn, LOW);

//write to lcd
lcd.clear();
lcd.print(sensorMax - sensorMin);

//Serial.print(max5 - min5);
//Serial.print(" ");
delay(1000);
}
else
{
digitalWrite(ledPowerOn, HIGH);
digitalWrite(ledPowerOff, LOW);

//write to lcd
lcd.clear();
lcd.print(sensorMax - sensorMin);

//Serial.print(max5 - min5);
//Serial.print(" ");
delay(1000);
}
}

Robert Wall's picture

Re: Current Sensor Utility line

Congratulations, well done.

rc3477's picture

Re: Current Sensor Utility line

thanks rob, couldn't have done it without you. I've ordered up a 100db piezo buzzer, the dog should love that hah.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.