Analog sensor help

Hello everyone. This is such a helpful community. I got in over my head. I'm hoping I have come to the right place.

I have been struggling with an analog sensor circuit I designed and am growing tired of ordering parts just to find out that I need something else.

I am using an Arduino Mega with a wing protoshield (screw terminals) and a w5100 ethernet shield. The sensors I am hooking up are the VH400 from Vegetronix. It reads soil moisture and outputs a 0-3V signal. When I had only one sensor hooked up everything seemed fine. Now that I have 14 fully wired it appears the signal is unreliable, skewing towards too high a voltage.

I do not have a diagram but I can try to sketch one up if needed. I will do my best to describe the wiring: A 12v 1A wall wart (switching I believe but I can check) powers a bus. All fourteen sensors connect via that bus. The sensors are 13mA I believe. The Arduino is also wired to the bus via the dc input jack. Each sensor is then connected to the analog sensors on the arduino. Wiring used is shielded, with the dc neutral running on a conductor as well as the shield. (I should stop to mention here that during testing I did not believe this sensor would work in a high RF environment but it worked fine with this wiring. It is now in a lower rf environment.) All wires are connected with insulated quick disconnect terminals. The power bus and the arduino are wired in a metal electrical box, which is also tied to the dc neutral, although removing that bond didn't seem to affect anything.

Right now I believe I just need an op amp for each sensor. Which means rewiring everything. I also ordered an op amp, not realizing I was ordering something much smaller than I am capable of soldering or using on a breadboard.

I have linked a wiring diagram from Vegetronix that shows how to wire this into a larger sprinkler system. What is not clear to me is if I only need the op amp or if I need all the parts. I am just looking to be done with this project as it has gone on far too long.

Thanks for any help.

In this design -linked circuit is nit using arduino
You need all components, you can replace 2 op amp by tl072, for soldering problem use DIP package.
The simple way - with arduino
Connect sensor directly to arduino (you say is producing 3V - are you shure ?) analog input and control MOSFET by it.

You shouldn’t need an op-amp.

Do they all work individually one at-a-time when you modify your code to read just one sensor?

Now that I have 14 fully wired it appears the signal is unreliable, skewing towards too high a voltage.

The ATmega chip has only one multiplexed (shared) analog-to-digital converter and it needs some settling time when switching between inputs. Try reading each sensor reading twice in a row, ignoring the 1st reading.

And if that doesn’t help, check the voltage with a multimeter. (If you don’t have a multimeter, it’s time to get one. :wink: )

Do you have a schematic ?

Are the sensors electrically connected through the soil? Place them in isolated plant pots and test again. Even if this doesn't solve the problem, it helps understand the source of the problem.

DVDdoug:
You shouldn't need an op-amp.

In his link the first op amp is used for high impedance input, the second one as amplifier.

Those are voltage follower buffers on the input.
ContactClosureSchematic.pdf (20.7 KB)

I know that, I have give info what they do

ted:
In this design -linked circuit is nit using arduino
You need all components, you can replace 2 op amp by tl072, for soldering problem use DIP package.
The simple way - with arduino
Connect sensor directly to arduino (you say is producing 3V - are you shure ?) analog input and control MOSFET by it.

I am sure it is a 3V max output. The sensor reads 3v on a multimeter when completely submerged in water and near zero when dry. This is on a 9v battery and also my 12v wall wart.

DVDdoug:
You shouldn't need an op-amp.

Do they all work individually one at-a-time when you modify your code to read just one sensor?
The ATmega chip has only one multiplexed (shared) analog-to-digital converter and it needs some settling time when switching between inputs. Try reading each sensor reading twice in a row, ignoring the 1st reading.

And if that doesn't help, check the voltage with a multimeter. (If you don't have a multimeter, it's time to get one. :wink: )

Thank you. This is now going to be my first step. I have an array for all fourteen sensors. I should be able to figure it out, but if not Ill be back :slight_smile:

raschemmel:
Do you have a schematic ?

I will draw one up shortly if I am not able to fix it with code. But if I do that I expect it to be crude :).

MorganS:
Are the sensors electrically connected through the soil? Place them in isolated plant pots and test again. Even if this doesn't solve the problem, it helps understand the source of the problem.

They are already in separate pots, with foam insulation under the pots.

Thanks everyone for the help so far. I will report back, hopefully tonight.

mattpre:
I am sure it is a 3V max output. The sensor reads 3v on a multimeter when completely submerged in water and near zero when dry. This is on a 9v battery and also my 12v wall wart.

I will draw one up shortly if I am not able to fix it with code. But if I do that I expect it to be crude :).

Crude or not it is doesn't matter but will clarify what is going on.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Your code is essential as we need to see how you are reading the analog inputs.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Concentrate on one sensor, measure resistance - sensor not in water - between center wire and;

  1. negative terminal, it is around 200 ohm ?
  2. positive terminal , it is open or in range of megaohm ?