Page 1 of 1

### Does Microcontroller read current values

Posted: Thu Jun 25, 2015 1:00 pm
I am using an ATMEL ATMEGA 324p. So, we use microcontroller's analog input pin to give an input voltage of 0 to 5V from sensors, etc (first, we scale down the voltage to 0 to 5V using voltage dividers, as microcontroller only accepts maximum of 5V)... what about current values... what if i am using a current transformer and need to give that input to microcontroller...

And I have another doubt as well, what is AREF pin for ??? Should we give an input of 5V to that pin compulsorily or what it is for.
Suppose I have to compare two analog values of 0 to 5V (one is reference which is set by POT and another is coming from speed feedback) and based on the error of these two signals i have to control a variable... how should it be done...

Thank you
Time and effort spend for helping - Very much appreciated.

### Re: Does Microcontroller read current values

Posted: Thu Jun 25, 2015 2:01 pm
ARef is analog reference voltage input to microprocessor. Optional if you want a precision reference for the A/D. (ADC).

Current transformer will produce a voltage that corresponds to the amount of current flow being sensed. Just use an ADC to observe the voltage, then use the vendor's spec to compute or table-lookup the current (Amps or milliamps) corresponding to the reported voltage.

### Re: Does Microcontroller read current values

Posted: Fri Jun 26, 2015 8:44 am
Not if "current transformer" is meant as the "dual coils around a (ferrous) core" kind. As that only works for AC currents, not DC currents. So, better give an example of what you have in mind as current transformer.

### Re: Does Microcontroller read current values

Posted: Fri Jun 26, 2015 9:12 am
Ferrite core current transformer... measures only AC... the ring type... with current ratio 1000:1

### Re: Does Microcontroller read current values

Posted: Fri Jun 26, 2015 9:35 am
Well, it transforms the current to a higher or lower current (depends which is used as primary or secondary side) , but the voltage likewise in the opposite way. However, this requires AC currents, positive and negative currents to work. You can't transform DC currents with it. And microcontroller analog inputs can only do something with positive voltages. So it won't work. Even worse, the negative side of the wave could kill it.

If you want to measure dc currents then you could measure the voltage across a shunt resistor with an instrumentation amplifier or more basic an opamp, and amplify/convert that to the desired ADC input voltage.

Now it starts to get important you tell us exactly where these currents are comming from. Before you attempt to connect a transformer core between a mains-appliance and your AVR/arduino microcontroller. And set the house on fire.

### Re: Does Microcontroller read current values

Posted: Fri Jun 26, 2015 9:55 am
Thanks for your reply.... This is about machines and drives... The current transformer is to measure the motor current (0 to 9 Amps max), so the C.T transforms it to 0 to some milliamps since it has a 1000:5 current ratio... So I have to put a shunt resistor and measure the voltage drop across it, of course I have to put up a low pass filter to filter noise and a rectifier to convert that a.c voltage signal to D.C somewhere... and the op-amp to amplify...
The reason I asked is, in the textbooks they simply say, current reference is given by us, and the current feedback from current transformer is compared with the reference current, and the error is give to PI controller which produces a control voltage which is what we want in the end.... so i was wondering how, is it currents or just voltages proportional to currents...

### Re: Does Microcontroller read current values

Posted: Fri Jun 26, 2015 10:07 am
As I am still not knowing which of kind of motor you are referring to I was only speaking in general terms. I am not saying a shunt resistor or current transformer is required in your case. Please be more specific in the details of the motors, motor power supplies and such. I may not have the right experience with this sort of thing, but I do recognize when information is lacking.