Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Building simple current meter using PIC + shunt resistor

Status
Not open for further replies.

astronomerroyal

New Member
Sorry if this has been asked 100 times before, but I failed to find the info.

Apparently I just destroyed the cheap current meter I was installing into my bicycle generator. It is the sort that simply measures the voltage across a 20A 75mV shunt resistor.

My question: Is it simple to build such a current meter utilizing a PIC and my shunt resistor?

I'm keen to try, but would like to know potential pitfalls.

The output need only be simple, lighting an LED bar display for example - I don't need great accuracy (5-10% would be fine). The part I'm not sure about is the input; how to measure the very small voltage drop across the shunt resistor (<75mV). On the PIC-side, an ADC port with an appropriate selectable reference voltage would be my favoured approach, but I suppose this is not feasible at mV levels. Should I use an opamp to boost the voltage by, say, 50 and then feed it into the ADC?

I found interesting voltage, resistance, capacitance meters on Microchip's application notes, but no simple current meter. AN939 gives some useful insight but is massively too complex.

As always, any thoughts or links would be appreciated.
 
A current meter is so simple there's no need for an application note on it. Simply use an opamp to boost the voltage drop across your shunt, and feed that into the analogue input of the PIC. If you use a 2.5V reference (as my tutorials do) it will be more accurate than using Vdd, and you only have to amplify upto 2.5V rather than 5V.
 
If you destroyed a meter with a 20A 75mV shunt on your bicycle then you should seriously consider joining your country's Olympic cycling team.

On a more serious note, check Nigel's tutorials.

Mike.
 
Thank you both for venturing onto my level. Case closed (to conceal my embarrassment) - I was just rather disconcerted by the apparent complexity of the circuit board inside the current meter.

Long live Derbyshire. Long live the Queen.
 
The rest of the circuitry is probably for the other functions of the meter, it could also just be a lot of discrete logic instead of a PIC. If you don't mind wasting the power you can always use a higher value shunt resistor to get a higher voltage drop to read it directly with a PIC. Problem is the shunt will dissipate a decent amount of heat and the reading will become non-linear, though this may not be an issue. What exactly is the purpose of reading the current and exactly how much current max are you trying to read?
 
I wish to measure the current generated by a bicycle powered generator. I'm talking about 12v 10amps, when applied to 12v battery charging - not the sort of tiny generator/dynamo used for powering a bicycle light.

Free Math Physics Engineering lessons Simulations Freeware Shareware

I'd prefer to stick with this shunt, because I've already bought it. Found a LM386 audio amp amongst my ICs. It promises a built-in gain of 20-30 which would, since 10amps produces 37.5mV across the shunt, give about 1volt. That's quite acceptable. I did some experimentation and apart from some noise (~10mV), the basic idea seems to be coming together. I'd never used an opamp before, so may yet fail. The high-freq noise appeared on the power supply, according to my oscilloscope. It was also there when I used a 9.6v battery - so I expect I'm somehow misusing the scope. Just don't know.

I really can't understand how the original current meter broke. Now when I turn it on it always reads 666.
 
I really can't understand how the original current meter broke. Now when I turn it on it always reads 666.
How did you hook up the meter?
If you were just measuring voltage across the shunt I can't see it killing the meter.

Can you post your circuit?
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top