PDA

View Full Version : Current Meter



mikefox
- 19th October 2005, 01:41
Hi guys,

I need to ask for a little help, I'm building a current meter for a client, and I'm having difficulty working something out.
I am using a 16F877A with ADC channels 0 to 2 used to measure voltage and current, this all works fine, what I'm having trouble with is calculating current drawn over a period of hours, measured in amp-hour. The idea for this is to show the total current in or out of the system in a day.

Please, if anyone can help, I could use any tips you might have.

Mike

dmairspotter
- 19th October 2005, 14:17
a long time ago in a PC. I basically took an amp reading every second and added 1/3600th of the reading to a register. Basically integrating the amps to get amp hours. Seems like you could do something similar, with different math order, in the PIC.

mikefox
- 19th October 2005, 16:25
Thanks mate, this code seems to do the job.

avg_curr1 = avg_curr1 + (curr0 / 10)
avg_curr0 = avg_curr1 / 3600

Mike

Squibcakes
- 21st October 2005, 04:10
This sounds like something I could use....

I wouldn't mind replacing the old analog current / volt meter in my 30amp load tester with a digital version, including aHr Capacity.

The current shunt we have produces 50mv max at full load (50amp)

How could this be measured using a pic.. (Use op amp???) of sort?

I would like to know if anyone else has done this before.

On an other topic, has anybody made their own wire wound resistors before?

Cheers

Charles Linquis
- 22nd October 2005, 21:42
I have built several current meters using Allegro hall-effect sensors. They offer perfect isolation and have no voltage drop. Depending on the model, they have an output of 20-133 mv/Amp. When measuring DC current, I usually use a rail-to-rail op amp to shift the output to near zero volts (the quiescent output voltage of the sensor is VCC/2) and amplify the output a bit before feeding it into the A/D converter.

Fantastic devices, very accurate and stable. Much neater than using sense resistors.

MikeTamu
- 23rd October 2005, 02:36
I have used the Maxim 4172 Current Sense chip and found it to be very easy to impliment and precise.

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1654

TK5EP
- 25th October 2005, 20:48
Hi All,

i also need to measure some current but on a HV supply, with about 500V DC above ground. Current can flow in both direction, negative and positive with a max of 50 mA.

Any idea how i can do this in a safe way ??

Thanks for any feedback.

Squibcakes
- 26th October 2005, 04:34
Wow, those Allegro Hall Sensors look really good. I have order a couple to test them out.

As for measuring the HV supply, I've only ever used a HV probe connected to a DVM. Sorry, no other idea how to do that.

Cheers

Charles Linquis
- 26th October 2005, 12:04
I have used the Allegro Hall-effect sensors extensively. Bi-directional, great isolation. Good accuracy.

TK5EP
- 27th October 2005, 07:37
Hi all,

I looked the datasheet of the ACS704 which is the smallest device by Allegro (+/- 5A) and it shows a 133mV/A sensitivity.
I think it's a bit low for measuring 50 mA max scale....

An application note for the MAX4172 in a amplified high voltage sensor gives 10mV/mA, which seems to be more adequate, but unfortunately it's not bidirectionnal !

Other possibility is to use an amplified Hall effect sensor, but it needs an ground insolated low voltage supply on the sensor side, which is another problem !

Still looking for the right solution....

Acetronics2
- 27th October 2005, 08:10
Hi, TK5

The best for that voltage levels ( !!! ) is to use a little shunt, an AOP and a V/F converter, then drive an opto-isolator or better an opto-fiber coupler ... remember only CNY21 like HV optocouplers are safe, here ...

on the other side Freq = Current, so it's easy for a PIC to display that !!!

Alain

TK5EP
- 30th October 2005, 18:16
Hi Alain,

Maybe.... but the name problem is to insulate all the circuit from the high voltage side. The OPamp has to be supplied on this HV side, so you need low voltage supply which MUST be HV insulated.

Maybe the Alegro can be adequate if its output is amplified to a level that can be handled by the PIC?

Corsican greetings ...


Hi, TK5

The best for that voltage levels ( !!! ) is to use a little shunt, an AOP and a V/F converter, then drive an opto-isolator or better an opto-fiber coupler ... remember only CNY21 like HV optocouplers are safe, here ...

on the other side Freq = Current, so it's easy for a PIC to display that !!!

Alain

sougata
- 31st October 2005, 18:30
Hi there,

Sorry to catch this thread late. I manufacture series of PIC controlled thyristor based battery charger. For low cost designs I use a piece of wire acting as a shunt in the negative line and then a LM358 for the amplification. It is safe to use it in a HV line also as long as it is referenced to ground. You can use a programmable gain IA like AD620 for your differential measurement needs and couple it to a linear optocoupler like the Vishay IL300. This gives far accurate results than the V/F approach and is cheaper. The only problem is you need another supply. Consider using the IRF PVI series of optos to make a 5ma supply isolated DC-DC converter as well as linear output opto. Maxim has got a very good appnote on high side current measurement (1KV).

Whew! Enough gyans...

If you could post a specific issue with detailed electrical parameter then I might find something on my Hard drive.

BTW I always use a PIC with 10bits res. If thats enough then go on.

Regards

Sougata

TK5EP
- 1st November 2005, 07:47
Hi Sougata,

Thanks for the ideas, my wish is to use no different supply on the HV side to supply the amplifier.
I attached a GIF with the principle of the supply. You see that the supplies are not referenced to ground but to cathode of the tube.
For the 350 V, i could make my measure on the grounded side of the supply, current can flow in both directions with max 50 mA.
The 3500V HV will draw about 800-900 mA.
The 36V only a few mA.

Greetings,


Hi there,

Sorry to catch this thread late. I manufacture series of PIC controlled thyristor based battery charger. For low cost designs I use a piece of wire acting as a shunt in the negative line and then a LM358 for the amplification. It is safe to use it in a HV line also as long as it is referenced to ground. You can use a programmable gain IA like AD620 for your differential measurement needs and couple it to a linear optocoupler like the Vishay IL300. This gives far accurate results than the V/F approach and is cheaper. The only problem is you need another supply. Consider using the IRF PVI series of optos to make a 5ma supply isolated DC-DC converter as well as linear output opto. Maxim has got a very good appnote on high side current measurement (1KV).

Whew! Enough gyans...

If you could post a specific issue with detailed electrical parameter then I might find something on my Hard drive.

BTW I always use a PIC with 10bits res. If thats enough then go on.

Regards

Sougata

pramodsinha
- 10th November 2005, 03:34
Hi guys,

I need to ask for a little help, I'm building a current meter for a client, and I'm having difficulty working something out.
I am using a 16F877A with ADC channels 0 to 2 used to measure voltage and current, this all works fine, what I'm having trouble with is calculating current drawn over a period of hours, measured in amp-hour. The idea for this is to show the total current in or out of the system in a day.

Please, if anyone can help, I could use any tips you might have.

Mike

Why not to use 16f676 for the cost consideration as it cost in delhi is Rs.35 only

Squibcakes
- 23rd November 2005, 06:25
Charles,

I finally received my free samples from Allegro today.. gees these guys are slow. I hope that they are worth the wait!

:)

RYTECH
- 18th September 2006, 06:15
what resistor values should i use for the max4172 if my input source voltage is 5v's and my meter should give values for current between 0 and 2 amps.???