It is a bit easier when using a FET instead of a BJT. If the BJT was getting hot, it was not being driven into saturation. Look at the collector voltage on a scope. It should drop down to 300mv or so when the transistor is on. The base is probably not being driven hard enough if the transistor is not going into saturation. Determine the maximum collector current (looks like 2A) and divide by beta or Hfe of the transistor. That is the base current that should give you saturation. Since the PIC pin alternates between 0 and 5V, and the Vbe is 700mV (assuming silicon transistor), the base resistor needs to be R=(5V-700mV)/Ib . Also, make sure the PIC pin can source enough current (they can typically sink or source 25mA). With a FET, you don't have to worry about gate current. Most FETs can be driven to full on with +5V out of the PIC pin. The gate draws current during the transistion due to gate capacity to the source and the Miller Effect (gate capacity to the drain multiplied by the voltage gain from gate to drain). If the PIC cannot supply this high current, the on to off or off to on transition is slowed down. This is generally not a serious problem, though if the transitions start taking too long, you once again start dissipating power in the FET (P=Vds * Id). Since a FET normally has a very low Rdson, Vds is very low when Id is high. Also, When the fet is off, Vds is high, but Id is low. So, total power dissipation is low. Good luck! Harold > I have a bike light controller that uses PWM to drive a mosfet to control > a 20W > halogen bulb. I just have 3 levels of dimming, but that's just a software > issue. > I will try to draw up the circuit after work today and post it... I've > been > meaning to document it for my friends who have the circuit anyway. The > idea is > from Willy Hunt (Google for Willy Hunt LVR). I am using a PIC12F675 with > a LM2951 > regulator and an IRF7353D1 mosfet. During operation the FET does not even > get warm > to the touch. > > Pete > > James Tu wrote: > >> What is the best way to control the dimming of a 12V bulb? (I have a >> 12VDC >> halogen bulb rated at 20W) >> >> I saw circuits on the web using a digital pot to control a LM317 >> (variable >> voltage regulator). >> I also saw circuits on the web using PWM to control the bulb via a >> transistor. >> >> I tried the second method...using PWM from my microcontroller to control >> a >> MJE3055T. 12 V supply is connected to one lead of the bulb, the other >> lead >> of the bulb is connected to the collector. the drain is connected to >> GND. >> >> The transistor got _really_ hot and the bulb was hardly lit...it just >> glowed a bit. Do I just need a transistor with a higher amp rating? >> Here are the specs for it... >> VCEO Collector-Emitter Voltage (IB = 0) 60 V >> VCBO Collector-Base Voltage (IE = 0) 70 V >> VEBO Emitter-Base Voltage (IC = 0) 5 V >> IC Collector Current 10 A >> IB Base Current 6 A >> Ptot Total Power Dissipation at Tcase # 25 oC 75 W >> >> It seems like it should be fine. 60V and 10A. What am I doing wrong >> such >> that the transistor is heating up so much? >> >> Or should I just try the LM317 approach? >> >> The least parts the better...it seems like the transistor approach would >> be >> best. Can someone a circuit for this and also recommend the transistor >> to use? >> >> Thanks! >> >> James Tu >> james@2-bit-toys.com >> >> -- >> http://www.piclist.com hint: The PICList is archived three different >> ways. See http://www.piclist.com/#archives for details. >> >> ------------------------------------------------------------------------ >> >> --- >> Outgoing mail is certified Virus Free. >> Checked by AVG anti-virus system (http://www.grisoft.com). >> Version: 6.0.532 / Virus Database: 326 - Release Date: 10/27/2003 >> >> -- >> http://www.piclist.com hint: The PICList is archived three different >> ways. See http://www.piclist.com/#archives for details. > > -- > ____________________________________________ > Peter Donahue > AMTS (Code Monkey) > COM DEV R&D > P (519) 622-2300 x2439 > F (519) 622-8706 > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- FCC Rules Online at http://www.hallikainen.com/FccRules/ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.