I am creating a wireless Energy Meter using XBee Radio and SCT-013-030 sensor. The problem I experience is that the sensor always gives me 0V - no matter on what cable i put it on. I have it connected on 1 cable only (i've opened the power cord, so that I have access to separate cables). My meter looks like this:
SCT-013-030 should give me 0-1V DC at the output. Analog input of XBee radio reads a range from 0V to 1.2V, so there should be no problem in reading the value, but it is still 0V. Am I doing something wrong or the sensor is broken?
Many thanks in advance for your help.
Re: SCT-013-030 always 0V
Your CT will only give a 1V signal when it is clipped around a wire that is carrying 30A. At 230 V AC, that's a lot of power (~ 7.5 kW). When a smaller current is flowing, the CT will still generate a usable output signal but its amplitude will be correspondingly smaller.
Between the CT and the processor, there needs to be an interface circuit as explained here:
http://openenergymonitor.org/emon/buildingblocks/ct-sensors-interface
Re: SCT-013-030 always 0V
"SCT-013-030 should give me 0-1V DC at the output."
No, it should not, and it will not. It will give you 1 V a.c. for 30 A a.c. primary current. Transformers work on magnetic induction and that requires something to be continuously changing. They do not work on direct currents and voltages.
You cannot connect the radio directly to the C.T. output like that. The easy, but inaccurate, way is to rectify and average the C.T. output and feed that to the radio. Then, after applying the correct scaling factor, it will read the rectified average current, which is what budget multimeters read - but they are calibrated to indicate rms on the assumption that the waveform is a true sinusoid.
But you will need to use a 'perfect rectifier'. (Google it!)
[ Robin: the data sheet says "configuring the modem to sample at rates greater than once every 20ms is not recommended" - so precious little chance of getting the 50 Hz mains through that ADC!]
Re: SCT-013-030 always 0V
Thanks for your help. From the link I got from you I calculated that in order to obtain max. 1.2V (which is the max. value for XBee Radio) I would need two resistors - 470kOhm as R1 and 2.2MOhm as R2. Am I right? Which capacitor should I use as C1?
Re: SCT-013-030 always 0V
I think Robin (calypso_rae) didn't know about the maximum sample rate: "configuring the modem to sample at rates greater than once every 20ms is not recommended".
You can do as he suggested, but it still won't work - at least, not in the way that I think you are expecting. Take a look at "precision rectifier" (sorry, I had forgotten what Google called it) circuits, because you'll need to put the bias circuit and that in between your CT output and the XBee before it stands a chance of working. You'll need to be careful and adjust the bias resistors and the rectifier gain together in order to get the correct zero and scale factor.
Re: SCT-013-030 always 0V
I've read a little bit about precision rectifier and I understand the main idea of the circuit, but have no idea which particular circuit would best suit my needs (I've found at least a few implementations of precision rectifier which seem to do exaclty the same thing) and how to adjust the resistors. Moreover, even if I would learn more about precision rectifier, didn't you suggest in your last post that this solution may still not work correctly?
Having said that, what do you think of using 3.3V version of Arduino Trinket as a "bridge" between the sensor and the XBee radio? It seems that I could connect the sensor to Trinket using calypso_rae's solution and then send the data from Trinket to XBee easily.
What would you suggest me to do?
Re: SCT-013-030 always 0V
Back to basics.
The emonTx works by sampling the current at the rate of about 2500 times per second. That's about 50 samples for each cycle of mains. It needs the input to the ADC to be in the range 0 - 3.3 V so the bias circuit (explained in Building Blocks) is used to "condition" - add an offset to - the input voltage that the ADC measures. That offset is later removed in the software. The software then calculates the rms average current and sends it as a number via the radio.
Your XBee, according to the data sheet, can only measure one sample every 20 ms. That is one sample, not 50, every mains cycle. That won't work, so you need to do it another way. That is why I suggested a rectifier circuit. That does in hardware what the sketch does in software.
What you really need to do is understand the problems you are facing, and decide how those are best solved by what is available:
1. The input normally accepts 0 - 3.3 V or 0 - 5 V, but your CT gives you -1.5 V – +1.5 V (roughly).
2. The input oscillates at 50 Hz, you must sample it at least 10 times faster than that to calculate the average in the way that the emonTx does.
3. If you cannot do that, you must use electronics to rectify the signal and produce an unchanging (or slowly changing) d.c. signal that your input can handle.
I don't know the Arduino Trinket, but it might do what you need, which is roughly the same as a one-channel emonTx! I think if you look at the emonTx V3.2 (data on GitHub & the Wiki), that might give you some guidance on how to go about it. You could even make a one-channel emonTx with an ATmega 329P and a few external components, using the emonTx V3.2 circuit as your guide.
If you do use the Trinket, then you must condition the input, sample it and calculate the rms value, then ideally you send the resulting number to the XBee via the serial data bus. If you can't do that, you could try sending it to a PWM output and then reading it via the XBee's analogue input, but that is a very messy way to do it.