11 Replies Latest reply on May 1, 2015 6:24 PM by DaKn_263916

# Make an ammeter using PSoC 3

I have a task to make an ammeter using PSoC 3, my teacher give me an example like voltmeter using PSoC 3 in PSoC 3/5 Reference Book, can any one help me for this? what is algorithm for this?

i have found two methods for current measurement, single/multiple channer current measurement using PGA dan current measurement using TIA. Thanks.

• ###### 1. Re: Make an ammeter using PSoC 3

Use the voltmeter approach and measure the voltage over a shunt resistor. Keep in mind that the input for a PSoC must be in the range of GND < Vin < VDD

Bob

• ###### 2. Re: Make an ammeter using PSoC 3

how to add shunt resistor in TopDesign.cysch ? i am sorry, i am new for this.

like this pic or not?

• ###### 3. Re: Make an ammeter using PSoC 3

Yes, nearly.R1 is your shunt, but in series to that will be your consumer (another resistor, but unknown). In your picture the volotage you measure will always be Vdd.

Bob

• ###### 4. Re: Make an ammeter using PSoC 3

oh, did you mean using voltage divider circuit like this? so the R1 is shunt and R2 is Rreference

• ###### 5. Re: Make an ammeter using PSoC 3

R2 is not the reference, it is the unknown R where the current I flows through. The same current flows through your R1, so with Ohm's law you get I = Umeasured / R1

To reduce errors further, have a look at this application note concerning "Correlated Double Sampling" (CDS)

Bob

• ###### 6. Re: Make an ammeter using PSoC 3

oke, thank you.
i used code like voltmeter example and add some new for current measurement. i hope you can check it and correct me if i'm wrong.

#include <device.h>

#include <stdio.h>

int main()

{

float Rshunt;

char tmpStr[25];

PGA_Start();

LCD_Start();

LCD_Position(0,0);

LCD_PrintString("PSoC Ammeter" );

for(;;)

{

{

LCD_Position(1,0);

LCD_PrintString(tmpStr);

}

}

}

and i make the block diagram like this.

• ###### 7. Re: Make an ammeter using PSoC 3

A more precision approach would be to eliminate the PGA and use

the A/D differentially, so connect its - input iput to the pin that connects

to the low side of the shunt.

Also set A/D up with bypass buffer so that you can get rail to rail performance.

In your code you did not set the value of Rshunt.

Regards, Dana.

• ###### 8. Re: Make an ammeter using PSoC 3

Oh thanks for the tips, i've recently read this method in "AN84783", thank you.

like this "try again" pic?

so what is the different for current measurement usig this method, PGA and TIA?

• ###### 9. Re: Make an ammeter using PSoC 3

Yes, thats the correct schematic. Basically by not using TIA or PGA

you eliminate errors associated with their signal path, like V and I offsets,

noise....

Also by using differential mode you eliminate common mode voltage

errors.

Here is more than you want to know about errors -

www.dropbox.com/s/ruaf9booe17jk8n/PCB%20Layout.zip

www.dropbox.com/s/plck7e95v7pw33c/CMR%20Analysis%20IA.pdf

Regards, Dana.

• ###### 10. Re: Make an ammeter using PSoC 3

oke, thank you for the tips mister dana.

oh ya, so what the pin that i can use for this design?

• ###### 11. Re: Make an ammeter using PSoC 3

Take a look at these -

http://www.cypress.com/?rID=40247     AN58827 - PSoC® 3 and PSoC 5LP Internal Analog Routing Considerations

http://www.cypress.com/?rID=39974     AN58304 - PSoC® 3 and PSoC 5LP – Pin Selection for Analog Designs

http://www.cypress.com/?rID=57571     AN72382 - Using PSoC® 3 and PSoC 5LP GPIO Pins

http://www.cypress.com/?rID=39677     AN57821 - PSoC® 3, PSoC 4, and PSoC 5LP Mixed Signal Circuit Board Layout Considerations

Regards, Dana.