Go Down

Topic: Arduino soil moisture sensor and voltage divider (Read 3385 times) previous topic - next topic

Rask

Trying to figure out where Im going wrong with this test I am playing around with.

Hooking up a soil moisture sensor to an Arduino Uno and reading the analog value = all fine and dandy.
Powering with 5V and getting 0-5V range out of it.

Then I thought Id try and set a voltage divider to get the analog range from 0-1V.
So I do the ordinary basic voltage divider 100k/27k and measure the output from this.
Still powering the sensor from the Arduino

The output from the voltage divider reads 0V...

The soil moisture sensor works fine without the voltage divider, the voltage divider works fine without the soil moisture sensor...

Could someone smarter than me please give me a hint where things go wrong?

Attached is a quick Fritzing sketch of my test setup.


This post describes the same problem.
http://www.esp8266.com/viewtopic.php?f=13&t=9832


DVDdoug

Do you have something that shows how the moisture sensor is supposed to be wired?


I assume you're checking the voltage with a multimeter?    (Your drawing doesn't show an "analog" connection to the Arduino.)

TomGeorge

Hi,
The moisture sensor relies on the high input impedance of the arduino input to work, using a potential divider turns the AtoD input into a much lower impedance input.
OPs Pic.

If you want to scale the output of the sensor you will have to buffer it with an op-amp.

Long term immersion of those sensors will cause corrosion and variations in readings.

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

arduinoaleman

#3
Jan 04, 2017, 11:10 pm Last Edit: Jan 04, 2017, 11:13 pm by arduinoaleman
If your diagram is correct it will never work!

1) The sensor is NOT connected to ground. The ground pin is connected to +5V.

2) When using a voltage divider you take the signal between the the two resistors.
   (A voltage divider is NOT required if the input signal is lower than 5Volts.

3) The way it looks, non of your analogue inputs is connected to anything.

I am amazed how you can make so many mistakes with that few components.


By the way, if the sensor uses copper strips .... plants do not like copper at all. For plants copper is like poison.
If your questions are not precise, nobody can help you.

Rask

If your diagram is correct it will never work!

1) The sensor is NOT connected to ground. The ground pin is connected to +5V.

2) When using a voltage divider you take the signal between the the two resistors.
   (A voltage divider is NOT required if the input signal is lower than 5Volts.

3) The way it looks, non of your analogue inputs is connected to anything.

I am amazed how you can make so many mistakes with that few components.


By the way, if the sensor uses copper strips .... plants do not like copper at all. For plants copper is like poison.
Well that Fritzing episode didnt help...

1) This is classified as a fritzing failure. The sensor is connected to GND
2) The signal is taken between the resistors, the same setup but with a potentiometer instead of the sensor works like a charm. With potentiometer setup the voltage measured at the voltage divider is 0-1V.
3) This test was meant to play with the voltage output and the possibility of limit that to 0-1V. Therefore I am only using the Arduino board to power the setup. DVDdougs assumption is correct here
In a real scenario I would of course connect the A0 for some relevant data.

My wondering is still how the sensor affect my voltage divider since it works fine with a potentiometer.

Not really sure about the comment of using an op-amp in this case? How would that change the voltage output from the divider?

I also would like to thank you for your concern regarding my plants. No real plants was harmed during this experiment, I am only torturing a glass of water at this point!

TomGeorge

Hi,
Quote
My wondering is still how the sensor affect my voltage divider since it works fine with a potentiometer.
Your sensor on its own is basically a potential divider, however it is a high impedance divider, in that it can only supply very small amount of current.
This is okay when you connect it directly to the high impedance UNO AtoD.

When you make your own divider, it is a  relatively low impedance circuit an you sensor cannot supply the current, so its output is low or 0V.
The potentiometer is acting as a relatively LOW impedance sensor and can supply the current your divider needs without its output being compromised.
A buffer op-amp act like a high impedance amplifier with low impedance output.

These conductive sensors I would regard as toy sensors, if you need good relaible type you may have to investigate more.

There are circuits around for AC driven sensors to overcome electrolytic corrosion. (google is your friend.)

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Rask

Hi,Your sensor on its own is basically a potential divider, however it is a high impedance divider, in that it can only supply very small amount of current.
This is okay when you connect it directly to the high impedance UNO AtoD.

When you make your own divider, it is a  relatively low impedance circuit an you sensor cannot supply the current, so its output is low or 0V.
The potentiometer is acting as a relatively LOW impedance sensor and can supply the current your divider needs without its output being compromised.
A buffer op-amp act like a high impedance amplifier with low impedance output.

These conductive sensors I would regard as toy sensors, if you need good reliable type you may have to investigate more.

There are circuits around for AC driven sensors to overcome electrolytic corrosion. (google is your friend.)

Tom... :)
Thanks Tom for trying to clear things out!
My old and dusty electronics knowledge keeps connecting the term impedance with AC and not DC but I see what you mean...
This could of course explain why the test with the sensor connected to a NodeMCU (https://www.seeedstudio.com/NodeMCU-v2-Lua-based-ESP8266-development-kit-p-2415.html#) is giving me strange values then. After some digging it seems that this card has a built in voltage divider on A0 to provide the onboard ESP8266 WiFi with 0-1V range.

I do completely agree that the sensor is a toy, but so is my level of knowledge also so its all good then :)

My conclusion for future tests is that the easy solution is to find sensors with the correct range according to the desired analog port on the card.

I might check out the Adafruit HUZZAH (https://www.adafruit.com/product/2821) (Analg range 0-1V) for some new forms of headache and I might be back with more questions :)

Thanks again!

Go Up