PDA

View Full Version : Pic Ammeter



RYTECH
- 29th December 2005, 14:01
I'm interested to know how much current my project consumes... is it possible to rig one of my other anolog inputs with some kind of shunt and opamp to do just this? can someone post a schematic?

RYTECH
- 29th December 2005, 19:00
specifically I'd like to monitor the total current consumed of the 12v source, i'm already monitoring the voltage of the 12v source using a voltage divider and my pic's a/d module

Can somebody post a configuration for me to get the current consumption data? ... PIC16F872, 12v's wants to meter power into 7805, also if this is "easy" i wouldnt mind metering the current in from my solar cells which are connected... so i get Current in and out... :)

thanks please tell me how or point me to a working example (i've googled.. but nothing helpful besides the info i need a shunt and op amp) :)

Ingvar
- 30th December 2005, 11:15
Maxim have several "current sensors", one that springs to mind is MAX4172.

ero
- 31st December 2005, 10:37
@rytech,
I have made similar system by using a pic. I explain you how it can be done.
The components;
1 pce. LM358 opamp
2 pcs. res. 1K 1/8 watt
1 pce res. 0R1 (0,1 Ohm) 5 watt or bigger.
1 pce. res. 6k8 1/8 watt.
1 pce variable trimpot 4k7

The schema can be loaded from following link.

http://rapidshare.de/files/10143993/ampoku.EMF.html

The output of the LM358 will be connected to ADC input of the pic.
The max. current which is the total capacity of your power supply, will be regulated by 4K7 trimpot. This circuit is arranged for measuring max. 5A current.
You can connect one ammeter serially to the circuit and connect also one current source (can be one auto-lamp) and regulate the total current by trimpot.

ERO

RYTECH
- 31st December 2005, 11:14
Thanks for your prompt suggestions, i will investigate both options and post if any trouble in implementation. :)

RYTECH
- 12th January 2006, 22:43
I've obtained several max4172 SOIC IC's. Could somebody help me get started with the current sense of my 12v source. The mesurable range should be between 0 and 1 amp (lets start with just metering the logic part of my project).

I will be using the 2nd A/D channel on my pic as the first is used to sense battery voltage.

what i need is a schematic with some explanations, the datasheet seems compllicated and doesnt explain how to interface to the pic.

Thanks

AMay
- 4th February 2006, 22:46
If you just want to measure the current, get 1% .1, 1 and 10 ohm precision resistors, put them in the circuit one at a time, and measure the voltage drop.

If you want a permament meter, use the .1 ohm, and get one of the cheap volt meters which run on a 9v battery. Set it accross the resistor, and set it to one of the low ranges.

Resistors are available from Mouser 71-RS5-.1 etc. I think Circuit Specialists has the best deal on Meters.

Good luck

RYTECH
- 18th September 2006, 07:12
can i get some more help interfacing the max4172 ic's... i'm having a hard time with figuring out what resistor values to use in my circuit

the input source voltage is 5v's the ammeter should be able to monitor between 0 and 2 amps.

JIM A
- 23rd October 2006, 03:31
THIS CIRCUIT SHOULD DO WHAT YOU WANT. NOTICE THE INACCURACIES BELOW 40-50mA LOAD CURRENT. THIS COULD BE COMPENSATED FOR, BUT WOULD ALLOW LESS VOLTAGE FOR THE LOAD.






http://rapidshare.com/files/312322/MAX4172_EX.TIF

majoka
- 24th July 2010, 21:48
hi ero
i see ur reply on pic ammeter page

The schema can be loaded from following link.

http://rapidshare.de/files/10143993/ampoku.EMF.html

but this link is dead nw
can u provide the new link please or any one can provide who have this schmetic

ero
- 25th July 2010, 08:03
I do not remember what was in the file but I collected some of similar files which I had worked before . Pls. check the file in following link. I hope it helps you.

Ero

http://www.4shared.com/file/2cBbcmL7/ampoku.html

majoka
- 25th July 2010, 20:09
thank u so so much it solve my problem greatly

majoka
- 26th July 2010, 04:30
@ ero
it work gud for me but can u tell or provide some calculations for resistors that how u choose these values becoz i also spent one week to use op amp LM358 as a non inverting amplifier with its gain almost 500. but its behavior was non linear but in ur case its behaviour is linear
kindly tell me about calculations it will be useful for me in future designing

ero
- 26th July 2010, 07:52
Dear Majoka,

Normally I do not make a lot of calculation in that cases. I use simulator (isis) and I change the resistance value until I find the right output. If you need to make the calculation here are the formulas which I use time by time for rough figures.
In order to findout (Vin ) voltage I use V=I*R which is basic Ohm rule.
For instance one of our cases I had use the current resistor 0,05 Ohm and it has created about 5 Amp. current on the entrance of the circuit.
V=0,05 x 5 A=0,25 V. Using this figure on Opm-amp formula ;
Voutput= Vin *(1+Rgain/Rin)
Vo=0,25 *(1+19K/1K)=0,25 * 20K = 5V and the circuit produce 5V which is right voltage for Pic measuring.

If you look the case from opposite side you need 5V on the output and you need to find the value of Gain-resistor. You put the values to the formula and you pull and find the value of Gain resistor from same formula.
5V=0,25V (1+Rg/1k)
5V=0,25 * (1+Rg)
5V=0,25+0,25 Rg
Rg=(5-0,25)/0,25 = 19K

İt is better to use one fixed resistor and serially one variable resistor all the time. The value of the variable resistor must be as much as small in order to make a precision regulation.

I have to tell you I am an amateur not electronic educated person. But I read a lot about the electronic.
Rgds
Ero

majoka
- 26th July 2010, 11:46
thank u so much ero i also use isis but i was doing a mistake that my input was too low as compare to your case i was multiplaying a 0.02m volt to gain then 0.04 ,0.06 and so that why its behaviour was non linear becoz op amp can not significant difference at output for such low input
even i use same formulas for calculation
i adjust Rf=1k ,Ri=1k nw according to formula
Vout=vin*(1+(Rf/Rin))
vout=0.02mv*2=0.04mv
nw i was expecting to 0.04 but it was the limitation of the op amp nw i understand
thank u again dear i understand it