Instrumentation Issue - Page 1
Forum section: electronics / projects

author: rpm750
author_rank: Newbie
timestamp: August 03, 2013, 02:35:33 am
content: First Topic, 2nd post.I work in the Instrumentation field for a municipal water supplier. Recently a wastewater plant wanted to install a rain gauge and bring it's output into SCADA. Supervisory Control And Data Acquisition. The rain gauge has a tip bucket inside that will fill with water and it tips raising a second bucket until it fills and it tips, etc, etc. The pulse from this unit is generated from a reed switch and a magnet on the bottom side of the tip buckets 1 pulse for each tip. Each bucket tip is equivalent to 1/100(.010") inch of rain fall. The signal is going into an Allen-Bradley Control Logix PLC through a AC input card(120vAC) through an output relay controlled by the gauge.The rain gauge was manufactured for a portable flow meter so the reed switch went to a counter and a Micro Controller then would transfer the data via RS-232 to the Flow meter console when hooked up. I say RS-232 it's only 4 wires. The gauge uses (2) 3.6v Lith batteries to power the Micro Controlled storage. Since we don't have the Flow meter controller I set out to build a circuit around a 555 to lengthen the quick pulse to a time that the PLC to scan the program and see the pulse and act upon it. That was all fine but during heavy rain events the rain water backs up in the upper rain gauge bonnet and the buckets tip at a rate faster than my output signal can track. So I need to store these pulses and send them out at a rate of about 1 pulse per second or longer. I've been racking my brain trying to come up with a solution to this issue. It needs a buffer or some type of storage but I'm stuck on what to use to store the pulses and then send them out in a 1 pulse/ second rate. I've been leaning towards a Flip/Flop in some sort of shift register but not really a shift register, more like a hold bit configuration but without a clock signal and then as the pulse goes out reset each Flip/Flop. Well as the pulses build up they would move to the right in the "register", so first in, first out.Requirements...~Battery operated.~I'd like to stay away from having to build a clock circuit but if I have to then not really a biggy.~We need to store around 16 or more pulses. The number will be nailed down after I put together a prototype and see how it performs when sending bits out as they come in.~The reed switch is small(Low Current Carrying) so an output relay will be required. I have to switch a 120vAC signal going to the Input card on the PLC.~I could figure out how to modify the existing Micro to do this task for me but that will take time to figure out.

author: Rufus
author_rank: Super Contributor
timestamp: August 03, 2013, 03:43:17 am
content: You requirement isn't completely clear.What I think you need to do isn't difficult. Producing something presentable, reliable, and at a reasonable one off (assuming it is one off) cost is the difficult part.The battery power requirement is a pain, if you are switching a 110vac signal surely you have some 110vac for power?I would think one of the micro PLCs like a Siemens Logo would be the easiest solution, possibly a 24v DC one with power supply because the ac ones might have the same slow input problem.

author: SeanB
author_rank: Super Contributor
timestamp: August 03, 2013, 05:21:09 am
content: You are reading via a PLC, do you not have a fast pulse counting input available, you only have to have a 8 bit counter in the PLC and poll it every minute. You will need 24VDC to drive the reed switch then, and just use an opto input on the PLC instead. You will most likely still have a switch input on a regular 24VDC card available, and that will read fast enough.

author: MasterOfNone
author_rank: Regular Contributor
timestamp: August 03, 2013, 10:39:20 am
content: Quote from: rpm750 on August 03, 2013, 02:35:33 amIf you really wanted to implement the system you suggested, you could try something like an up/down counter. The counter would count up each time there is an input from the rain gauge and count down at a rate of 1Hz, but only when it has had a pulse.Sorry about the bad drawing, I'm too lazy to do it on the computer.With this type of solution I’m not sure why the buffer (count) wouldn’t overflow during a heavy spell of rain?

