This was originally posted on a thread about a specific Hall effect sensor. Hence much of what is in posts 2 - 5 is not relevant to a wound current transformer, as used here. [RW]
Robert,
I found this post, which was exactly what I was looking for. From what I can understand from your post here, adding a 50 kΩ resistor from the analog pins on the Arduino to GND will provide a “pull down” to GND when the split-core transducer is unplugged? When I add this, should I expect to see a solid zero value then for any calls to calcIrms()?
Are their any other implications of doing this? For example would I expect this might impact my calibration values, or anything else like that?
I’m experimenting with the library, and did notice that if I unplug one of my split-core devices I begin to get some random high values. I’m looking for a way to better handle such disconnects, or to be able to detect that the disconnect occurred.
If you’re using the same sensor, then yes, that should work. You’ll need to detect that (in emonLibCM, anything less than 5 counts is classed as an unplugged sensor) skip all the processing and simply assign a zero value to the current. If you don’t skip all the processing, the digital filter will follow the input down to zero counts, and you’ll have a big step then and when you plug it back in, each of which will give you a wrong large current that takes some time to die away.
That might well be the digital filter trying to find the “average” bias voltage to remove it.
Can you explain what you mean by “anything less than 5 counts”? Counts of what? And via what API would I see or specify this?
In my current testing, on US 120vac systems, I’m seeing the following values when there is “no load” on the circuit. I’m running on a 3.3v 8Mhz Arduino Pro-Mini. I’m printing the values from the example code:
Channel 0 - YHDC SCT-013-000 (18.2Ω Burden, current constant: 109.89): 1.05 0.01
Channel 1 - YHDC SCT-013-000 (18.2Ω Burden, current constant: 109.89): 31.49 0.26 - I’m now convinced this is a bad solder joint or something in my work.
Channel 2 - YHDC SCT-013-030 (No Burden, current constant: 30): 4.26 0.04
Channel 3 - YHDC SCT-013-030 (No Burden, current constant: 30): 5.22 0.04
If I unplug one of the YHDC SCT-013-030 then I see: 1044.31 8.70
If I unplug one of the YHDC SCT-013-000 I do not see the same jump … and am not sure why.
This is the value that I was wondering would be more correct by adding the pull-down resistor to GND.
Are you really talking about conventional current transformers, and NOT Hall effect transducers? Because there’s a huge difference between the two. The SCT-013-xxx series is a wound current transformer, not a Hall effect device.
When I was searching the forums, it hit on the word “unplugged” and took me to the post that looked like a similar schematic. I had included the SCT-013-030 in my search, but failed to notice that this thread was not about that type.
You are correct … I’m talking about the SCT-013-xxx series. Is there a way to fork the thread? Or how would you like me to proceed?
I’ve done that now!
First, a caveat: I’m talking exclusively about single-ended ADCs, i.e. those that can only accept unipolar positive voltages. These are by far the most common sort.
The way an unplugged sensor is detected in the emonTx & emonPi is by using one of the “inner” contacts inside the socket, and grounding the input when there’s no plug present. (Note this detects the absence of a plug, not an open-circuit c.t.). But the action of inserting and removing the plug puts a half-voltage step onto the input, which appears as a large current.
If you want a short-circuit on the input (which you can’t detect in software), then you could arrange the switching contacts inside the socket to do that - but frankly, it will only help with your voltage-output c.t’s, because the on-board burden for the current-output c.t’s is close enough to a short circuit anyway. In the absence of a burden resistor, then it’s quite possible for the input to float off to some indeterminate voltage, and pick up any noise around. You could reduce the effect of that by adding a high value resistor across the c.t’s output - ‘high’ in this context being in relation to the internal burden of the c.t., which I think is about 68 Ω. It will affect calibration, so I wouldn’t go below 6.8 kΩ as that will decrease the reading by about 1%. (But you can recover that by calibration anyway.)
There’s nothing in emonLib to detect a short to ground - it’s done in the standard sketch and only at start-up - if you unplug or plug in the c.t. while it’s running, it shows a big spike of current. In emonLibCM, the test is done on every sample and it’s handled by the library, and there’s no provision to change it.