Water Pulse Meter - 12v to 5v pulse interfacing

All

I'm thinking of fitting one of these to measure water going into my electric water heater, whilst measuring the power it uses:

http://www.omega.com/Manuals/manualpdf/M0504.pdf

The meter requires more than 6v for creating pulses, so I was thinking of a 12v supply (and using a smooth dc-dc adapter / regulator to power the emonTX from that as well).

I've researched opto-couplers / opto-isolators, potential dividers and voltage regulators.

The meter could output 35 pulses per second.

Option 1 would be to Opto-Isolate the 12 and 5 v sides.  not sure on pulse rate issues.  This would utilise the 5v line from emonTX.

Option 2 would be to use a simple pair of potential divider resistors in the 5:7 ratio, not sure on accuracy (or the optimal combination to use).  Also this would be feeding a supply into the emonTX from externally, so I guess you'd have to connect the 2 grounds together.

Option 3 would be to use a voltage regulator to feed 12v into the 5v emonTX, again connecting the grounds of each circuit. Not sure on pulse rate issues.

I'm assuming that the optional pull down 'R8' (10k) will be needed on the emonTX too?

(as well as the "at least 2k ohms pull up resistor on the 12v meter side as in the pdf)? I'm a tad lost in the pullup/pull down logic...

Any Suggestions would be very welcome!

Robert Wall's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

Starting with pull-up and pull-down resistors. Your input (the pulse input of the emonTx) measures a voltage. It wants to be a logical HIGH  > 0.7 Vcc (from memory) or a logical LOW (< 0.3 Vcc). If you connect that to one side of a switch - contacts, the transistor half of an opto-isolator, say, then you can connect to other side of your switch to either the supply or to ground. But you need a resistor to pull the otherwise floating input in the opposite direction when the switch is open. It's called "pull-down" when the switch is wired to the supply and it pulls the input down to ground, and it's called "pull-up" when the switch is wired to ground and it pulls the input up to the supply.

Second, the emonTx processor runs off 3.3 V, so you need to redo your sums.

Third (and this is more personal preference as you have the choice), I'd go for the opto-isolator and separate supplies, as you need different voltages anyway, and especially if the meter is some distance away.  I'm guessing your meter is the FTB4607?  I'm also guessing that the device in the meter is a Hall effect sensor that looks like a transistor to the outside world - the emitter will be connected to "C" and the collector to "B" (and "A" supplies something else in the meter).  If you have an opto isolator, you wire the LED in series with the resistor between A & B, and choose the resistor to suit the LED current. Then you connect the phototransistor of your opto to the emonTx pulse input (collector to Vcc - tip and emitter to pulse in - ring). The 10 kΩ pull-down resistor fitted on the emonTx pcb should be OK. (And I'd have the opto near to the emonTx, rather than near to the meter.) Pulse rate should not be a problem.

However, you could use a single supply with multiple output voltages and a common ground. If the meter and emonTx are close, this would be the simplest solution. Then again you have two options. The first would be just a 3.3 V zener diode to hold down the input voltage to the emonTx.  In that case, you'd wire the zener diode B - C, connect B to the common ground and C to the pulse input (plug ring). You'd choose the pull-up resistor A - B to give you a couple of mA into the zener. The second is to use a potential divider as you suggest. Wire another resistor B - C so that the voltage at B does not rise above 3.3 V. I'd suggest trying 27kΩ for the pull-up (A - B) and then you can use the 10 kΩ pull-down as the resistor B - C.

I haven't tested any of these (I don't have your meter!) so the usual get-out clause - they all ought to work but...

phildabeast's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

Robert, Thank you very much for the detailed explanation, I've made several attempts to understand and done lots more reading in the past 2 weeks since your post.

My approach is to construct all of the options, and see which works on location, as my assembly area is a long way from the installation.

I have interpreted your reply as diagrams for the 3 options:

 

My understanding is that my meter is effectively like a push button switch across B and C so in the:

Opto-isolator, B-C 'open' = logic Low, LED = OFF.

Potential Divider, B-C 'open' = Logic High.

Zener Regulator, B-C 'open' = Logic High

 

So for the opto-isolator, which actual component would you suggest, having never bought one before, and what resistor value?

I'm ok with the resistors as dividers, as long as my circuit above is correct?  12x (10k/27k) = 3.24v

For the Zener, I'm confused by the polarity of the output side, above you say connect 'C' to the Pulse Input and B to the common GND. I have drawn how I've interpreted the wiki page on how they work... why is the above drawing probably not right?!  Also, I've assumed the 10K pull down resistor is not needed in this case.  Also after reading this: http://www.reuk.co.uk/Zener-Diode-Voltage-Regulator.htm I'm not sure on the 'load' current as it's just a small pulse, so calculating resistors I'm unsure on.

Thanks again

 

 

Robert Wall's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

I'd forgotten all about this! All those diagrams look right - without going back and checking what the connections in your meter are, I'll believe you have got it right for the last one and I got it wrong.

As for the opto - I guess pretty much any general purpose one will do. Your meter defines the maximum current you have available, the LED data sheet will define the minimum current to work, and as long as that less than the maximum the meter can handle, it's OK.  If you name your preferred supplier, I could look at their catalogue - or better still, you look and from what I've told you, suggest one and I'll check it!  The resistor value is 12 V - the opto LED drop (from the data sheet) - the meter drop (from the data sheet), all divided by the current (from the data sheet, which should be above the minimum by a small margin, > 10% say).

