## How to convert resistance to voltage

Converting resistance to voltage in electronics sometimes are so important. This happens because many electronics device such as microcontroller only can read voltage as analog input signal. Analog signal then will be converted to digital using ADC. But before we talk about ADC or microcontoller, how if our sensor has resistance output instead of voltage?

#### Voltage Divider as resistance to voltage converter

The only thing we can do to make our sensor readable by microcontroller is convert resistance to voltage. Converting a resistance to voltage is far more easier than converting to other quantity. So, how we do that?

The answer is very simple. Use voltage divider !

Voltage divider has capability to divide the voltage by comparison of two resistance. You can read more details about voltage divider here.

#### Application Example

I use an LDR for a light sensor. LDR has linear resistance to the light that exposed to it surface. When light getting brighter, the resistance will decreased. Otherwise when light brightness dercreases the resistance will increases. Here’s my schematic example:

The output voltage will be :

In this example, when light density is changed, the LDR resistance will changed too and of course Voltage output will changed accordingly.

Since the voltage will change in every change of light density, then you can connect this voltage output to an microcontroller ADC.

#### Little Tips

Pick the right R2 has a little trick. You have to choose the closest one to LDR reistance range to make the voltage output difference better. For example, if your LDR resistance will vary between 800 ohm to 1k ohm then used 1k ohm resistor as R2 will be ok. But if you has LDR with resistance output vary from 8k-10k don’t use 1k as R2, using 10k as R2 will better.

## Understanding Voltage Divider

Just like the term, voltage divider means dividing the voltage into smaller value. Sometimes this is very useful if we had only measurement instrument with limited maximum value. Such as pocket oscilloscope.

#### Understanding Voltage Divider

Dividing voltage is very simple job but very powerful. We just need two resistor to do it. Here’s the example how we do it.

Consider we have 10V voltage, using two resistor will result 5v at the output. This is how we calculate it :

Vout = Vin * R1/(R1+R2)

So if we want to divide the voltage by 3. You can simply change the R2 to 2k. So the output will be :

Vout = 10 * 1k/(1k+2k) = 3,333 V

#### Voltage Divider Application Example

In some cases, voltage divider is very useful for signal conditioning. For example, you have to sense a voltage from a power supply using an arduino or other microcontroller. The power supply can generate voltage from 0V-50V. Unfortunately, your arduino can sense voltage only from 0V-5V. That’s why voltage divider come in handy. You can just divide voltage from power supply by 10. So the output will only produce voltage between 0V to 5V and you can read using arduino ADC easily.

Beside divide the voltage, you can use voltage divider to convert resistance based sensor to voltage. For example a light dependent resistor (LDR).

Take a look at picture above. We already know that LDR will vary the resistance by how much light that exposed to it. This will make easier to read voltage output from different light brightness.

#### Voltage Divider is not for Power Supply

If you are new to electronics and think to use voltage divider for power supply then you are wrong. Why not for power supply? Voltage divider works with big resistors, so it will produce very small current. Small current cannot used for power supply. You can user linear regulator or switching power supply instead.