author: Spunky
author_rank: Regular Contributor
timestamp: August 03, 2013, 11:55:54 am
content: Sounds like an overcomplicated way to measure rainfall if you ask me. Why don't you just collect into a small buffer tank, say 50L, and use a float switch near the top to switch a solenoid valve outlet. Then you can just use a pulsed flow meter and an off-the-shelf counter, or wire it to your scada PLC. You then only have 1 input to count and the rest takes care of itself electrically.If you need timed readings you just add a din rail timer to open the valve daily or hourly, with a reed switch low in the tank to force the solenoid shut at low level.All the switching can be done at mains voltage, again just 1 pulse output to deal with.I'm thinking as a 'panel builder' here, not 'electronics engineer'.

author: rpm750
author_rank: Newbie
timestamp: August 03, 2013, 12:09:56 pm
content: I did fail to mention that this gauge is about 1000 ft from the PLC, so no 120 close by and we don't have or use any counter modules in our PLCs. Most of the Analytical devices in the field send data via a 4/20mA loop to the PLC. The PLC also is used to control motor starters and send out speed controls via 4/20 also. There is about 6 PLCs through out the plant all communicating with each other and to a server/console via fiber cables and fiber modules.This will be just a one off build for this issue.Masterofnone I will toy with this this weekend.I had electronics schooling many many years ago and I went in the Electrical direction, I deal more with packaged components like pH meters, VFDs, Level Transmitters rather than component level repair. But I'm going back brushing up on my skill set.I don't like Siemens much, they do have a nice UltraSonics system, the HydroRanger 200. But is was designed and developed by Milltronics first and then the big FISH swallowed it up.This gauge is small requires only a periodic cleaning, no human interaction as far as dumping a bucket or anything. I think capturing the output on the fly is the way to go. Yes it is complicated but from the factory it used a micro computer, memory. Talk about technology to measure rain.

author: Marco
author_rank: Super Contributor
timestamp: August 03, 2013, 01:36:41 pm
content: Why use battery power? Why not just transmit power over the wires already installed to carry the pulses?MasterOfNone's circuit is about as simple as it's going to get I think.

author: C
author_rank: Super Contributor
timestamp: August 03, 2013, 04:51:53 pm
content: why mess aroundyou could use 4/20mA loop to power the gauge and collect the rain count.If the plc's loop scan time is fast enough it could be as simple as the rain gauge bucket signal connecting an additional 4/20mA loop resistor.If you do not want to use a mpu and the loop scan time is slower , you could use the bucket tip signal to create a fixed in width and voltage pulse to charge a cap and have a slow bleed off resistor.The cap's voltage then changes the 4/20mA loop currentC

author: Rufus
author_rank: Super Contributor
timestamp: August 03, 2013, 05:33:37 pm
content: Quote from: rpm750 on August 03, 2013, 12:09:56 pmYou are already running 1000ft of cable with 110vac for the PLC signal. I will assume you already laid it and only have 2 cores.In which case you could run the reed switch 1000ft through that cable and locate a small PLC to do the pulse stretching and regurgitation next to the main PLC.Quote from: rpm750 on August 03, 2013, 12:09:56 pmThe Siemens logo is just an example of a small easily programmed PLC that costs about $150. Much less than it would cost to dick around designing, building, packaging and installing a custom electronic circuit solution. No future maintenance problems, little required documentation, and no batteries to change or charge.

author: Spunky
author_rank: Regular Contributor
timestamp: August 05, 2013, 12:25:04 am
content: I'm sure there are pulse counters out there than can output 4-20mA. I've never really looked into pulse counters myself. 4-20 is the best option for that distance. You can also do this with logo or a win CE datalogger at the measuring point with a 4-20 output. There are some nice touch screen units out there like the KD-7 which could do this easily, just need to specify the right I/O cards.

