On Off current sensing of mains - Page 1
Forum section: electronics / projects

author: bearman
author_rank: Regular Contributor
timestamp: August 23, 2011, 08:47:01 am
content: I have a situation where a friend of mine wants to monitor how long his well pump is running. We originally were going to mount a pilot light of some kind in parrallel to the pump motor and he would monitor it through a window from inside his home on ocassion. He wants to time the motor run cycle to see if it is running for too long a period of time. Too long means the pumps seals or motor is starting to degrade.I thought of automating this with a mico and moving the monitor into the house. My thought was to manufacture a simple current transformer type device with a toroid ferrite core with some windings on it to give an indication of current flow or no current flow. The current tranformer would have the hot lead run through it inside of the circuit breaker panel for the pump that has its own dedicated breaker. I would then integrate the current transformer to a micro to time and ouput some info so he could read it any time and it would give him some instant stats for normal run times during the day. This way he wouldn't have to baby sit the monitor and wait for it to turn on and off or run the water to force a run cycle to monitor it when he wanted. I really don't need a fancy calibrated current transformer for this and want to make something for this non critical application. I have ferrite toroids and enamaled winding wire on hand.YAH I now I am being cheap but that is part of the fun of being a maker isn't it? I guess I could hunt around ebay and get a factory made CT or a cheap amp clamp meter and butcher it for the clamp assembly.Does anyone have some experience in current transformer technology? Could I use a ferrite toroid with several turns of wire to output a reasonable signal that I could condition before feeding the micro? Would iron core be better than ferrite for this? Does anyone have a better idea for monitoring when the power is on without a physical connection to the mains? Any feedback would be greatly appreciated.B

author: Psi
author_rank: Super Contributor
timestamp: August 23, 2011, 10:29:18 am
content: yes, i've done exactly this. (DIY current transformer for monitoring AC mains)I built mine as a system to monitor the current of every multiboard at a gaming lan.We wanted to track power usage of everyones PC's. Just because we thought it might be fun, so we built a system with a DIY CT in every multiboard and cabled them to AVRs in lots of 10 (10 adc channels per AVR). All the AVRs linked together over differential SPI and to a PC to display the power usage per multiboard and total usage for the event.For the CT's i used 2.7 meters of thin enameled wire wound around a 12mm toroid.I didn't want to count the number of turns on each toroid as i wound them so i always used cut lengths of 2.7M of wire instead. I'm not sure exactly how many turns 2.7meters is, but it's a fair number ~200.You need lots of turns for a CT to work. This next bit is wrong but.. think of it as a transformer and the voltage into the primary is the voltage drop across the short length of mains cable that passes through the CT. It's such a small voltage you need lots of turns on the secondary to get a good voltage output.However, you probably wont need quite as many turns as i did if you just want to detect on/off.The CTs i made were able to detect current with around 200-400mA accuracy between 0-7A.Because the cores i used weren't designed for mains frequency the waveform got more distorted the more current there was. The waveform distortion was quite predictable so i was able to plot the values on a graph and work out an equation that more or less gave a reasonably accurate current reading from the CT voltage. The higher the current got the less of a change was seen in CT voltage so above ~7A the accuracy fell away quickly but it was still usable for what we designed it for.Here's a pic the toroids i used on the left.The right is one of the finished modules, A CT + load resistor + bypass cap + transistor amplifier.I dipped the toroids in liquid insulation tape to seal them up and stop them unwinding.Once you have your CT wound you need to put them across a load resistor.With mine it was 1Ohm. This gave me around +/- 50mV across the 1R with 10A going through the CT.A high value resistor will give you more voltage but i found the output was horrible above around 10R.1R seemed to give the best waveform.I used a single transistor with bypass capacitor to take the voltage across the CT load resistor and amplify it up to something a bit more usable. The output was now 12V +/- 2V (2V=10A). I then feed this through another bypass capacitor onto an ATMEGA ADC input. The input had a 10K resistor to GND and another to 5V VCC so it was at 2.5V with no current and moved up or down by 2V to represent the AC current signal from the CT.I rectified the AC current signal in software to save me having to make a external precision rectifier from opamps for every CT i had.It was much cheaperand rectifying a signal in software is so much easierHere's the circuit i used.I think the component values are still correct, they look to be the same values as i used.

author: ciccio
author_rank: Frequent Contributor
timestamp: August 23, 2011, 07:57:08 pm
content: Excuse me, maybe I did not understand what your friend needs, but if he only wants to know how many hours the pump is operating, you can easily accomplish this task with:1) an hour counter, very low cost, such this onehttp://it.rs-online.com/web/p/contatori/0260707/(Rs has some other, even cheaper), wired in parallel to the motor,or2) a simple ac relay with 240 V ac coil in parallel with the pump's motor.such as thishttp://it.rs-online.com/web/p/rele-elettromeccanici/6802650/and use it's insulated contact as input to any counting system (there are lot of them in the market or you can program anything programmable to accomplish the task...)I truly do not understand the need to measure ac current in the motor...If there is a problem the motor will run for more time than the usual time.If you cannot connect in parallel to the motor's windings (maybe you have access only to the wiring that powers the motor, before the switch) you need too check, not measure , the current.A low value resistor in series can be dimensioned to have about 2 - 5 V rms voltage on it's terminals.I mean that, with a 500 VA motor at 230 V, a 1.5 ohm, 10 W resistor will dissipate 7 W and will have a 3.26 V drop, that not affect the motor's operation.These 2 - 5 volts will be there only if the motor is energized, and they are enough to drive an AC input (or with some additional circuitry a DC input) optocoupler, that can drive any counter.

