gas meter problem

Forum about 1-Wire devices.
Post Reply
promy
Starting Member
Starting Member
Posts: 12
Joined: Sat Jan 03, 2009 1:01 pm
Location: Belgium

gas meter problem

Post by promy »

A while ago i constructed a 1wire counter interface, based on some scematics from this forum.
When i test it with a reflecting surface in front of the CNY70, it works fine.
But when i place it in front of the last digit of my gasmeter (the one with the reflecting 6), it just does not work.
Sometimes it gives random increments (very fast, like a 1000 pulses in one jump) or it does not count correctly (say 1 count if the 6 has passed like 30times...)

To get good results with a reflecting surface in front of the CNY70, R3 is set to have 0 Ohm between B and C.
I used a LM358 as opamp. (i had it around)

The scematic i used is the following one:
does anyone know how to alter/finetune it so that it works correctly.

Image
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

gas meter problem

Post by Bwired »

My schematic which I don's use anymore was slightly different.
http://www.domoticaforum.eu/topic.asp?TOPIC_ID=111
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

gas meter problem

Post by Digit »

I don't use it anymore, hardware is long gone, so i can't review if maybe there's something wrong in the schematic...
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

gas meter problem

Post by Jfn »

Put a resistor in series with variable resistor R3.

When R3 equals 0 ohms you will have short-ciruit between +5V and GND; When R3 has a value near 0 ohm the resistor will probably go up in smoke. A series resistor is needed to prevent these things. Start with a 1K resistor. Place it between 5V and R3. When R3 equals 0 ohm, the input of the LM358 is at ground-level. When R3 reaches it maximum resistance (10K), the input is at 4.5V.

Get rid of R4. Do you really need the hysteresis?

Put a resistor between 5V and the detector part of the CNY70 (current limiting). Ic(max) = 50 mA, so I suggest using a 220ohm resistor (This limits the maximum current to approximately 25mA).

Change R1 to 220ohm and replace R2 with a variable resistor of 1K2. If(max) is also 50mA and 220 ohm makes sure that it stays well below this limit. The combinatie of R1 and R2 enables you to change the current flowing from 25mA to 3mA. Do you need more than 25mA, just replace R1 by any value between 120 and 220 ohm.

Check the datasheet. The more forward current (If), the larger you can make the distance between the gas-meter and the CNY70. A negative side-effect of increasing the distance is that the CNY70 becomes more susceptible to background light.

Using a multimeter and some variable resistors you should be able to find the most optimum situation for your setup.
promy
Starting Member
Starting Member
Posts: 12
Joined: Sat Jan 03, 2009 1:01 pm
Location: Belgium

gas meter problem

Post by promy »

Thanks for your answer.
However, i seem to have a very strange problem...
even the original schema will not work anymore.
I started measuring the voltages between gnd and some point, but i get confused...
the voltage after the detector (of cny70) is infuenced by R3? eg: i measure something like 1.7V after the detector when no real reflection is present. I start lowering the voltage on pin 2 of LM358 (-) to get close to that voltage. all of the sudden the voltage after the detector jumps to 4.x V? (cny70 not moved of light changed)

Another strange thing is that no matter what input voltage the out voltage on the lm358 is 3.84V ... I changed it with a similar lm, but it seems not to change anything...

Strangely when i start measuring the voltages on the + and - input of the LM358 i do get pulses.

I am starting to get confused with all of this...
(i tried changing the E and C side of the BC547 and putting it between gnd and input A as well... nothing seems to be working?)
Post Reply

Return to “1-Wire Forum”