# Voltage Dividers for a beginner (with respect to soil moisture sensors)

I've just started with electronics and want to make an analogue soil moisture sensor (with Arduino).

When I looked online for an explanation of the working, every site said that it works as a voltage divider.

These are my questions:

1. What exactly is a voltage divider? How does it work (for a beginner) ?
2. The tutorial said that a wire has to be connected from the Vcc to an analogue pin on the Arduino for the readings. But how can a wire from the Vcc send analogue signals about the soil's resistance? Doesn't it just supply power?
3. The tutorial mentioned a capacitor between the Ground and the signal wire for filtering noise. What is this noise? How can the capacitor filter it? Why does it need to be filtered?

I've attached an image of a part of the tutorial for reference. Thanks a lot and apologies for my silly questions (couldn't find a satisfying explanation elsewhere) .

• Welcome to EE.SE! It will be easier for people to help you if you add links to datasheets for the sensors you have in mind and to the tutorials you mention. Jul 19 '18 at 11:36

The voltage division is between the 57K resistor and the soil resistance (which is not shown and can be modeled as a resistor to ground - the actual dirt ground which must be connected to circuit ground). The output voltage will be Vcc * Rx/(57K + Rx). The DC resistance the analog input sees can be as high as 57K, which is above the recommended level for the Atmel/Microchip MCU used in the Arduino by more than 5:1.

Noise comes from the environment primarily in this case since there are radio transmitters and mains electric fields present. In another context, that noise might be your signal. Noise applies to unwanted signals of any kind. Capacitors present a low impedance to AC signals and can help reduce that noise to a negligible value, but present a high impedance to low frequencies so the voltage at the divider output (and Arduino input) will approach the ideal value albeit relatively slowly (within a second or so it will be stable).

The electrolyis mentioned in your snippet is the electrochemical corrosion of the electrodes due to the potential present. Eliminating the DC voltage (for example, by flipping polarity or using an AC signal to measure) will minimize the problem.

We all had to start somewhere, and it can be tricky to find a place to begin. I suggest looking at Sparkfun's website tutorials. They cover all of this in detail.

https://learn.sparkfun.com/tutorials/voltage-dividers

What exactly is a voltage divider? How does it work (for a beginner)

If you have 5 volts across a 5 kohm resistor then 1 mA flows through the resistor. That's ohms law: I = V/R. If instead of one 5 kohm resistor you had 2 series resistors of 2.5 kohm each you still get 1 mA flowing but the voltage across each resistor is only 2.5 volts because, rearranging ohms law to this: V = IR you get 1 mA x 2500 ohms. That is the very basic explanation of a voltage divider.

The tutorial said that a wire has to be connected from the Vcc to an analogue pin on the Arduino for the readings. But how can a wire from the Vcc send analogue signals about the soil's resistance? Doesn't it just supply power?

Look closely at the picture in your question and note the resistor (appears to be 57 kohm): - So, there is a resistor in series with the power feed to your moisture sensor probes and, if the soil had a resistance of 57 kohm, then the voltage across the soil probe would be half of the supply voltage (Vcc).

The tutorial mentioned a capacitor between the Ground and the signal wire for filtering noise. What is this noise? How can the capacitor filter it? Why does it need to be filtered?

Well, your soil will "pick up" all sorts of AC signals especially 50/60 Hz and this will become superimposed on the DC level that represents your soil's resistance. That AC signal may be large enough to make taking DC measurements a bit tricky so the capacitor will flatten out that AC signal leaving mainly just the DC signal you want to measure.

1. What exactly is a voltage divider? How does it work (for a beginner)? Voltage Divider is a simple circuit that divides the voltage. As we know from that in the series circuit there is a voltage drop across every component so to form a voltage divider we connect two resistors in series and we take output voltage across the 2nd resistor which gives the desired output voltage. Now the only hurdle is to choose the values of resistors with respect to input voltage supply. Let's say you want 2.5 volts at the output and you have 5V input, so according to Voltage Divider Law we have to choose R1=1k & also R2=1k: Output = (1k/(1k + 1k))*5 V = 2.5 V