I know it is possible to measure analog voltages with the ADC peripheral of advanced PIC microcontrollers. There is no peripheral to measure current though.

Is it possible to convert a current to a voltage so that I can measure that voltage with the ADC peripheral? Or are there ICs with serial or parallel output of a measured current? I'd rather have serial, with I2C or SPI.

I'll have to measure currents up to 200mA with fewer than 5mA deviation. The PIC I'm using is a PIC18F46K22, but that's probably no useful information.
I'll measure the currents of 5V / 3.3V chips connected to the PIC microcontroller (like LCD, RAM, other PIC, ...) so the current will go to ground. Also, a few tenths of a volt voltage drop is allowed.

  • 1
    \$\begingroup\$ The simplest technique is the voltage drop across a known resister generates a known voltage you can read from one of your ADCs. \$\endgroup\$ – kenny Jan 18 '13 at 12:59
  • \$\begingroup\$ I knew I was forgetting something. You may submit this as an answer (I'll wait with accepting it though) \$\endgroup\$ – user17592 Jan 18 '13 at 13:02
  • \$\begingroup\$ As others have already noted, current to voltage converters are called resistors. However, that's the easy part. Is this current going to ground? Do you need to measure it in a segment that is floating somewhere? How much voltage drop can be tolerated? The circuit will look very different depending on these answers. \$\endgroup\$ – Olin Lathrop Jan 18 '13 at 13:14
  • \$\begingroup\$ I don't quite get what you mean with 'a segment that is floating somewhere'? I'll use this to measure the current drawn by several 5V / 3.3V devices, so the current goes to ground. They are quite tolerant, so a few tenths of a volt is OK. I'll add this to my question as well, good point! \$\endgroup\$ – user17592 Jan 18 '13 at 13:18
  • 2
    \$\begingroup\$ @CamilStaps - "floating" means that neither end of the "segment" is at ground, so it makes it more difficult to measure the voltage across it with e.g. a microcontoller ADC which (usually) has ground as it's low reference. In this case a differential measurement setup is required. \$\endgroup\$ – Oli Glaser Jan 18 '13 at 14:06

There are many current-to-voltage converters out there. The simplest is a resistor. Make it small to reduce losses or big to make the voltage big enough to cover your entire ADC range. Or, make it small to reduce losses and amplify it with an op-amp circuit to cover your entire ADC range.

Another often overlooked current-to-voltage converter is a MOSFET that's on, which is pretty close to a resistor. Perhaps not as accurate, but many circuits that require current measurement already have a switching MOSFET in them, so this method is cheap and convenient. The datasheet will list the on resistance as \$R_{DS\_ON}\$.

For a step up in sophistication, look for hall effect sensors. Hall effect sensors measure magnetic fields; some of them are configured to measure the magnetic flux associated with a current passing through a wire. Here's an example product page to give you an idea. However, at \$200mA\$, I don't see much need. Typically this sort of product comes into play when the current is high enough that a resistor, even a small one, would represent a significant loss.

  • 1
    \$\begingroup\$ Allegro Hall Effect sensors are suboptimal for 200 mA current measurement: Full scale ratings are for 5 Amperes and up. Therefore the precision achieved at 4% of this rating will be pretty poor. Not aware of any other Hall Effect current sensors for lower currents. \$\endgroup\$ – Anindo Ghosh Jan 18 '13 at 13:43
  • \$\begingroup\$ @AnindoGhosh good point. Admittedly, I just posted the first product page I found with google. Edited the answer a bit. \$\endgroup\$ – Phil Frost Jan 18 '13 at 16:26

Moved from comment to answer on request of the poster.

The simplest technique is the voltage drop across a known resister generates a known voltage you can read from one of your ADCs.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy