Shop OBEX P1 Docs P2 Docs Learn Events
AC current sensors — Parallax Forums

AC current sensors

JonathanJonathan Posts: 1,023
edited 2014-05-25 08:43 in Accessories
Hi All,

I have been working on a smart, off grid water system controller. I have the classic rural system, well pump, storage tank and pressure pump.

So far it can track gallons used and uses an ultrasonic transducer for determining depth of water in the tank. It senses the system pressure and turns the pressure pump on and off, instead of the usual diaphram pressure switch. If it senses a fault, such as low tank water, pressure pump cycling too long or too often it can shut everything down. This is good for me because a burst hose while I am away could result in running my batteries flat. And for off-gridders, the battery bank is King.

Anyhoo, I want to add current sensing of the pressure pump. In theory if the pump is dry it should use less current. So I can watch for that. Also, I could make a profile and then watch for changes. I've done a lot of DC current sensing but AC is tougher. There are a lot of offering out there and I'm wondering if anyone has any recomendations.

Needs:

Cheap, 20 bux US would be nice.
20 Amps
RMS?

Thanks!

JOnathan

Comments

  • kwinnkwinn Posts: 8,697
    edited 2014-04-17 21:16
    A current transformer and an adc chip could handle that. Another approach would be to measure the rpm of the motor. It will be higher when the pump is dry.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-04-18 07:28
    I'm working on exactly the same project at the moment. Ok, let's see if we can get this under $20.

    Search on ebay for current transformer 20A

    I'm getting some of these ones http://www.ebay.com.au/itm/0-20A-Input-Precision-Current-Transformer-TA17L-04-Red-/301122015370?pt=AU_B_I_Electrical_Test_Equipment&hash=item461c45508a

    300R sampling resistor, 10mA and 3V output. That works out well because that may not need any preamplifying.

    Next need a half wave rectifier. There are op amp circuits around that use two diodes, and because these are part of the op amp circuit, the forward voltage of the diode is removed. Google op amp half wave rectifier
    and images.

    eg http://sound.westhost.com/appnotes/an001.htm

    I'm also looking at some of my op amp cookbooks. There is a circuit whit a 10k resistor, two signal diodes, a 22k resistor and a 1uF capacitor. This gives you the gain to correct for RMS, rectifying and filtering all with one op amp.

    Then a second op amp as a comparator with a pot on the input to set the threshold.

    Only problem with these circuits is they assume a split supply. For single supply circuits, need a virtual earth. LM324 quad op amp with a 5V supply can't go rail to rail, but you can set the virtual earth at 2.5V with one op amp as a voltage follower. Then use this reference for other circuits. So you could connect one half of the current transformer to this 2.5V reference and it then swings max 2.5V +/- 3V. Need reduce that to +/-1V so goes 1.5V to 3.5V as this is the maximum rail to rail the 324 can go. So maybe that is a different load resistor, or maybe divide the output from the load resistor by 3 with a voltage divider. And maybe don't need to do the RMS gain.

    I am looking for the simplest circuit to get this data into a PC. I think it is going to be a cheap USB to serial cable for $2, a picaxe chip for $4, a max3232 for $1, a LM324 for 30c, and a current transformer, plus resistors and capacitors and diodes. Should come in under $20.

    Might be worth using CA3140 rail to rail op amps - then the final DC output can be 0 to 5V and that uses the full voltage range of the picaxe - hence better resolution.

    I'm building this for smarter solar power. If the sun is shining and making more than a pump would use, turn on the pump. If enough power for a second pump, turn that on too. But add some other rules too eg if a cloud goes over every few minutes, don't turn the pumps on and off all the time. Wait for 5 mins of steady sunshine. Excess power charges batteries and/or runs other loads that don't care so much about the timing, eg pool pump. Maybe really smart load control - eg buy a 1kw, 2kw, 4kw and 8kw pump, and then you can switch these in a binary fashion to get from 0 to 15kw in 1kw steps.

    I'll ponder this some more. The $20 challenge is a good one!
  • JonathanJonathan Posts: 1,023
    edited 2014-04-18 08:04
    RPM is an interesting idea. Hard to do if I want to add the well pump though, lotta wire. I was hoping for a SS solution. Dr. Acula, I will order a couple of the same current xfrmrs and then maybe we can play together. I'm shooting for 1 amp resolution on a 10 bit ADC. Although I may end up with a 12 bit, I'm trying to do this on the humblest equipment possible. A plumber friend of mine wants to build several.

    Jonathan
  • RforbesRforbes Posts: 281
    edited 2014-04-18 10:37
    I'd recommend a paddle type flow switch for this requirement instead of using current sensing. Your current will always fluctuate, especially on start up. Also, a locked rotor draws current, so sensing current doesn't "prove" anything. Since you are looking for a proving switch the flow switch would be more reliable. Just a thought!
  • JonathanJonathan Posts: 1,023
    edited 2014-04-18 11:00
    My plan was to ignore start up current by waiting for a couple of seconds after the pump starts to allow it to settle down. I am hoping to create a profile by logging the draw a few times that could then be used to see problems with the motor before they become big problems, as well as to detect if the pump is running dry. Make a learn mode that runs the first few times the p[ump is run after installation.

    I actually already can pretty much tell if it's dry, as the system pressure will fall and the controller is aware of (and controlling the pump) pressure.

    Thanks!

    Jonathan
  • RforbesRforbes Posts: 281
    edited 2014-04-18 11:12
    Jonathan- Right on. Sounds like you'll have it whooped in no time! I don't have a good source selection readily available for ac current sensors or transformers, other than perhaps something from this place : http://www.crmagnetics.com/
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-04-18 16:06
    Re paddle switches, I have used those. One issue is you need to disable the paddle switch for the first few seconds while the flow starts, otherwise it shuts itself down straight away. So it needs a delay circuit. All possible but it is extra components. There may be an argument for both a flow switch and current monitoring.

    Do you want to output to a PC? Or do you want it to close a relay if there is a fault?

    I've been pondering making a PC connection even simpler. USB to serial adapters are only a couple of dollars. There might be a circuit that removes the need for a picaxe or microcontroller, and even removes the need for a power supply.

    Re the supply, take one of the control lines eg pin 7, and toggle it in software. Use two capacitors and two diodes and if it toggles -9 to +9V say once a second, that can give us a dual rail power supply.

    Then use a low current quad op amp maybe a TL084 or something. Use a standard precision rectifier circuit to create a DC voltage proportional to current. Then use another op amp circuit to create a triangle waveform, and compare with the voltage. The waveform can be slow eg a few seconds. Feed that into a comparator and then into an input control pin eg pin 8 request to send. In software measure the duty cycle of this pin.

    It *might* be possible to do this with one chip costing 40c, and a few resistors and capacitors.

    Disadvantage - need a little program on a PC to control and read the RS232 lines.
    Advantage - no need to be programming microcontrollers.


    addit - rummaging around the internet trying to find the cheapest way to get analog data into a PC

    found this http://numato.com/8-channel-usb-gpio-module
  • kwinnkwinn Posts: 8,697
    edited 2014-04-20 17:29
    Trying to do this type of monitoring without using a micro could be....trying. Jonathan wants to monitor the current to two pumps so that means an ADC to control and receive measurements from, and there are also other sensors as well. Better IMHO to have a microcontroller dedicated to monitoring all the well system sensors (motor currents, storage tank level, pressure, etc.) and send all the data over one connection. The propeller and an MCP3208 are ideal for this, and could also control the pumps using some relays.
    Dr_Acula wrote: »
    Re paddle switches, I have used those. One issue is you need to disable the paddle switch for the first few seconds while the flow starts, otherwise it shuts itself down straight away. So it needs a delay circuit. All possible but it is extra components. There may be an argument for both a flow switch and current monitoring.

    Do you want to output to a PC? Or do you want it to close a relay if there is a fault?

    I've been pondering making a PC connection even simpler. USB to serial adapters are only a couple of dollars. There might be a circuit that removes the need for a picaxe or microcontroller, and even removes the need for a power supply.

    Re the supply, take one of the control lines eg pin 7, and toggle it in software. Use two capacitors and two diodes and if it toggles -9 to +9V say once a second, that can give us a dual rail power supply.

    Then use a low current quad op amp maybe a TL084 or something. Use a standard precision rectifier circuit to create a DC voltage proportional to current. Then use another op amp circuit to create a triangle waveform, and compare with the voltage. The waveform can be slow eg a few seconds. Feed that into a comparator and then into an input control pin eg pin 8 request to send. In software measure the duty cycle of this pin.

    It *might* be possible to do this with one chip costing 40c, and a few resistors and capacitors.

    Disadvantage - need a little program on a PC to control and read the RS232 lines.
    Advantage - no need to be programming microcontrollers.


    addit - rummaging around the internet trying to find the cheapest way to get analog data into a PC

    found this http://numato.com/8-channel-usb-gpio-module
  • kwinnkwinn Posts: 8,697
    edited 2014-04-20 17:38
    BTW Jonathan, since you are running off the grid and want to measure AC current I presume you are using one or more inverters. If the pumps have their own inverters it may be simpler to measure the DC current going in to the inverters. Even if both pumps run off one inverter you could measure the current of each pump by turning them on in sequence and measuring the current change.
  • JonathanJonathan Posts: 1,023
    edited 2014-05-15 08:20
    )k, got some 3000:1 current transformers.

    Dr, I want to convert the signal to use with a 10 bit ADC. I see quite a few circuits out there, most relatively complex. Ultimate accuracy isn't my goal, what I want to do is to characterize the pump's current draw, then watch for changes. The objective being to distinguish between a dry and wet pump and perhaps be able to alert pump problems. So if I can, I'd rather find a simple and low part count solution.

    Thanks!

    JOnathan
  • kwinnkwinn Posts: 8,697
    edited 2014-05-15 18:57
    If you have a fast enough ADC ( 1000 samples/sec or more) then you can put one side of the current transformer on the center of a resistor divider and the other on the input to the adc (through a resistor) and take several samples over the AC cycle. This will allow you to calculate the rms current. Trading circuit simplicity for software complexity.
  • G McMurryG McMurry Posts: 134
    edited 2014-05-24 23:08
    I just finished doing an AC current sensor for one of my hobby projects. I am using an ADC0834 and a BS2P24. The device I purchased works well from 0 - 15 Amps. This is mostly because the sensor I have only goes that far. It would be easy to use the same idea with a different device.

    I am using the Octopus Sensor I got from EBAY for $8

    Octopus Current Sensor.jpg


    http://www.ebay.com/itm/AC-TA12-100-Current-Sensor-Module-for-Arduino-/131013399404?pt=LH_DefaultDomain_0&hash=item1e8101d36c

    BTW - When looking for devices, search for Current Sensor for the best results.

    I used a schottky diode, a 25UF Cap and a 10K Resistor. Feed the output of the sensor through the diode, charge the cap, use the 10k to discharge the cap. Feed the results into the ADC. Smooths out the pulsing well. My ADC is 8 bit 0-5 VDC. I multiply the output by 6/100 (I think) in PBasic and I have a pretty good current sensor. I actually can have 4 of them. The ADC has 4 inputs.

    Current Sensor.jpg


    I am sure I can improve the circuit and the software, but it is working well now. I am not sure I need anything better. I may move on to another project.

    I would like to upgrade to something that will do 25 amps. I may try one of these..

    Clamp On Current Sensor 0-30A.jpg


    http://www.ebay.com/itm/Non-invasive-Split-Core-Current-Transformer-AC-current-sensor-30A-SCT-013-030-/281150975569?pt=LH_DefaultDomain_0&hash=item4175e76e51

    Pretty nice package for under $10. Its a nice clamp on device 0-30 Amps.

    I'll make a little video in a few days and post it here.

    Greg
    332 x 249 - 27K
    719 x 279 - 28K
  • JonathanJonathan Posts: 1,023
    edited 2014-05-25 08:26
    Greg, what about linearity? I got a 3000:1 current transformer and I am seeing some very non-linear readings. I've tried a few circuits. I'm playing with both inductive and resistive loads. My heat gun in particular messes with things, I think it uses a triac for low setting, at least I see an ugly chopped wave form. How about you, linear or not?

    Jonathan
  • G McMurryG McMurry Posts: 134
    edited 2014-05-25 08:43
    I spot checked by plugging in my two setting heat gun. 5A and 10A seemed to track when compared to my "expensive" Tektronix Amp Probe. For me, I think that is fine. I could check it more, but I don't have any other variable load I can use for testing.

    The Octopus has a built in load resistor. Not sure about the clamp on device.

    The Octopus also has a +5 pin. I hooked up to it, but I sort of think it doesn't do anything.

    One other test I wanted to try was to use RCTime to read the signal. My current project already had the ADC installed. I would try adding this to my schematic above.

    681 kohm 470 ohm
    Vx ----/\/\/\---o
    /\/\/\----P0 to stamp
    unknown |
    voltage ===== 0.01 uF film
    |
    Vss

    Of course this gets hooked up to the output of my other schematic.

    Greg
Sign In or Register to comment.