Yes. you can control two indipendent lamps, since you have two pwm channels per chip.
There is a typo in the schematic First command duty cycle = 255 (full power)
Al.
Thanks. I looked in the PBP Manual - it asks for Channel, Dutycycle,Frequency.
From what you said, Duty cycle value should be from 0-255 (255 Full power)
Channel will be the Port on which the lamp will be connected.
What will be the frequency?
Also the circuit you mentioned, can it work on 12V as well? Thanks
From what you said, Duty cycle value should be from 0-255 (255 Full power)
Yes.
Channel will be the Port on which the lamp will be connected.
Where you connect the interface, that drives that lamp.
What will be the frequency?
I have indicated 20 KHz (20000) but you should experiment variuos frequency and choose the one that gives you the best result. Remember that frequency must be the same for both channels. Refer to the table @ page 74 of PBP manual for max & min frequency available.
Also the circuit you mentioned, can it work on 12V as well? Thanks
Yes, but you should change the 10 K pullup resistor with a 4.7 K one. (On both channels)
Edited: I have posted a new schematic with the correct pullup value for 12 volts and correctly wired, since in my previous post, schematic shows resistor wrongly connected (see the two schematics and note the mistake)
steve, the answer is yes, but you should use mosfet with logic level capability. These devices, anyway are not capable of high current as the normal mosfet, and you will end up to pay more than a normal mosfet plus a small NPN transistor.
Hmmm. Well, it seems like there's an awful lot of < $2 N-channel MOSFETS that will easily switch 10 or more amps with gate voltages well under 5 volts. You've got P-channel MOSFETS cheaper than that? Plus a NPN?
I use a 16F684 and N-channel MOSFET to PWM control power to a 50 watt 12 volt heater element @ 100Hz with no issues.
I suppose the question is how much current is Megahertz talking about? Small 25-50W halogens, or 250 watt driving lights?
As long as the frequency isn't too high there shouldn't be any trouble driving an N-channel MOSFET directly from a PIC. For driving a halogen lamp there's probably no need for more than about 100 Hz.
If your PIC is running at 3 volts or less, then the choice of logic level high current FETs does diminish greatly and a driver circuit may be necessary.
I suppose it might be worth mentioning that dimming a halogen bulb reduces the operating temperature and disrupts the halogen cycle which can lead to premature envelope blackening and early death. For cheap garden variety bulbs, you may not care. But if you're playing with expensive photography bulbs or something like that, then it might be worth mentioning...
Use an N-channel FET if you are going to switch the GND side of the circuit. Use a P-channel FET if you are going to switch the positive (high) side. If you switch the high side, you will need a level shifter like Aratti has shown. If you switch the low side, you don't need the level shifter and can drive the FET directly.
Switching the high side is necessary if one side of your lamp must be grounded. Since I doubt that is the case, then I would recommend using an N-channel logic-level FET with the source connected to GND, the drain connected to the lamp (and the other lamp terminal connected to 12V), and the GATE connected to the PIC. Use a 10K pull DOWN resistor between the gate and GND, so that the lamp is off until your program gets started.
At the low frequencies you are running, most of your losses will be resistive. Look at the RDSON with the gate drive you will provide (probably around 4V). If it is 50 milli-ohms, then at 10A the FET will have a (.050*10) = .5V drop. .5V X 10A = 5 Watts. The lower RDSON, the lower the amount of heat produced. My guess is that you will produce maximum heat at around 80-90% of full brightness.
I use a 16F684 and N-channel MOSFET to PWM control power to a 50 watt 12 volt heater element @ 100Hz with no issues.
I suppose the question is how much current is Megahertz talking about? Small 25-50W halogens, or 250 watt driving lights?
As long as the frequency isn't too high there shouldn't be any trouble driving an N-channel MOSFET directly from a PIC. For driving a halogen lamp there's probably no need for more than about 100 Hz.
If your PIC is running at 3 volts or less, then the choice of logic level high current FETs does diminish greatly and a driver circuit may be necessary.
Steve
Hi Steve, this is the only mosfet I could find locally, I am in India currently and I have to develop this using easily available components. Though I will try once again to find P-Channel, but I would like to request you if you can upload the circuit here for N-Channel mosfet you use for 12V - 50W heater.
I need it for 50W @ 12V halogen.
My PIC is running on 5V.
Widely available mosfet is IRF540 (N-Channel)
Bookmarks