Go Down

Topic: Analog pins cancel sensor values out (Read 975 times) previous topic - next topic

devinrayolsen

Apr 20, 2017, 04:50 am Last Edit: Apr 20, 2017, 04:56 am by devinrayolsen
I've got a set of pH and EC water sensors that is being supplied 5v/1A power (dedicated, not off Arduino) and reading from Arduino mega's analog 3 and 4 pins. Soon as I drop both sensors in the same batch of water, both sensor readings drop to 0 canceling each other out.

I've narrowed the issue down to what must be the analog pins sharing a ground, cause if I remove power from one sensor and drop both sensors into water, I get the same results where both sensors cancel each other out.

Is there tricks to have analog sensors be isolate from one another, but still read to the analog pins when the medium in which to measure is a conductive solution (bucket-o-water)?

756E6C

Need a wiring diagram and links to both sensors.

devinrayolsen



I'm not sure where to find schematics of what is inside the actual sensor boxes, but I got them from here:
http://webpages.charter.net/tdsmeter/products.html (Model 1004V2 Arduino pH Sensor and Model A1003v1 Arduino EC Sensor)

Here is a screenshot of the internals of both sensor models (if it helps at all):
EC Sensor


pH Sensor


Any advice is greatly appreciated.
Thanks!

devinrayolsen

#3
Apr 23, 2017, 11:13 am Last Edit: Apr 23, 2017, 11:18 am by devinrayolsen
Note to self: using MOSFETs to create a switch for sensor's grounds, vcc or even data line going to analog pin still failed, and sensors cancel each other out still. Here are the results from each test:

Gnd MOSFET switching = analog still providing ground to sensor and fails

Vcc MOSFET switching = both normal gnd and analog pin proving ground to  sensor and fails

Analog data line MOSFET switching =
normal ground to sensor and fails

The only thing left to test is to get a few more MOSFETs and create a switch for all three (gnd, vcc, and analog pin's data) lines at the same time for both sensors and alternate on states between sensors to get correct readings. That said though, MOSFETs might still not be the best switching solution because I'm not sure if drains isn't leaking gnd, even when MOSFET is off.

devinrayolsen

#4
Apr 27, 2017, 12:53 pm Last Edit: Apr 27, 2017, 01:04 pm by devinrayolsen
Ok I'm in need of some understand on what is happening in here in this video, and possibly a solution?
(sorry for the video, but seemed quicker to get across with what the issue currently is)

(click to play video)

The MOSFETs in question are these guys:
https://www.sparkfun.com/datasheets/Components/General/RFP30N06LE.pdf

Thank you!

756E6C

Do you have the 12V ground and the 5V ground connected?

devinrayolsen

#6
Apr 28, 2017, 03:53 pm Last Edit: Apr 28, 2017, 03:58 pm by devinrayolsen
Quote
Do you have the 12V ground and the 5V ground connected?
Not that I'm aware of. Top rail of breadboard is 12v from transformer power supply, while bottom breadboard rail is is 5v that comes off Arduino.

In the video I have the MOSFET-ed sensor pulling power from bottom rail and non-MOSFET-ed sensor pulling from top rail, only to demonstrate I have tried to use separate power sources. Same result occurs when both use either top or bottom rail.

Here is a better schematic view of just the sensors, MOSFET and Arduino setup:


And a additional breadboard view of the same setup:


I'm going to pick up a better DMM today and test once and for all if indeed a leaking current is coming from the MOSFETs or not and go from there. I got some feedback about this possibly being an
Quote
EMI with total disregard for stray line noise on high impedance sensors with water acting as a large capacitive antenna for line noise.
However I've just tried a poor mans shielded cable setup using tin foil around all three lines (+, - and data) of MOSFET-ed sensor, wrapping a grounded wire around the whole shabang, but results are the same.

Hopefully new DMM will give a better idea where to look.


devinrayolsen

Ok I've just gotten back from the store and picked me up a nice multi-meter (been needing one for long time now). I hooked this new guy up the Positive Mosfet's Drain, flipped it over to mA readings and turned my project on, and vola issue is gone and multi-meter is reading 0. Unhook multi-meter from project and issue comes right back lol, so there is something in this multi-meter fixing my issue..

CrossRoads

You put meter in series between the Drain and where the drain connects?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

devinrayolsen

Quote
You put meter in series between the Drain and where the drain connects?
Yup, I hooked up the meter's negative line to drain on "positive" MOSFET (schematic above), positive meter line to red wire of water sensor.

For kicks, I just tossed in a 1N4007 1A Diode basically where I just had the meter connected and with MOSFETs off, issue is gone but MOSFETs turned on sensor is not turning on. Getting closer I guess :)

CrossRoads

"
Quote
Do you have the 12V ground and the 5V ground connected?
Not that I'm aware of. Top rail of breadboard is 12v from transformer power supply, while bottom breadboard rail is is 5v that comes off Arduino."

Have you fixed that yet? (I can't see your attachments, network here is blocking them)
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

devinrayolsen

Not sure that matters much, if I move both sensors source to 12v rail alone, same results, 5v rail alone same results, and a mix of either two is same result. I should mention the sensors load is 5v-12v so either should be fine.

devinrayolsen

Blah sorry, false alarm on the meter hookup. Looks like I didn't have as solid connection and that is why the issue went away and was reading 0. With meter hooked up properly and MOSFETs turned off, still reads 0, but issue remains true still.

So I can confirm I don't have any kind of leak happening from the MOSFETS, yet while sensor is still plugged into these turned off MOSFETS it is canceling out the other sensor in the water.

So that got me to thinking maybe this other fella was correct and the sensor that is turned off by the MOSFETs is indeed acting like an antenna for the powered on sensor. Beings the powered on sensor uses voltage to report values back to arduino, the turned off sensor that is acting like an antenna is drawing power from the powered on sensor and lower its voltage down to zilch resulting in the of the powered on sensor's value being 0.

So I got two 25 feet of 22 gauge solid copper wires out, hooked positive to the positive drain MOSFET, negative to the negative drain MOSFET; dropped the other (exposed) ends into the water and bingo issue remains! So looks like indeed when one sensor is turned off it begins acting like a antenna and draining needed voltage from the remaining powered on sensor.

Go Up