Using signal from external Oil counter with Arduino Analog Input - Page 1
Forum section: electronics / general

author: markusmaker
author_rank: Contributor
timestamp: March 26, 2017, 01:06:24 pm
content: Hi there,I use a Arduino, which should count the signals that are created from a oil meter (Specs here:https://www.oilybits.com/braun-hz5-dr-digital-heating-oil-meter-0-7-40-0-lph.html)schematic diagram:https://cl.ly/3L2d0P1b0Q0FMeasuring the output with a Multimeter I get a voltage from -0,9V (low) and +1,8V (high). I put the + of the oil meter to the Arduino Analog Input and the - to the Ardunio GND. When I developed the sketch and tested it powered by the the USB powered programmer everything worked fine. I take the average of about 200 analog measurements/second to get a stable value. I also used a external stabilised power source over night and got the same result as the oil meter showed itself.Now the problem: I put everything in a cabinet and now it stopped working. I now use a rail-mounted also stabilised 5V power source (probably on a different phase then the power outlets on my desk). If I connect the oil meter to the arduino then I measure 4V between GND and A0 input. Even on the oil meter I measure 4V instead of the 1,8V before. I think it has something todo with different GNDs. If I enable the internal pullup I get 6V measured on the oil meter. What I don't get: The oil meter is battery powered so its GND has nothing todo with the ground at my desk nor in the cabinet. Why are the values different? And why is the voltage measurement on the oil meter identically when powered on my desk and different when powered in the cabinet?Where did I go wrong?Thanks.Kind regards,Markus

author: Seekonk
author_rank: Super Contributor
timestamp: March 26, 2017, 02:00:12 pm
content: I noticed "Measuring the output with a Multimeter" and noticed you are measuring a pulse output with the analog input. Your meter is averaging. The A/D won't. feed your pulse signal through a 10K resistor to input with a 4.7uF from that to ground. Then you might get a usable signal if the output pulse is always the same time (doubtful). You will get something but probably not linear. You really need to rewrite your program and count pulses in a time period and feed signal into digital input.

author: retrolefty
author_rank: Super Contributor
timestamp: March 26, 2017, 02:25:25 pm
content: You should really process the signal first through a schmitt-triggered compator and then read and process as a digital input.

author: Seekonk
author_rank: Super Contributor
timestamp: March 26, 2017, 05:27:43 pm
content: The point I wanted to make is you have a microprocessor. Your signal won't be that fast. Any conditioning you need to for can be done by the micro with a minimum of external parts. I had an assignment on a ship. There was a mechanical counter that measured barrels of oil. I would just go click, click, click, click. You wouldn't think there was that much oil in the world to keep that ship going.

author: markusmaker
author_rank: Contributor
timestamp: March 26, 2017, 08:12:34 pm
content: Hi guys,thanks for all your ideas. Seekonk you are right the signal is very slow. The high state is about 15s and then it goes low again for 13s (depends on the current consumption).So the multimeter delivers a valid "signal" progress.Today I started directly on the Oilmeter (output of the Saleae capture above) and then I connected the Arduino again and tried. And funny enough everything worked as before. Putting it back in the cabinet, it did not work. So after checking the cables and reconnect all terminals again -> Works as designed.So the main error was, I just starting thinking way to complicated instead of checking the cables