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.

Monitor power supply current/voltage with uC?

Status
Not open for further replies.

Dalaran

New Member
I have recently built a home power supply using a lm317 and wall-wart. I am now looking to add on to this project by displaying voltage/current measurements on an LCD.

My initial idea was just to add a very low valued resistor in series with the positive output of the supply. I could then measure the voltages using 2 pins and the ADC of the uC. Then solve for the current and use the latter value as the output voltage.

Would this work? Any suggestions/ideas are appreciated.
 
I have recently built a home power supply using a lm317 and wall-wart. I am now looking to add on to this project by displaying voltage/current measurements on an LCD.

My initial idea was just to add a very low valued resistor in series with the positive output of the supply. I could then measure the voltages using 2 pins and the ADC of the uC. Then solve for the current and use the latter value as the output voltage.

Would this work? Any suggestions/ideas are appreciated.

Yes it would work and the very low valued resistor you have in mind is usually referred to as a shunt.

Shunts are rated by maximum current and voltage drop at that current.

https://en.wikipedia.org/wiki/Shunt_(electrical)
 
Last edited:
Thanks.

I was thinking of a 0.01 or 0.001 Ohm resistor. Probably +/- 1%. Would I be getting better accuracy with a shunt?

edit: Do I need a very large wattage resistor?
 
Last edited:
Thanks.

I was thinking of a 0.01 or 0.001 Ohm resistor. Probably +/- 1%. Would I be getting better accuracy with a shunt?

edit: Do I need a very large wattage resistor?

I would go with a shunt. That is what they are designed to do. The necessary wattage will depend on the current going through the resistor and the voltage drop across it. As long as you don't short the output of your power supply the voltage drop should be relatively small for a .001 Ω resistor. But I would go with a shunt.
 
Note that the voltage drop across the shunt is I*R, where I is the power supply current, and R is the shunt resistance. If you are using an ADC input to a uController, it is difficult to get good resolution without using an "instrumentation amplifier", a "low-side-current monitor, or a "high-side-current monitor" chip to amplify the voltage drop across the shunt before feeding it to the ADC.
 
Ah yes this makes sense. Seems like a high-side current monitor is exactly what I am looking for. I will look into this. If you have any suggestions for part #s I will gladly listen. ~12V 2A max application.
 
Look up a ZXCT1009, my favorite.
 
Again, much appreciated. This will work well with my plan.

What values of Rsense and Rout do you usually use?
 
Last edited:
In my airplane, I wanted to measure the alternator load current. I used a 1mΩ (50mV/50A) shunt for Rsense. The desired full scale current is 100A, which produces a Vsense of 100mV.

I wanted 100A to correspond to 5V into a PIC A/D input. Iout is 10mA per 1V of Vsense, so at Vsense=0.1V, Iout = 1mA. To get 5V across Rout, Rout = 5/1mA = 5KΩ.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top