author: MasterOfNone
author_rank: Regular Contributor
timestamp: August 08, 2013, 09:39:10 pm
content: I know there are a few great suggestions above that don’t require building your own circuit, plus the maintenance and reliability issues that could arise from building your own circuit. But I just happened to look at my drawing and then I realise it wouldn’t actually work. NooooooThe first problem was that the output pulse wouldn’t stay on long enough for the PLC to detect it. So one solution would be to add an extra monostable on the output to stretch the pulse.The next problem was that the 193 counters should have their count pins held high unless the pin is being pulsed. So changing the AND gate in the original design to a NAND gate and then generating a narrow pulse from the oscillator would mean the Down pin on the Couner would be held high most of the time.Adding an inverter to the Up pin would make it high most of the time.As you can see the end result is no longer such a simple solution. To be fair you don’t really need an extra 555 timer to generate a narrow positive pulse from the Astable, you could easily create a 555 astable with a narrow negative pulse and invert the output with a Nand from the Quad 74L00 IC.Anyway I just felt the need to correct some of my errors, just in case rpm750 tries to build something base on my original suggestion.Edit: The circuit above wouldn’t really be suitable for use where high accuracy is required because there will always be the potential for missed counts if the Rain gauge produces a pulse at the same time as the Astable.

author: crisr
author_rank: Contributor
timestamp: August 12, 2013, 02:28:10 pm
content: That's an elegant solution, but when reaching a part count of 3 555's, 2 gate ics and a counter ic, plus a handful of capacitors and resistors, IMHO it would be much simpler to implement that logic using a single 8-bit microcontroller (ATTiny or PIC 12F) and not a single extra component (apart from decoupling cap). The 555 / 74 logic way would also need regulated 5V at several miliamps, not very good in a battery powered circuit; the uC would be able to stay mostly in sleep mode consuming a few uA or less in average, and could operate from unregulated 3V, 3.7V or 4.5V directly from batteries.The code would be something like:Setup watchdog interrupt for 1s or so;Setup pull-ups;Setup pin-change interrupt for reed sensor;Enter sleep mode;When pin-change interrupt occurs, debounce it, increment counter and sleep;When watchdog interrupt occurs, if counter > 1 then output pulse, decrement counter and sleep again;

author: Kremmen
author_rank: Super Contributor
timestamp: August 12, 2013, 04:44:34 pm
content: I was going to suggest similar. There are those who take exception at pushing MCUs as a solution to every problem and i can see the point. However there are cases where the "simple" alternatives are obviously the more complicated ones. This looks like one of those cases. Of course there is the threshold of programming the chip but a small AVR (PIC too i'm sure) is easily handled with minimal tools not costing an ARM or a leg (pun intended).

author: MasterOfNone
author_rank: Regular Contributor
timestamp: August 12, 2013, 10:39:17 pm
content: Oh yes, just about any Micro Controller would offer a simpler and more efficient solution than my designed. But not only that, a Microcontroller solution would be able buffer a lot more than just 16 pulses, so it would be less likely to give an erroneous reading during a rain storm (because of buffer overflow).But the reason I headed down that path was because the Original Poster didn’t seem that keen on Micro Controllers, e.g. there was one already available as part of the rain gauge but he didn’t to want to modify it, but he already knew how to use 555 timers. Also he was actually trying to design a solution using Flip-flops or shift registers.So we can all agree that if he can’t find something off-the-shelf the solves the problem with his PLC, it would be so much better to use a Micro controller if he has the programming experience.But as some type of last resort, if he did feel the need to build something that isn’t Microcontroller based, then I believe my design could be made simpler by replacing the Counter with a FIFO (something like the 40105). The FIFO wouldn’t need to actually shift any real data it could just use pull-ups on the data in pins. The “Data Out Ready” pin would be used to indicate that at least one pulse has occurred on the rain gauge, this means the OR gates wouldn’t be needed.Also a FIFO wouldn’t have the same potential of missing pulses, so the circuit would be more accurate. But yes it would still need a whopping battery, so it would be transportable, rather than portable.