At last, finished making a 7$ Auto Ranging Ohm- Meter!
That includes 4$ PSoC kit + 2$ LCD + 1$ Breadboard
New version of this project hereSpecification
- Range : 10 Ohms to about 100 kOhms
- Accuracy : Acceptable (not tested in details, about 5% error above 100k and below 100 ohms)
- Unit : Shown in Ohms Symbol
- Display : Crisp & Backlit
- Update : Fast Update Supported
- Upgradable : to continuity checker, voltmeter, cap meter with few more code
Yes, not much! But what can you expect from 8 bit DAC and 12 bit ADC, normal DMM has 16 bit ADC or more!
But its AUTO RANGING and FASTER than many real Multimeter!
The working principle is very simple, IDAC (Digital to Analog Current Converter) injects known uA current through unknown Resistor, some voltage drops across that Resistor. ADC measures that Voltage drop and ARM CPU Calculated the Resistance in Ohms
Ohms = Voltage / Current.The Auto Ranging Trick
So, how dose the auto ranging works ? Well, this PSoC chip got a 8 bit IDAC module which can inject programmable current from 1.2uA ~ 306 uA in steps of 1.2 uA. (8bit = 255 values = 306uA / 1.2uA ---- all the same).
We know V= I x R
where I is the IDAC Current and R is the Unknown Resistance.
But wait, what if R is too large or Open Circuit, will V exceed the supply voltage ( 5 volts here) of the PSoC ? No, in that case V will reach maximum supply voltage.
Facts about IDAC:
- IDAC is a current source/sink, so you can short it to Ground or V supply.
- IDAC pin goes to 5 volt when set current (suppose you set 3.6 uA current but it cant flow through the load) can not flow.
- IDAC pin goes to Gnd potential when shorted to Gnd.
- IDAC consumes Analog Routing (paths inside PSoC, which is a limited resource).
The 12 bit ADC can be configured as
- Single Ended ( range from Gnd to V ref)
- Unsigned ( makes Max range = 2*Vref)
- 12bit (4096 discrete values )
- Internal Vref of 1.024 volts
Which means, in this project the ADC is configured to measure from 0 volts to 2048 mV in resolution of 0.5 micro-volts. (2048/0.5= 4096 values).
Now, suppose we have an unknown R, first we start injecting with the highest IDAC current (which is 306 uA), if the V drop exceed 2000 mV (which equals to 4000 of ADC Data), MCU reduces the IDAC by one step and measures again with ADC, this keeps happening until a voltage drop is found with in the range of 0 to 2000 mV.
Now the CPU knows the V across R from ADC, which is converted into micro volt.
From the IDAC's last set value, current I Inject is calculate I= IDAC_Val * 1.2 uA (micro amp).
Finally, CPU calculates resistance form uV/uA = Ohms.
The on kit switch P0.7 can not be used during runtime because it is used as one of the LCD pin but it can still be used to enter bootloader programming during power up!
Reboot Timer saves the annoyance of plugging and unplugging the kit on usb during debugging/programming. It's not part of the Auto Range Ohm Meter Project.