author: ejeffrey
author_rank: Super Contributor
timestamp: August 23, 2011, 08:30:44 pm
content: QuoteHe wants to measuring the amount of time per cycle that the pump runs. I presume that the pump fills some reservoir with an upper and lower threshold, so the pump starts when the level falls below X and runs until the level is above Y. If it takes more than Z minutes to fill there is a problem. It is desirable to put all the electronics inside the house (i.e., at the breaker box) rather than at the pump and running wires back. If this were not the case, putting an AC relay in parallel with the pump would be the way to go.QuoteAbsolutely not. A current sense transformer is a much safer and better way to do this. It keeps your low voltage circuit isolated from the mains voltage, and has very low power dissipation even in a fault condition. A current sense resistor a potential fire hazard if not chosen properly and doesn't provide the necessary isolation for your circuit.I would look for a cheap / used current clamp probe (the kind that you connect to a DMM, not the kind with a built in meter. Then you can just run the low voltage signal to your microcontroller ADC input. Failing that you can make your own as you describe. You can either cut a toroidal core in half and put sense windings around one half. Then clamp the two halves back together with the live wire threading the core. This will work exactly like a current probe and allow you to measure without breaking the contact. If you can easily disconnect the live wire from the breaker box you can wind it a few times around an intact core. In either case, connect the secondary winding to a load resistor and measure the voltage across it with your microcontroller.Personally I would probably rather put the monitoring device at the pump rather than the breaker box, but either will work fine.

author: PetrosA
author_rank: Frequent Contributor
timestamp: August 23, 2011, 10:53:58 pm
content: I'm not seeing how this method can work well. A pump doesn't ever work evenly and without comparing pump time to water flow and pressure, the results are meaningless. If two or three or more faucets are open, the pump will run more than if there is a leaky toilet valve. It sounds to me that a better solution would be to check two things on a regular (monthly or bimonthly) basis: 1) If he knows how to use one, put a megger to the pump motor. This will tell him whether the windings are breaking down. Checking the seals can be done by timing the refill, but it has to be done under very controlled conditions and he'll be looking at trending results rather than a concrete measurement. Pump switches and pressure gauges are very low tolerance devices, and especially the pressure switch can act different from one cycle to the next. That's why trend readings will be important. A possible controlled method for testing would be to start with a full pressure tank, switch off the pump and flush a toilet a certain number of times till the pressure drops below where the pump should start. If no one else opens a faucet, this will use a pretty even amount of water each time. At that point switch the pump back on and measure how long it runs to replace the pressure. Repeat this three times, record the results and average them to minimize the impact of voltage variations on pump speed. Over time, a gradual increase in average refill times would become noticeable but it should take years if the pump is sized correctly.

author: Psi
author_rank: Super Contributor
timestamp: August 24, 2011, 02:27:48 am
content: Quote from: ejeffrey on August 23, 2011, 08:30:44 pmYeah i agree.Winding your own CT and building the interface is quite interesting and you learn a lot but it's not a simple thing.A pre-made CT or HALL sensor is always going to be far far easier to get working and will be more accurate than a DIY job.A good rule is to always do DIY stuff to learn and not to get a perfect finished project.If it ends up working perfectly that's just a bonus

author: bearman
author_rank: Regular Contributor
timestamp: August 24, 2011, 04:34:42 am
content: Thanx all.PsiYou hit the nail right on the head. This is exactly what I need without calibration requirement.ciccioMy friend only wanted a pilot light to see when motor was running. I thought I could automate it for him with a micro. The well pump is physically in the yard and underground. So checking current flow inside house at breaker panel makes most sense. The pump is 10 years old and he is a maintenance freak and doesn't want to get caught without water unexpectedly.ejeffreyYou fully understand what I need.petrosaYou bring up a VERY good point. You need known trigger point to start timing from a known level to get useful information. Automation is out unless I tie the micro to toilet flushers to provide a controlled test sequence. That isn't going to happen.Well you helped and killed an idea. Well actually the scope just changed. I will just be rigging up a pilot that is triggered by the DIY CT. My friend will have to manually control water use to trigger the pump on demand. The pilot light will then go on, on demand and he will have to monitor run time manually. Per my friend the pump should only run for 3 minutes to refill the pressurized water tank in the crawl space. If is goes much longer than this base line, it's time to change the pump and seals.Thank you all for your contributions. I think we have a satifactory cheap solution for my friend so he doesn't have to go out in the snow to monitor his pump.Crap!! I don't get to build a useful micro project now. LOL.B

author: Zero999
author_rank: Super Contributor
timestamp: August 24, 2011, 04:51:05 pm
content: Quote from: Psi on August 23, 2011, 10:29:18 amAre you sure you've drawn that correctly?Is the VCC_24V rail a constant current source or does it have a resistor?If not I don't see how it'll work. You'll just see 0V across R6 because the annode of C2 is permanently connected to +V. There should be a resistor between C2's annode and VCC_24V.