# Cypress Developer CommunityTM

## Can I measure current 0-20mA directly with the PSoc3?

Summary: 10 Replies, Latest post by danaaknight on 03 May 2013 04:28 PM PDT
User
4 posts

I have searched on applications notes and on forum but i haven't found a measurement current of 20mA directly with the psoc3 and development kit CY8CKIT-030.

Is it possible?

Escuse-me for my english, I am french.

Thank you

User
9274 posts

Easiest would be to let the 20mA flow through a resistor (shunt) and measure the voltage across and then have the PSoC3 digitize that with the ADC. Calculate with Ohm's law the needed shunt and the needed max. voltage across.

Dana wil probably advise you to make an error-calculation for your design based on the precision you need for your results...

Bob

User
7646 posts

If you are simply trying to measure a current, A/D and a Rsense to convert

I to V is all thats needed. But then you have to consider common mode

range needed for A/D. If Rsense is place in series with load in ground leg

that will meet CM range of A/D. If you do high side measurement then

you will need an external high side circuit, translator in effect. An example

of one -

www.planetanalog.com/document.asp

Hall effect -

Regards, Dana.

User
4 posts

I wondered if the current 0-20mA  could be injected directly into the PSoC and then measured without external component and with a TIA or other things but apparently it is impossible.

Sylvain

User
7646 posts

The TIA does not have a low enough value R to handle 20 mA.

You could take a look at injecting current into an output pin driven low,

into saturation region of MOSFET output. But problem with this is

device to device variation of Rdson. If you did a production cal at

production test then you could correct for this variability. A/D would

be used on pin to measure voltage, hence compute current based

on measured V and knowlege of Rdson.

Another issue is complience range of a pin used like this would be

Vddio + .5V.

Regards, Dana.

User
7646 posts

You would also have T to contend with -

User
407 posts

Sources 4-20 mA allow the inclusion of low-resistance resistor in the circuit.
Bob suggested the use of a shunt. I do like the image below.
Of course there is no galvanic isolation.

Attachments:
User
7646 posts

Some questions -

1) Is this a 4/20 mA current loop or just a single ended current source sinking to ground ?

2) Current source bipolar or mono ?

3) Range is 0 - 20 mA  or 4 - 20 mA ?

4) You want to measure current in hot side of load or ground side ?

5) Accuracy (absolute) you are trying to achive ?

6) Resolution of current measurment ?

7) Sample rate of measurements to be made ?

8) Current source DC or comprising a lot of noise ?

9) Absolute max peak current provided by source ?

Regards, Dana.

User
7646 posts

The solution with TIA not appropriate. This is because you are settting G with external

R, thereby converting TIA to V amplifier. Reason is the onchip 20K TIA R has, most likely,

a horrible absolute value, 60% according to DS. Rather use a PGA, where G is a f( R/R ),

and onchip accuracies of ratioed R's is quite good, see G spec for PGA, at highest G 5%

G accuracy.

Note A/D has a G programmable input buffer, 1, 2 , 4 , 8 G's are available. If more G needed

use PGA.

Regards, Dana.

User
1362 posts

Looks like you want to use 20MA current loop for digital communication.
I would avoid measuring current directly as it most likely causing GROUNDING issue later on.
I would prefer to use opto-coupling.

User
7646 posts

This may help, attached, if current loop....

Regards, Dana.

Attachments: