Little help needed to understand Dimmer for DC lamp?


Closed Thread
Results 1 to 15 of 15
  1. #1
    Join Date
    Nov 2009
    Location
    London
    Posts
    251

    Question Little help needed to understand Dimmer for DC lamp?

    Hi, can someone help me understand how I can control the brightness of a DC halogen lamp 12/24V using my PIC. The PIC is suppose to get a pulse from a PLC circuit, first pulse the brightness to be 60%, 2nd pulse to be 100% & on 3rd pulse ALL lamps to be OFF.
    I would like to ask what will be the suitable PIC for this job and any ideas/help as how to start with this project (including schematic to control the lamps). Can 16F877A do the job? and also how many of these lamps can I control with one PIC. Thanks in advance.

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Can 16F877A do the job? and also how many of these lamps can I control with one PIC
    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.
    Attached Images Attached Images  
    Last edited by aratti; - 7th April 2010 at 22:43.
    All progress began with an idea

  3. #3
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Red face Thanks

    Quote Originally Posted by aratti View Post
    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

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    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)
    Attached Images Attached Images  
    Last edited by aratti; - 9th April 2010 at 19:04.
    All progress began with an idea

  5. #5
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Wouldn't it be easier just to use a single MOSFET as a low side driver?



    steve

  6. #6
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    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.

    Al.
    Last edited by aratti; - 9th April 2010 at 22:41.
    All progress began with an idea

  7. #7
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    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...

    Steve

  8. #8
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Question

    Easily available MOSFET I found out is IRF540 -
    This is link is to the datasheet:
    http://www.irf.com/product-info/data...ta/irf540n.pdf

    Since I am not familier with most of the terms in the datasheet, can you please advise if I can use this Mosfet and If I can use the same circuit?

    Also, I need to control lamps upto 100W, which I believe can be done using Heatsink on this Mosfet. Thanks for the help.

  9. #9
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    can you please advise if I can use this Mosfet and If I can use the same circuit?
    No! IRF540 is a N channel mosfet the schematic uses a P channel mosfet.

    Al.
    All progress began with an idea

  10. #10
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Question

    Quote Originally Posted by aratti View Post
    No! IRF540 is a N channel mosfet the schematic uses a P channel mosfet.

    Al.
    Thanks Al, provided the circuit is changed, will this mosfet be able to do the Job?
    I normally keep the components as advised, but IRF9540 is not normally available where I am.

  11. #11
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    ....provided the circuit is changed, will this mosfet be able to do the Job?
    Yes, it will work.

    Al.
    All progress began with an idea

  12. #12
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    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.
    Charles Linquist

  13. #13
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Update on the process

    I found one mosfet P30NF10
    datasheet: http://www.st.com/stonline/products/...re/ds/7817.pdf

    The setup worked upto some extent but with few concerns.
    firstly when system was fired up, the lamp started glowing but very DIM. I increased the resistance with 1.5K more with 4.7K and this problem got sorted. Now the lamp stays OFF when system is powered up

    The problem is that the lamp is not glowing to its full potential. Any ideas please as what changes I can try in the hardware to make this work, i.e. make the lamp off at value 0 & glow at full potential at 255.
    I am using 20KHz as frequency with HPWM command.
    Thanks

  14. #14
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Which circuit are you using? The one Aratti posted requires a P-channel MOSFET.

    If you are using an N-channel MOSFET in a low-side driver circuit, then you probably need one with a lower gate threshold voltage.

    Either way, that MOSFET doesn't look well suited to the job.


    Steve

  15. #15
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Byte_Butcher View Post
    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)

    All help is much appreciated. Thanks

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts