# Confused on how offset works with a 30A -> 1V CT

Hello.

I have a sct-013-030 hooked up to a MCP3008 10 bit ADC and using emonlib to get Irms.

I have a reference voltage going into the MCP3008 at ~1V. I believe this should cause my readings of 0 - 1024 to be AC currents of 0-30 A essentially giving me a resolution of .02929 A.

If I set the offset to start at 512 I get very high values. If I start the offset at 0 I get values which make sense. I have my DMM hooked across the sensor to see how close I am getting to the correct “vin”.

So my question is why does having the offset such as it is in the library cause my values to be so off? Because my sensor is 0-1V and my ADC is 0-1V should I not need an offset?

Thank you.

How have you configured your MCP3008, and how are you biassing the input?

I think you might have a second problem here, if I understand you correctly.
You have a MCP3008. It expects an input over the range 0 V to 1.0 V.
Also you have a SCT-013-030. This gives you a 1 V rms a.c. output. That means the output swings, for a sine wave input current (which we have to assume you have, and which will be more or less true for large resistive loads like water heaters), from - 1.414 V to + 1.414 V.

It would seem to me that you are in danger of overloading your input a long time before you reach 30 A,

The direct answer to why the offset is in the library is explained in Learn. It’s necessary, with the Arduino / Atmel 328P input design, to bias the input to Vcc ÷ 2, and the offset in emonLib initialises the software offset so that there is not a sudden step when the sketch starts up. The software offset will self-adjust over time to exactly match the voltage offset applied to the input signal.

If you’re doing something different with your MCP3008 and its input, then that probably explains why it doesn’t work for you.

Okay let me clarify - I am trying to read 120 V 60 Hz AC current from the wall into an arbitrary load.

I have the MCP setup for single ended mode and I’m only reading channel 0. My CT positive goes into channel 0 and the ground goes into arduino ground (which the MCP is also connected to via it’s AGND and DGND pins).

I did notice a problem with my code in that my offsetI wasn’t global, so it would always reset. I’m going to see how the performance changes with that.

I see the problem you have highlighted about the voltage. So I’m only going to be sampling 70% of the positive side of the sine? I’m not sure how I can expand this range - especially into the negative?