Go Down

Topic: Arduino + PH probe in Aquarium. Ground Loop. Please help. (Read 17956 times) previous topic - next topic

vrgomes

Hi, I'm making a project with arduino that monitor my reef aquarium. So one of the things that I have is PH monitoring.
To do that, I have the Atlas Scientific Ph Stamps:

http://atlas-scientific.com/product_pages/embedded/ph.html

My connection is like this:


When I mesure the PH inside a bottle or a glass it measures the PH very precise, but when I place the probe inside my aquarium it give me wrong values. I also noticed that when I turn off my watter pumps in the aquarium the reading is fine, but when I turn the pumps on the problem appears again.

I have read a lot about ground loops (http://www.all-about-ph.com/ground-loop-problems.html) and interference with pumps and noise that is inducted into the PH probe but I don't understand what I have to do/buy to solve this.

So for my understanding until now I have to buy  DC-DC power converter and an optical data isolator but I don't understand what chips to buy and how to connect them im my arduino conection like I showed.
For example this other controler show this:

http://www.splatco.com/sx10507.htm
Quote
This uses a transformer isolated DC-DC power converter, and an optical data isolator, to ensure there is no metallic (ohmic) connection between the pH probe and the controller. This isolation eliminates the interference that can be caused by ground loops.


Please give me some guidance about this. If what I think it is, is correct and how can I solve this issue.
Thank you vey much.

Krodal

#1
Dec 07, 2012, 12:02 pm Last Edit: Dec 08, 2012, 12:28 am by Krodal Reason: 1
Could you add a link to the PH-probe ?
I read that a glass-PH-probe could be 800MOhm, is that right ?

Do you use a good shielded cable, which is fully shielded at both ends ?

Some noise of the mains voltage is probably passed on to the water via inductive/capacitive coupling in the pumps. It is almost impossible to get rid of that (only if batteries are used to power the pumps).

An opticial isolation could work. A DC/DC converter with an transformer removes the ground loop, but also passes on noise. An input circuit with a battery could also do, and with a optocoupler to pass the digital signal to the Arduino.

You could do a test. Use a battery for the Arduino and sensor board. Don't connect the usb or anything else to the Arduino, and store the PH-value in EEPROM. After that, read the EEPROM and check the values. If those values are good, your circuit is good and the problem is the noise and the ground loop.

I'm sorry, but I couldn't find a good solution for a PH-sensor. You might have to buy such an isolated circuit as the SX10507. Using your Atlas Scientific Ph Stamps circuit board and making your own isolated data transfer is not easy.


Added: Now that I have thought about it, the best way to isolate it, is at the serial connection. You could use two optocouplers for the RX and TX signals. The Atlas Scientific Ph Stamp could be powered with an galvanically isolated DC-DC converter.
There are ic's for RS232 isolation, but two normal optocouplers is better. Like these: http://yusisukmalia.wordpress.com/2009/06/11/rs232-make-optocoupler/
http://www.circuitsonline.net/forum/view/106111
An isolated DC-DC converter is cheap if they have unregulated output:
http://www.ebay.nl/itm/DC-DC-1W-isolated-converter-5V-5V-OUT-MORNSUN-F0505M-1W-/130674774325
But you have to test it, the output could be too noisy.

vrgomes

Hi, first of all thank you very much for the answer.

My PH probe is this one:
http://www.marinedepot.com/American_Marine_Pinpoint_pH_Probe_pH_Replacement_Probes-American_Marine_Pinpoint_Monitors-AM1411-FITERPPH-vi.html

I think the cable and connectors are shielded so i don't think that's the problem...
So in your opinio I should power up the PH stamp with an  isolated DC-DC converter like that one you showed on ebay.
Second I should isolate the RX - TX that connects the arduino with the stamp with 2 optocouplers. Can you plese show-me a model available on ebay so that I'm able to buy it or the reference to search on my local store.
I also don't know how to connect the opctocupler but that will be another stage.

Thanks again.

Krodal

For someone familiar with electronics, two optocouples like the schematics I linked, is not hard.
I'm sorry but I can't find a ready-to-use board on Ebay.

vrgomes

#4
Dec 10, 2012, 10:51 am Last Edit: Dec 10, 2012, 10:57 am by vrgomes Reason: 1
Hi what about this optocoupler:
http://arduino.cc/blog/2010/09/22/optocoupler-demystified/

Does it will work?
And I have to buy 2 of these, on for Rx and other for TX.

I also said that there are some RS232 IC's that do this isolation. Can you point me any that i can find on ebay?

Thanks.

Edit:
Fund this:
http://www.ebay.com/itm/1x-MAX251EPD-5V-Isolated-RS-232-2-Driver-2-Receiver-MAX251-/110753204175?pt=LH_DefaultDomain_0&hash=item19c967c7cf

Krodal

Read this: http://arduino.cc/forum/index.php?topic=100729.0

I think that 2 common optocouplers with 4 resistors is easier than using a special ic.

The old 4N35 could be used. This type is better for small signals than the old 4N27. There are also faster optocouplers for digital signals, like the 6N137 (or 6N138). The 6N137 is designed for this, but it is not like the old optocouplers, it has extra pins.
The 6N137 (actually the 6N138) is used here : http://frontiernerds.com/brain-hack
And here:
http://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/s2012/cwm55/cwm55_mj294/index.html
One of the links in my previous post uses also the 6N138.
I would prefer the 6N137 over the 6N138 for a serial connection.

armeniki

Hi vrgomes, did this setup work for you?  I have the same ph stamp as you and the same issues.  I've purchased a dc/dc converter isolator and a couple of 6N137s... Hopefully this will solve the problem.

Cheers

Jensen_HJ

#7
Jan 30, 2013, 10:11 am Last Edit: Jan 30, 2013, 10:13 am by Jensen_HJ Reason: 1
Did you ever get this working?
I had a similar problem, but here the lights caused the error in pH. Grounding the lights did not solve the problem, but grounding the water seems to do the trick. For now, while testing, I simply put a wire on ground in the power outlet and the other end of the wire, directly into the water. I get fine readings now, and hopefully I'm not creating anything dangerous here...

Edit: I have the Pidgets 1130 not the Atlas, but maybe it works for you anyway.

dc42

Another possibility is to use a digital isolator chip that provides both signal isolation and isolated power, such as the ADUM6400 series. Although it's an SMD chip, there is an evaluation board for it, and it's quite easy to hand solder the chip onto the board.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

armeniki

Hi everyone,

Well since the OP hasn't responded, I have gone ahead and started building a circuit using a couple of 6N137s and a DC/DC isolator/converter. 

Hopefully I'll get it finished tonight and will report back about my findings!

Cheers,
Armen

vrgomes

Hi, sorry for the late answer.
It was because in the mean time I contacted Atlas Scientific about this issue. So this was the result:
Quote
Ok, this is what to do.
put a NPN mosfet on the ground line going into the E.C. circuit.
You will want to stop all GND from entering the E.C. circuit.
When you take your E.C. reading open the  NPN mosfet, take your readings then close the mosfet.
Your pH will still be a little off.
Recalibrate your pH with the E.C. probe in the pH calibration solution (the E.C. probe should be connected to the E.C. circuit and the GND line should be cut off with the PNP mosfet).
This has proven to be successful in fixing the pH / E.C. problem.


Quote
Put the NPN Mosfet at the ground line coming into the circuit.
You know, VCC and GND.
Cut the GND line that is powering the circuit not the ground line going to the probe.

As far as which mosfet to buy, there are 100's.
Here is one that should work well for you: 2N7000_D26Z

Turn on the FET when you take an E.C. reading, turn it off when you are done taking readings.


Quote
Yes, place the mosfet between the Arduino and the ground line.

I am not 100% sure the 2N7000 will work .
However, I do believe it will work just fine.
It is a quality FET and that's generally all you need.

If it were me, I would use it.


So, I'm a little lost where because I didn't understand very well ho to solve this. Anyone help?
In the mean time I bought 2N7000 mosfets:
http://www.fairchildsemi.com/ds/2N/2N7000.pdf

So my understanding I have to put this mosfet between the arduino and the Stamp in the ground line but i don't know how to connect it and use the mosfet.

Thanks for the welp!

dc42


So my understanding I have to put this mosfet between the arduino and the Stamp in the ground line but i don't know how to connect it and use the mosfet.


Yes, that is what I think he is suggesting. I'm not convinced that disconnecting the ground without also disconnecting the positive supply will help, but I guess it's worth trying. Connect mosfet source to Arduino ground, drain to pH module ground, and gate to an Arduino pin configured as an output. Set the pin LOW most of the time. When you want to take a reading, set the pin HIGH, delay for a while (you will have to experiment to see how much delay you need), take the reading, then set the pin LOW again.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

armeniki

Hi everyone, as promised I am back reporting on what I've done with the results.

By the way, I'm not sure why you were told to get a MOSFET involved.. That's not necessary.

So, basically what I have done is take the +5VDC and GND from the arduino board to a dc to dc converter.  I used a Murata NME0505SC.

Then it's quite simple, take two 6N137 optocouplers and wire one to the RX and the other to TX. You'll need to use two resistors for each one, I just used 430R and then you need to put a .01 microfarad cap between pin 5 and 8 for each one per the datasheet. Obviously each of them will be on the separate ground/potentials.

Anyway, everything works perfectly now!! Yay! I have my readings stable and accurate with the probe circuit electrically isolated.


Krodal

Good to hear you have it working !

About grounding the water of the aquarium. I think that it might be a good idea. But for safety you could use a resistor of about 1M ohm between the water and the ground. Use a large (long) resistor or use two resistors of 1M in series. The will avoid a static charge to build up.

vrgomes

Hi now I understand how to use the mosfet. Whel I will try like dc42 said...

Quote
Hi everyone, as promised I am back reporting on what I've done with the results.

By the way, I'm not sure why you were told to get a MOSFET involved.. That's not necessary.

So, basically what I have done is take the +5VDC and GND from the arduino board to a dc to dc converter.  I used a Murata NME0505SC.

Then it's quite simple, take two 6N137 optocouplers and wire one to the RX and the other to TX. You'll need to use two resistors for each one, I just used 430R and then you need to put a .01 microfarad cap between pin 5 and 8 for each one per the datasheet. Obviously each of them will be on the separate ground/potentials.

Anyway, everything works perfectly now!! Yay! I have my readings stable and accurate with the probe circuit electrically isolated.


Can you post photos and the schematics of your design?
I will be really helpful, in case the mosfet don't work I can try this way!

Thanks you guys ;)

Go Up