PSoC : Auto Ranging Ohms Meter

About the project

Utilizing IDAC to inject current through unknown Resistor & measuring Voltage across it with 12 bit ADC finally Ohms Law to find Resistance.

Project info

Difficulty: Easy

Platforms: AdafruitCypress

Estimated time: 1 hour

License: GNU Lesser General Public License version 3 or later (LGPL3+)

Items used in this project

Hardware components

Tiny Breadboard Tiny Breadboard x 1
Tiny Breadboard Tiny Breadboard x 1
Standard LCD 16x2 white on blue Standard LCD 16x2 white on blue x 1
Jumper Wire Kit - 140pcs Jumper Wire Kit - 140pcs x 1

Software apps and online services

Cypress PSOC CReator 3.0 Cypress PSOC CReator 3.0

Story

At last, finished making a 7$ Auto Ranging Ohm- Meter!

That includes 4$ PSoC kit + 2$ LCD + 1$ Breadboard

New version of this project here

Specification

  • 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!

psoc ohm meter

Working Principle

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).

Configuring the 12-Bit ADC

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

ADC Setting

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.

1 / 7Ohming in Action

The Ohm Symbol

Ohm Symbol

Notes

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.

Schematics, diagrams and documents

PSoC Intern Sch

Inside PSoC Creator

CAD, enclosures and custom parts

PSoC Project File

PSoC Creator Files

Go to download

Code

Main C

The Auto Ranging part and Display Control

Credits

Leave your feedback...