OBJECTIVE
The objective here is to build an ohmmeter, which is a device for measuring resistance. The approach that we will use is to make a voltage divider circuit. This will consist of two different resistances. One will be fixed and the other will be the one which we wish to test. Because the two resistances are in series this means that the same current will flow through both of them. We can calculate the voltages across the two resistances because we know that the Arduino is supplying 5v to the voltage divider, which will be divided across the resistances, depending on their values; the higher the resistance, the greater the voltage drop. Since we can calculate the voltages across both resitances, we can use Ohm’s law (R =V/I) to derive the unknown resistance.
This works well when the unknown value is close to that of the known value. When there is a large gap, it becomes unreliable.
How could we remove this limitation? If you have ever used an ohmmeter then you may have an idea for a solution! On many ohmmeters you need to select a range that you believe the unknown value will fall between. Therefore we could have a selection of known resistor values to select from to allow us to choose a range! However, it is not just the hardware that we will need to modify, we will need to modify our code as well. We could have a physical switch but we could modify the hardware and software so that we can select it electronically.
THE CODE
We now have an ohmmeter that will identify an unknown resistance and display its value on the serial monitor. Now let us improve our project by printing its value to an LCD. We will also add some text.