The zener just needs enough current to work. There is essentially no current going into the digital input, so a few mA and a 300 mW zener will be fine. So about 2k7 or 3k3 for the resistor - that would feed about 4 mA into the transistor switch when it's on (output low) and about 3 mA into the zener when the switch is off (output high). It's not critical.

As you say it's a long way, I'd favour the top one, with the opto at the emonTx end. That will be much more immune to pickup and totally immune to earth currents etc. (Basically any interference has to have enough power to light the LED in the opto.)

dBC's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

(Basically any interference has to have enough power to light the LED in the opto.)

Yep, and at those relatively high  pulse rates, sorting the pulses from any noise could be tricky.  The debounce chip I use has a settling time of about 40msecs, so can't measure pulses faster than about 25 Hz.

phildabeast's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

Thanks again for the reply.  I've gone for the larger meter, so the pulse rate will not exceed 25Hz (at 75 litres per minute, which is LOADS - single Shower may be 5-7Hz perhaps)

How about Opto to be: http://www.fairchildsemi.com/ds/MO/MOC3023M.pdf (3023M) 5ma rated? can't see any reference to frequency response / max rate.

~1.15v across LED. LED forward current ~1-4ma (@25C) [from graph in datasheet]

I don't think the PDF linked in the post above has a meter voltage drop but the max available current is 10ma...

is this right: (12-1.15) / 0.004 = 2712.5 ~ (27K resistor ?)

Thanks

Robert Wall's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

How about Opto to be MOC3023M?  -- No. That one has a triac output, so on a d.c. supply once turned on, it will never turn off - at least until you break the current some other way. Not what you require. You want one with a plain transistor output- something more like this: http://spiratronics.com/cny17-2-transistor-opto-isolator.html

That one from its data sheet has a current transfer ratio of 125%, meaning you feed the diode 1 mA and the transistor will pass 1.25 mA

is this right: (12-1.15) / 0.004 = 2712.5 ~ (27K resistor ?)   Nope. 2.7 kΩ - you got the decimal point wrong translating to kΩ.  So if you use that resistor, you can have up to 5 mA flowing in the transistor, but you don't have to have that much. Your 10 kΩ pull-down will limit it to 0.3 mA approx, so the transistor will be well saturated. It should work up into the kilohertz region, so speed won't be a problem.

phildabeast's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

Thanks Again!  So I thought (and assumed) some more...

So using that opto, the Fig.4 (forward Current/Voltage) assuming that graph is for the LED then 1.0v will be dropped across the LED.

SO: working on 1.0v drop across the LED, and a 10K resistor, 11/10000 = 1.1mA through LED, 1.375mA across transistor.

And, I don't know what the voltage drop across the meter will be (B-C in diagram), but assuming it's max 2v, which is loads, the equation with a 10k resistor becomes 9/10000 = 0.9mA across the LED, 1.125mA across the Transistor (still easily enough)

I assume that the resistor's 0.125W rating is fine, 12v x 2mA is less then 0.125W

 

On the zener, the spiratronics website has 500mW Zener Diodes, I assume they'd be ok.  My assumed maths is that (12-3.3) / 0.003 = 2900 so 2K7 resistor.

 

So the shopping list becomes:

1x BZX55 500mW Zener Diode 3.3V (Zener Option)

1x 2K7 Resistor (0.125w) (Zener Option)

1x CNY17-2 Transistor Opto Isolator

2x 10K resistors (0.125w) (Opto Option)

1x 10K resistor (0.125w) (potential divider option)

1x 27K resistor (0.125w) (potential divider option)

AND enough connectors, PCB, sockets and plugs to connect it all up with options to switch between the 3 methods easily enough.

 

Robert Wall's picture

Re: Water Pulse Meter - 12v to 5v pulse interfacing

So using that opto, the Fig.4 (forward Current/Voltage) assuming that graph is for the LED then 1.0v will be dropped across the LED.

That sounds about right.

SO: working on 1.0v drop across the LED, and a 10K resistor, 11/10000 = 1.1mA through LED, 1.375mA across transistor.

Not quite - the transistor can pass a maximum current of that much. It doesn't have to.

And, I don't know what the voltage drop across the meter will be (B-C in diagram), but assuming it's max 2v, which is loads, the equation with a 10k resistor becomes 9/10000 = 0.9mA across the LED, 1.125mA across the Transistor (still easily enough)

Your thinking is awry there. You have voltage across a component, current in a component! So 0.9 mA (probably a bit more, but it's not worth recalculating) flowing in the LED.

I'd assume much the same voltage drop for the meter as the transistor in the opto - probably much less than your 2 V and nearer 0.3 - 0.5 V. If it's 2 V, you have a problem as the emonTx won't see it as a logical LOW, it needs to be below 1 V.

I assume that the resistor's 0.125W rating is fine, 12v x 2mA is less then 0.125W

I don't even bother to check with these sort of voltages and currents! But yes, it's well inside its rating.

On the zener, the spiratronics website has 500mW Zener Diodes, I assume they'd be ok.  My assumed maths is that (12-3.3) / 0.003 = 2900 so 2K7 resistor.

Now you're talking about the direct connection? I think that's not the best idea, but...

The calculation is, current with the meter output high the current is (12-3.3)/2k7 = 3.22 mA, and with the meter output low it is (12 - 0.3)/2k7 ≈ 4.33 mA.
In that circuit, you need to keep the impedances low and the currents high to minimise the chance of noise pickup, but the current still has to stay below the meter's maximum (or the resistor larger than their recommended minimum, which is the same thing).
The zener power is only 10 mW, so well inside the rating.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.