I am reasonable familiar with coding Particle Photons and Borons but I don't know much about electricity. I have an existing Particle-based application that turns a 240-volt water pump on or off remotely. The only problem is that there is currently no way to verify that the pump is acutally running. More specifically, my applicaion opens or closes a high-amperage (240-volt, 30 amp) relay to opens or closes power to the pump; that's all.
I'd like to be able to add some kind of sensor that can monitor the 240-volt circuit and, via a connection to an NCD relay board that a Boron in mounted on, provide access in code to that information. Obviously a cannot route the 240-volt circuit directly through the Boron or the 10-amp relays on the NCD board.
If you want to know that pump is actually pumping, you need a flow meter but that brings some complications.
You could probably get cheaper results with a Current Transformer on the output side of the relay to indicate if the pump is really drawing current. Lots of places sell these, try an automation products seller like Automation Direct etc. I have used the CR Magnetics products in the past and would generally recommend them, but you might want something with more circuitry added to make it easier to use.
Another approach would be an optoisolator on the output side. This is a type of LED & photodiode circuit that will tell you if power if being applied, but not if it is being used like the Current Transformer can.
Both of these are relatively easy to interface to low-voltage electronics but still require some thoughts around safety.
@blshaw45, do you know what current the pump is rated for? The type of sensor used is a hall effect sensor made by Allegro, in this case an ACS781 capable of sensing up to 100 Amps of AC/DC current.
The ACS781 puts out a voltage that can be read by one of the Boron's analog inputs. The problem with using an ACS781 breakout is that you are dealing with live AC voltage and that is VERY dangerous.
Instead, NCD has I2C current sensor boards with clamp-on or solid core sensors than can connect to your NCD relay board. I suggest you read the description on THIS ONE. This is a safer solution IMO.
There is a range of sensors from Allegro that makes it quite simple if you need to monitor current. They also have one that will monitor the voltage as well, have a look at the tutorial I did a while back:
My question would be whether you need to know the actual current, or do you only want to know whether current is actually flowing. If it is the former my suggestion would be one of the Allegro sensors. Würth also have some nice CT's as @bko mentioned, but I find the sensors to be easier to work with.
If you only need to know whether current is flowing, it might be as simple as using an AC optocoupler and connect the output (on the transistor side) to a GPIO pin. It will be like detecting Zero Crossing. If you want it to be a stable on/off connection, I find that adding a 1uF Capacitor will deliver the wanted outcome.
Hope this helps... and be careful, Mains Voltage is no fun (trust me, haha)
bko's suggestion is very interesting Peekay123, but the NCD clamp-on sensor is the cat's meow!! And I'm sure I can get assistenace form Travis over there on how best to interface it to the Boron, either directly or via NCD's relay board.
FWIW, safety isn't a big deal since we can - and do - turn off the pump's beaker whenever we need to perform any maintenance or other activity amongst the other components
Recently spent time trying to reliably read 100A current (12v dc) in a brushed-motor situation. The INA sensors are far too fragile and burn up quickly due to system noise (using external shunts and filters). The allegro sensors are pretty good - but I had a difficult time getting something akin to RMS readings from it, however, using the boron ADC. Would read fine for a while, and then some wild values would show up and the level of signal-processing needed to get confident readings was beyond my expertise (and patience). Note that (edit: some) allegros are 5v logic, so you'll need to level shift it to 3.3, or power it at 3.3 as I did with some loss in resolution.
I do agree tho that if you want to know if the pump is pumping, measuring current is probably not the best way - as a motor at full-stall will draw the max rated current, yet no water flows. I think a simple pressure switch on the outlet side of the pump would be super easy to do and instrument, with the least amount of electrical-engineering muss and fuss of noise-filtering, etc.
In another project myself and @peekay123 worked on, we used the ACS781 sensor which is 3.3V logic, so no need for level shifting. We compared the results from the ACS781 to that measures with external clamp meters and it was surprisingly accurate.
Some of our devices have been in the field for a couple of year now and we are yet to see one current sensor fail. We are using the 100A version but our maximum current draw allowed on the device is 35A and it operates mostly at around 12A running current. Some of these devices have prolonged on periods running for hours on end and some have 100's of stop and starts per day.
I would imagine a way to deal with something like lock-rotor (should you me measuring current) would be to determine maximum current draw vs running current. I am no motor expert, but as I recall lock-rotor current draw will far exceed normal running current draw?
I used a pre-built module based on the ACS758 which is 5v nominal for the analog signal output, but will scale down to 3.3v with some loss of precision (-1.66/+1.66v for full range, vs -2.5/+2.5). I'll read up on the ACS781, thx!, but I swapped to a different motor control that has current measurement and limiting built in and avoided the electrical-engineering needed to integrate it, and instead can just monitor via RS485/modbus.
Glad you found something that works. In our case we were dealing with 240VAC and needed some alternative features as well. Also quite comfortable with designing boards, so that helps
I have found that that these sensors are not great at sensing currents below eg 500mA as there seems to be some offset. We calibrate each one at every startup with no load but even then it hardly ever returns 0A when the motor is no running. Might also be due to some leakage current through the TRIACs.
Anyway, glad you found a solid solution to your problem!
Sorry for responding so late h00die. I have a lot of balls in the air at the moment.
Your suggestion is really good, cheap and, in theory, easy. A couple comments though.
Regarding the current sensor and a pump motor in full stall: the pump is protected by a Pumptec device that should close the circuit to the pump in such an event. Well, it at least shuts it off if the well runs dry (senses the driop in current draw). So I don't think the use of a current sensor for my application is excluded on that basis.
Regarding the use of a pressure switch: the water storage tank is about 240 verticle feet uphill from the well and the pipe between the well and the tank enters the tank below its low-water level so there is always water in the line (we use a siphon via the same supply pipe to feed a couple of the homes that are supplied by the system).
Due to the height of the water "head", the pressure in the line at the well is over 100 psi at all times. Obviously, the pump must generate more pressure than that in order to push water uphill, so any pressure switch or transducer would have to be able to detect pressure levels higher than, let's say, 120 psi and my application would have to be able to "see" that. No pressure above the threshold = pump not operating. Do you think that is do-able?
One other thing about a transducer or switch: that would require that we hire a plumber to install it at a cost of several hundred dollars and we'd have to drain the 1500 gallon tank first (no one thought to add a shut-off valve at the tank when the supply line was changed from an above-water entrance to an under-water entrance, so there is currently no way to disable the siphon. Duh!
A clamp-on current sensor obviously avoids all of those issues.
There are adjustable pressure switches available - so I think finding a switch whose rating is in the ballpark and then fine-tuning it to your conditions should be do-able. Then integration is sending 3.3v to it, and watching for it to come back to a gpio pin. You should de-bounce the input, and probably have some filtering and/or an optoisolator to keep the delicate electronic parts isolated from the high-voltage/high-current stuff.
Can't speak to the plumbing aspects involved. I think it would be a good time to also install a shutoff valve ahead of the pump so you can isolate it from the head-pressure and avoid draining the whole system should the pump ever need to be replaced in the future.
Come to think of it, is there already a pressure switch somewhere that you could piggy-back on?
The clamp-on (inductive) sensors will also probably work but you need to study the amperage characteristics of the motor in various states (start-up, nominal, seized, dry) to ensure what you are seeing makes sense to your code. I don't have any experience integrating one with particle however.
Good point about geeting a shutoff valve installed. Probably one at each end.
There is no pressure switch on the supply line; only between the storage tank and the non-siphon distribution system integrated with a standard pressure tank..