Shop OBEX P1 Docs P2 Docs Learn Events
Calculating Resistor Size and Wattage — Parallax Forums

Calculating Resistor Size and Wattage

eagletalontimeagletalontim Posts: 1,399
edited 2011-12-17 00:38 in General Discussion
I am having a little difficulty understanding some mathematical equations for determining resistor size and wattage. I understand that :

Resistor = (Input Voltage - Needed Voltage) / Needed Current

But.... If I have a 12 volt rail with 10 Amps current and need 4 volts, 100mA, how would I plug in the input amperage? Does that make a difference? I figure it would since 10A to 100mA is a HUGE drop and would cause heat.

Comments

  • kwinnkwinn Posts: 8,697
    edited 2011-12-12 16:32
    The current through a resistor is determined only by the resistance in ohms and the voltage across it. If you connect a 1K resistor across a 12V supply it will have 12mA of current through it as long as the power supply can deliver a minimum of 12mA. Even if the supply is rated for 12V 100A that resistor will only have 12mA of current through it.
  • UnsoundcodeUnsoundcode Posts: 1,531
    edited 2011-12-12 16:37
    Hi, the current capacity of the power supply is not what matters in this case, that is just the maximum it can deliver.

    If your device is a 4 volt device requiring 100 mA and the power supply is 10 volt then we need to “drop” the unwanted 6 volt across a resistor.

    So now we have the two out of the three values needed to calculate the third.

    6 volts divided by 100 mA = a 60 ohm resistor.

    These are the three equations of Ohms Law

    V/R=A
    V/A=R
    R*A=V

    The wattage is the “dropped” voltage * the current
    W=6*0.1=0.6 (600 mW)

    Jeff T.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-12 16:41
    Ok, that kind of makes sense. I am so used to using 1/2 watt resistors for just about everything. I have created a resistor calculator but I am not sure how accurate it is. Here is a link to it.

    http://www.touchofaroma.com/tims/resistorcalc.php

    Can you or someone test it and see if it is accurate? Another thing I am confused on is this MOSFET :

    https://www.jameco.com/Jameco/Products/ProdDS/1563690.pdf

    From what I gather, it will take 9.5V DC, 250mA to fully activate the Gate allowing full current through. Sorry for all the questions, MOSFETS confuse me :p
  • User NameUser Name Posts: 1,451
    edited 2011-12-12 16:50
    The gate of a MOSFET is just a small capacitance. Once charged, it draws virtually no current at all.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-12 17:08
    Hmmm. Interesting. So if I connected the SX directly to a MOSFET like the one listed above, it would charge the gate to 5V which is below the Total Gate Charge of Min 9.5 volt? That would mean the MOSFET would never activate or would only partially activate? As of right now, I am looking to reduce some components on my circuit board without generating heat. My other topic is here :

    http://forums.parallax.com/showthread.php?136575-Going-Surface-Mount-from-Through-Hole/page2

    I was hoping to convert my transistor circuit to a mosfet which would save space and money. Without fully understanding the base / gate voltage and current requirements for full activation, I will not know what size resistor to use to go to a surface mount design.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-12 17:48
    The 3 characteristics indicated on the attachment are the critical ones.

    1 – Vdss is the maximum drain to source voltage. Personally I would not use this transistor for more than 24V.

    2 & 3 – Rds(on) is the on resistance of the transistor at the specified gate voltage ( 0.098 ohms at -10V & 0.165 ohms at -4.5V).

    The voltages are shown as negative because they are measured using the source as the reference. If you are going to connect this transistor the same way as you did the TIP42 in your previous thread the source will be connected to the +12V. That means the gate would be at +12V to turn the transistor off and at 2V to be on (+12V – 10V). You could drive it with the NPN transistor in your previous curcuit but you would not need the 1K resistor on the collector.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-12 18:49
    It would not be connected the same way as my previous circuit since the MOSFET is a P Channel. I would pull down the gate normally, then when it needs to be activated, I would make the pin on the SX or Prop high. The question is, do I need to have some sort of resistance between the chip and the MOSFET or is 3.3v from the Prop or 5v from the SX enough to activate the circuit? Also, from my calculations on the calculator I made, in order to pull down the MOSFET, I would need a 28 ohm, 2 watt resistor. This does not seem right at all.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-12 19:37
    The answer depends on where you are connecting the fet source. Are you connecting it to the +12V, the ground of the SX/Prop supply, or the +5/3.3V of the SX/Prop supply?

    If the source is connected to +12V as in your previous design you will need a drive circuit similar to the npn transistor you had there. You really need to post a schematic of how the load is to be connected to the fet to avoid any misunderstandings.

    PS - a 5V signal on the fet gate should be enough. A 3.3V signal might not. It would probably be enough to turn the load on but might cause the fet to dissipate more power.

    PPS - No it is not right. You will not need a 28 ohm 2 watt resistor.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-12 21:49
    If you were to substitute the FET for the TIP, change the MPS collector resistor to 2K, and leave the rest of the circuit as is it should work fine. The power dissipations are attached. You could also use just about any NPN smd switching transistor in place of the MPSA06.

    Switching to the FET should reduce total power dissipation from slightly more than 1 Watt to less than 0.4 Watts.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-13 14:40
    So basically, the rest of the circuit would stay the same except for the 2k and Mosfet change. What I am hoping to do is remove several of those components if possible. If I could at least remove the NPN and one resistor, I would save a little there. I was just thinking the MOSFET would be the way to go to eliminate those items. Just worried about heat and current capabilities.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-13 14:57
    Ok, somewhere I really miscalculated! I was completely wrong on the circuit amperage. I have 2 different devices that can connect to this circuit. One is a 10v - 14v DC 3 Ohm coil, the other is a 13 Ohm coil. I have a 3 Ohm on hand to test and I just tested it with my ammeter. The reading was 0.44A. If I understand correctly, the 13 Ohm would read .092A. If this is correct, I can use a 1 amp transistor or mosfet which could actually be connected to the SX or Prop without other circuitry like I have now. With a MOSFET, I can either use an N Channel or P channel but still be able to control positive voltage correct? A PNP transistor is Positive, Negative, Positive meaning, Positive in, Negative base, Positive out. The NPN is the same, but visa versa. Is the MOSFET the same?
  • kwinnkwinn Posts: 8,697
    edited 2011-12-13 20:13
    Sorry to say, your current and power calculations seem to be a bit out of kilter. A 3 ohm coil with 12VDC on it should draw about 4 amps and 48 watts of power.

    In the attached diagram the circuit on the left represents the circuit you have now. For the fet or pnp transistor to be turned off the gate or base must be at or very close to +12V. The microcontroller output can only go to +3.3 or +5 volts depending on the micro. This means that the fet or pnp transistor could never be turned off, and with the pnp the micro could be damaged by having 12V on the I/O pin. That is why you need the block labelled LTC. The small npn transistor and resistors are the level translation circuit that convert the 3.3 or 5V signals to a level suitable for driving the fet or pnp driver. BTW this is called a high side driver and there are chips available to do this.

    The circuit on the right can be driven directly (through a resistor for the npn) by a micro's I/O pin provided the npn gain is high enough or the fet can be driven by a logic level. The fet source or npn emitter are connected to ground or 0V so the 3.3 or 5V level is enough to turn them on.

    ****** This is a simplified block diagram so resistors are not shown.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-14 02:22
    Hmmm. That is strange. When I connected the meter between the source and the coil, I put the meter on 10A and enabled the circuit like I normally do. On the digital meter, it showed 0.44. Does that mean my meter is messed up if it should be reading 4.00? The way my current circuit is has lasted over 3 years without any problems or heat.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-14 12:33
    Your meter is probably fine. A 12V relay coil resistance of 3 ohms is unusually low. Typically they will be in the 30 to 200 ohm range depending on the size of the relay. Your coil is more likely to be around the 30 ohm range.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-14 12:39
    Not sure about the coil ohm being 30 ohms. When you buy them, you have the choice of 3 ohm or 13 ohm. I am now wondering if I can go with smaller components than a through-hole transistor or mosfet.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-14 18:25
    Not sure what to tell you. I am sure that if you put 12 volts DC across a coil and measure 0.44 amps the resistance of the coil is 27.2727272727 ohms......unless of course the laws of physics have been changed.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-14 18:53
    I went out and checked the ohms and sure enough, it was 30.4 ohms. I wonder why they say it is 3 ohms. That would probably affect the 13 ohm one as well. The amperage is my concern so I want to make sure I understand this completely before I build my circuit board and start ordering parts.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-14 19:51
    That sounds more reasonable. Before you proceed can you tell me if it is possible to activate the relay with the circuit on the right side of the block diagram in post 13? That would make your circuit much simpler.
  • frank freedmanfrank freedman Posts: 1,977
    edited 2011-12-14 20:15
    I am having a little difficulty understanding some mathematical equations for determining resistor size and wattage. I understand that :

    Resistor = (Input Voltage - Needed Voltage) / Needed Current

    But.... If I have a 12 volt rail with 10 Amps current and need 4 volts, 100mA, how would I plug in the input amperage? Does that make a difference? I figure it would since 10A to 100mA is a HUGE drop and would cause heat.

    Looks like you need to design a simple voltage divider to give you a 4 volt level at 100mA. Assuming that the device really does consume 100mA @4v, it will have a resistance of 40 ohms. Now the easy part, take the 12V source and subtract the 4 volts across the "device" and now you know you need to drop 8V across the series resistor. 8V/100mA = 80 ohms. To determine the power, I^2*R= 100mA^2 *80ohms = 800mW, nearest up would be 1 watt resistor.

    No matter how much current a power supply can source, the voltage (potential) it what drives the electrons through a material and the resistance, well resists the flow. E/R will give you the current.

    Some good sites are these: op-amp electronics, U.S. Navy electronics and electricity courses..google there is a bunch of stuff ... some sell stuff, some don't. If you really use the material gained from say op-amp electronics, throw them some business. The MIT open courseware site has some electronics lectures online.. Lots of resources for whatever level you are at...

    Frank
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-15 07:29
    @kwinn :
    I cannot run the circuit like you have on the right since the device is naturally grounded to the chassis. It has one wire from it which is the power in connector. It would be nice if I could control the negative side since it would be much simpler.

    @Mr. Freedman
    Thanks for clarifying that for me! I have been doing a bunch of research on resistance and wattage since I never really learned the entire ins and outs about it. I know the basics and that is about all. Since I am wanting to go surface mount, I really need to understand as much as possible. From what I have found so far, surface mount components have a much smaller current capability and basic through hole components are easier to find. I simply cannot find a direct replacement surface mount resistor for the through hole components I am already using.

    Currently, I am trying to locate surface mount voltage regulators (7805 or 2940), 470 ohm - 100k resistors, NPN and PNP switching transistors, PNP transistors that can handle 12V @ >2A or a MOSFET that can replace the PNP transistor.

    One question I have is how to determine pull up or pull down resistors for the transistors. For example, the TIP42 which I am currently using :
    http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_139580_-1
    On the spec sheet, I don't understand what current the base needs to activate or does it matter since the base is negative? Since I need to pull up the base to prevent false activation, I put a 10k 1/2W resistor from the collector to the base. The collector always has 12V on it so with the 10k in place, so the power on the base pin is .12 volts? In order to activate the transistor, I need to pull down the transistor to ground so I use a switching NPN transistor. The switching transistor cannot handle much current so I put a 1k 1/2W between the emitter and the base of the TIP42. Not 100% sure how it all calculates out, but there is no heat produced and the TIP42 is turned on and off reliably.
  • kwinnkwinn Posts: 8,697
    edited 2011-12-15 19:42
    The TIP42 has a typical current gain of 40 so to get 2A out the base current would need to be 2/40=0.05A or 50mA. I am sure that the coil you are using requires less than 1/2 amp based on the current you measured (0.44A) going through the coil and the resistance (30.4 ohms) of the coil.

    The power dissipated by the MPSA06 and all the resistors is less than 0.15W.

    For the TIP42 it would be 0.7V x 0.5A = 0.35W

    For the IRLML5203 mosfet it would be 0.098 (Vgs) x 0.25 (Current squared) = 0.049W

    Personally I would go with the mosfet and an smd version of the MPSA06 or 2N2222.

    BTW if you measured the resistance of the “13” ohm coil I would bet that it is close to 130 ohms. Both 30 and 130 ohms are common relay coil resistances.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-15 21:38
    How did you get the current requirement for the base of the TIP42? I think this is where I get the most confused..... when reading the specs of a component and knowing what I will need to successfully control it without generating heat. Since the SX outputs 4.5v @ 20mA per pin on the B ports which I am using, I don't understand how to determine the required voltage / current / wattage size resistor to control a specific component. If I used the mosfet, along with a SM switching NPN, how would I calculate what wattage resistor and what resistance to use? I have also seen 1% and 5% tolerance. I have always used 5%. Does it make that much of a difference? I am sorry for all the questions, this is a big learning experience for me. I do appreciate everyone who has been helping me!
  • kwinnkwinn Posts: 8,697
    edited 2011-12-16 18:01
    The current gain from the data sheet is what you would use to calculate what base current you need for a particular output current.

    The TIP42 has a typical current gain of 40 so if you want to get 0.5 amps through the transistor you need to put 0.0125 amps (12.5mA) into the base. The base current (0.0125A) times the transistor gain (40) = 0.5A.

    In your case you also have a 30 ohm coil between the collector of the TIP42 and ground which will limit the current to a bit less ( 0.38A in theory ) than that. For a switching application like yours putting a bit more than the required current into the base to make sure the transistor is fully on (saturated) is ok.

    In reality all components vary from the ideal so compensating for that is a good idea. That's what the extra bit of drive current does.

    For calculating required currents, watts, resistors, etc. start at the high powered end of the circuit.

    We know the coil is rated for 12V, draws less than 0.5A, and has a resistance of 30 ohms. All that is required for this is a transistor to switch the full voltage to the coil on or off. With no current through the transistor the power dissipation is 0W, and with 0.5A the power dissipation would be approximately 0.35W (0.5A x 0.7V across transistor).

    I like to have some safety margin in my designs so I would select a transistor with minimum ratings of 24V, 1A, and 1W. The TIP42 exceeds that.

    The npn transistor that provides current to the base of the TIP42 has to have a minimum current rating of 12.5mA and voltage rating of 12V. For a safety margin I would select a transistor with at least twice those ratings. Most small signal transistors will have ratings four times that minimum or more.

    To calculate the value of the resistor between the base of the TIP42 and the collector we need to know the base current we want for the TIP42 (12.5mA) and the voltage remaining after subtracting the TIP42 base-emitter voltage drop (~0.6V) and the npn collector-emitter voltage drop (~0.6V), which would be about 10.8V (12V – 1.2V). That works out to 864 ohms (10.8/0.0125). Closest 5% resistor would be 910 ohms.

    *** The fact that your circuit worked with a1K resistor tells me that the coil draws less than 0.5A, or the 12V is a bit more than 12V, or the transistor gain is more than 40, or some combination of those things. A 1K should work here as well.

    The final resistor is the one from the micro pin to the base of the npn. Pretty much every small signal transistor made today has a gain considerably higher than 20 so less than 1mA is required. After subtracting the npn's base-emitter voltage drop from the I/O pin voltage we are left with either 2.7V (for a 3.3V micro) or 4.4V (for a 5V micro). For a 1mA base current we would need a 2.7K (2.7 / 0.001) for 3.3V and 4.4K for 5.0V. I use a 2.7K for both.

    To calculate the wattage multiply the current through the resistor by the voltage across it. Worst case here would be the 864 ohm resistor. It would dissipate 10.8 x 0.0125 = 0.135W.
    Using a 1K instead reduces that to 0.11664W. Still close to the 1/8W max rating. You could use 2 470 ohm resistors in series instead, or use a higher gain transistor like the TIP125 or the BCV26 if you want to go surface mount.

    Hope this helps.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2011-12-16 22:51
    Ok, I am beginning to understand this :) According to the spec sheet of the TIP42, the DC current gain is :

    VCE = -4V, IC = -0.3A - MIN 30
    VCE = -4V, IC = -3A - MIN 15, MAX 75

    I am assuming you take the MIN and MAX, add them together, then divide by 2 to get the average? It comes out to 45. If that is correct, I would need to use (Current needed for load (.05A) / Average current gain(45)) which comes out to .0111

    I am not quite sure how you got .38A for the current through the transistor. I know there will be a drop in current since there is some sort of load that is not a direct short or 0 ohms.

    I am also not quite sure how you got .35W of power dissipation. I do understand that .5A is going into the base and the transistor has to use it. I guess that is considered power dissipation. Then there will also be some sort of resistance from the collector to the emitter which will cause a voltage difference. I did not see anything about that in the spec sheet.

    I do understand about Ohm's law but plugging the correct numbers into the formula and getting correct results from it scare me :p I am really thinking about switching the TIP42 out for a SM Mosfet since if I am not mistaken, a mosfet is either on or off and they can handle the amperage I am requiring in a smaller component which will save me some space on my board. I order 95% of my parts from Jameco and since they have a minimum order on surface mount components, I need to make sure I get this right the first time.

    By using Ohm's Law to calculate voltage and amperage, I feel I put the wrong values in the wrong spots... For example : If I have a pin on the chip putting out 4.5v @ 20mA and I put a 1k resistor on it, I would use the following formula to calculate the voltage and amperage on the open side of the resistor :

    Voltage = Current (.02A) * Resistance (1000ohms) = 20V. That cannot be right at all since only 4.5V was coming out of the pin.
    Current = Voltage (4.5V) / Resistance (1000ohms) = 0.0045A. So now there is only 4.5mA of current available? This sounds about right to me.

    Now if I use a different formula I found, this is what I get :

    Watts = Voltage (4.5) * Current (.02A) = 0.09W
    Voltage = (Watts (0.09) * Resistance (1000ohms)) * 2 = 180V This is really different than the first formula and WAY higher than 4.5v

    What am I doing wrong? I feel like I am back in pre-algebra before everything finally clicked and it was so simple from there.
  • frank freedmanfrank freedman Posts: 1,977
    edited 2011-12-17 00:38
    Ok, I am beginning to understand this :) According to the spec sheet of the TIP42, the DC current gain is :

    <end clip>
    By using Ohm's Law to calculate voltage and amperage, I feel I put the wrong values in the wrong spots... For example : If I have a pin on the chip putting out 4.5v @ 20mA and I put a 1k resistor on it, I would use the following formula to calculate the voltage and amperage on the open side of the resistor :

    Voltage = Current (.02A) * Resistance (1000ohms) = 20V. That cannot be right at all since only 4.5V was coming out of the pin.
    Current = Voltage (4.5V) / Resistance (1000ohms) = 0.0045A. So now there is only 4.5mA of current available? This sounds about right to me.

    Now if I use a different formula I found, this is what I get :

    Watts = Voltage (4.5) * Current (.02A) = 0.09W This is correct....
    Voltage = (Watts (0.09) * Resistance (1000ohms)) * 2 = 180V This is really different than the first formula and WAY higher than 4.5v This should be E=sqrt(P*R)

    What am I doing wrong? I feel like I am back in pre-algebra before everything finally clicked and it was so simple from there.

    I think you may have missed the point of what gives you the actual current. Go to plumbing 101. City water main 50 psi. pipe diameter from the street say two inch diameter. you will get a certain flow rate. At no time assuming the other end of the pipe is open you will never have > 50 psi across the pipe. If you squeeze the pipe with a vise grip (yeah, cheap thinwall copper), you will cause an increase resistance to the flow because of the decreased diameter. Result is lower flow from the pipe. Your city main will still only ever give you 50 psi across the same section of pipe.

    Same holds true for the current in a resistive circuit. The chip assuming 5V supply and maybe a junction loss or so internally will give you about 4.5 V at the pin. The supply will never increase, it is regulated. Just as the city is (hopefully) not going to jump the pumps up to regulate 80 psi (thus identifying all of the remaining Quest pipe installations in that city in a rapid if not very cost effective manner) nor will your power source suddenly increase. Just putting in a given value of resistance will not give you an increase in power beyond that available.

    As to crunching, stop short-cutting until you can get the following cold. E=I*R P=I*E. There are charts on the net for this. Break it down and do a bit of substitution.

    P=E*I = I*R*I = I^2*R P=E*E/R = E^2/R ..........

    It does not matter what the chip is capable of supplying. What matters is what your circuit can draw. You've stated the capacity of your chip now, Go figure.....
    4.5V (given) / 1k ohm = 4.5mA Less than 20mA rating, safe to use. 4.5V (given) / 10 ohm = 450mA ---- loss of magic smoke event.....
    P=E^2/R 4.5V^2/1k ohm = 20.3mW P=I^2*R 450mA^2*10 ohm = 2.03W

    g'night

    Frank

    Go to Home Despot of bLowes and get a copy of Uglys Electrical Reference. First few pages has it all ......
Sign In or Register to comment.