Author Topic: Current Sense Resistor noob?  (Read 4304 times)

0 Members and 1 Guest are viewing this topic.

Offline mitpattersonTopic starter

  • Regular Contributor
  • *
  • Posts: 89
  • Country: us
Current Sense Resistor noob?
« on: February 10, 2012, 04:42:33 am »
I have already designed a charger for my phone to use in my car that takes the 12V(or there abouts) down to USB spec (~5V). the current set up uses a 7809 to drop to 9V, and then a 7805 to do the final drop down to 5V. I did
this for the reason that in my initial design with only the 7805 there was too much heat, so I tried to spread the heat(7 watts) out between 2 heat sinks instead of the one.

I know some will tell me "Just buy an off the shelf car charger" my reason not to is: why? its no fun, and plus i like the stats i can get with the current measure and crap

some will also say "Why not use a switch-mode supply, its more efficient ect." again, my response is: for one I have no design experience with switch mode, I also don't want to have to deal with the increase in "noise" in the lines. I like the cleanness that that a linear supply tends to offer.

Now what I am wanting is to add current measurement to both the input(from car) and the output(after) so i can see usage, and also of course since I’m measuring current, I’ll also have voltage. I will then use an ardunio based micro (code and chip) to drive the LCD display and to do the data processing. Can use the built in A to D's if it has enough resolution/accuracy. Might need to get an external A to D to meet the above requirements.


Current Measure Stats/Requirements
Input side:
Between 12 and 14 volts
Up to ~2amps
Want at least 100 ma resolution


Output side:
Regulated 5V output from 7805 to USB Spec (4.75 to 5.25 volts)
Up to ~2amps (in reality closer to ~1 - ~1.25 amps)
would like 10 ma resolution

Will likely use an Ardunio based (code and ATMEGA328) to drive LCD and to do data processing.

I'm new to designing current measurement stuff, in the past when i needed current measure i just slapped a multi-meter in-line in current measure mode. Any advice, formulators to use, or any links for selecting a resistor to use
and potential setups(schematics ect.). Any links to parts and stuff. I'm just not super clear how to select a part, i know i need to take power dissipation into account, but i also don't know how to select a good value for the resistor. If anyone can give recommendations of value and wattage rating. I'm not sure if I need to use an op-amp or anything to amplify the signal before it goes to an A to D. I'm also a noob at those as well. so any advice in that regard would be appreciated.

If the resolution that I’m asking for isn't possible easily let me know, I can also post my current schematic/PCB layout if that will help. In chating with Dave(eevblog) he mentioned I should use low-side current measure, which is my plan unless someone has a reason not to.
 

Offline bfritz

  • Regular Contributor
  • *
  • Posts: 134
  • Country: us
Re: Current Sense Resistor noob?
« Reply #1 on: February 10, 2012, 05:10:17 am »
OK, after hearing the power dissipation issue, you may want to do that switcher!

One of the big issues is going to be power dissipation in a linear.  Lets do the calculations:

Input voltage:  14  (I'll tell you later why you need to protect the input against higher voltages, but this is good for our purposes right now.)
Output voltage:  5V  (I'll just calculate nominal.  I'm gonna play College Prof, Calculating the maximum is an exercise left for the student.   :D)

You want an output capability of 1.25A.  (Note that you may want to allow for more, depending on what you will charge.  Many phones pull more than the 500mA spec in the old version of the USB specs.  A new version of the USB specs allows for devices that consume up to 1.6A.  I believe the iPad uses 1.5A)

So, power dissipated is P = V * I, but the V is the voltage dropped in the regulator.

So; P = (Vin - Vout) * I = (14 - 5 ) * 1.25 = 11.25W   Yikes!  Without a fan, you're going to need quite a large heat sink, or it will get really hot.

So, another exercise left for the student, is using the Rth j-c (R theta junction to case) from the regulator data sheet, and find out what the Rth of your heat sink is, you can calculate the maximum temp of the die in the regulator based on the power you will dissipate.  Be sure to allow for doing this on a hot day, when the device has been sitting in your hot car.  Then compare that number to the max die temp given in the data sheet of the regulator.  Keep picking bigger heat sinks with smaller Rth until the heat sink gets so large, you dont want it, or you find a die temp that is under the max die temp given in the parameter table for the regulator.

Other concerns that are true no matter what you do:

A car is a brutal electrical environment.  If you are going to plug this into a cigarette lighter socket, be sure to choose a fused plug.  Then be aware that you should likely choose a TVS device to clamp the maximum voltage your circuit can see.  Transient voltage spikes of 60V can occur in a car during what is termed "load-dump".  Go to some of the TVS manufacturer websites and you'll find some good papers on how to choose a device, and the kind of voltage spikes you may see in an auto, and what parameters to choose for the TVS.

To answer your question about the current sense.  On the output side, you will want to use a fairly small valued resistor, in the low side current return path.  You will want it to be a small value, or it will seriously reduce your output voltage.  Remember that any voltage dropped across that resistor will be voltage your USB device being charged doesn't get.  So, you might want to keep the resistor to say 100mOhms, or 0.1 Ohms.  At 1.25A, that will be a voltage across the resistor of 125mV.  You then will use an Op-amp to gain that voltage up, so that the voltage is close to the maximum input voltage for the A/D your micro has.  For example if your micro runs off 5V, and full scale on the A/D is 5V, Gain = 5V / 125mV = 40.  Note that you may want to do a bit less than that, so you could detect if a device is drawing current higher than what you planned for.  The concerns on the input side are quite similar.

Show us you're first pass at a schematic, and I'm sure you'll get lots of feedback.  Engineers are good at telling others what they are doing wrong.  LOL

Seriously, this is a good project for someone new.  I think you can have success.
« Last Edit: February 10, 2012, 05:19:09 am by bfritz »
 

Offline vtl

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: Current Sense Resistor noob?
« Reply #2 on: February 10, 2012, 05:13:22 am »
A linear supply is very unsuitable for these high current charging applications. You end up having to heatsink a ridiculous amount of power which also requires a lot of space.

You should just buy an off the shelf 12v->5V charger off ebay for like $1-$2. 99.9% of them are based off the MC34063 http://www.onsemi.com/pub_link/Collateral/MC34063A-D.PDF

The unit will have low value current sense resistor which you could solder sense wires to your microcontroller. Make sure you use a differential input if youre using a common ground for the micro and charger.

The current measurement resolution will depend on the current shunt used. For example MC34063 design notes show a 0.22 ohm resistor so for a 500mA load the voltage across it will be 0.11V. Will probably want to put the signal through a voltage follower so you get a decent amount of resolution
 

Offline germano_a

  • Newbie
  • Posts: 3
  • Country: br
Re: Current Sense Resistor noob?
« Reply #3 on: February 10, 2012, 11:03:39 am »
If for some reason you decide to go for high-side measure.

There's a low cost CI -> ZXCT1009

You can use it with a resistance made of a trace in your PCB, or a low resistance.

It converts the potential difference in a current output. Set a resistor for your A/D range and it's done.

Very easy.
Hope it can be usefull!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->