Go Down

Topic: PCA9685 + MOSFET - PWM MR16 Led Downlights (Read 2 times) previous topic - next topic


Feb 12, 2013, 01:09 am Last Edit: Feb 12, 2013, 08:59 am by digitalclouds Reason: 1
Hi All,

Long time lurker, first time poster, and a little green when it comes to electronics :-)

I have a little problem that is confusing me and I am hoping someone may be able to provide some direction.


I have a basic circuit (Arduino controlled), that outputs a PWM signal, this connects to a PCA9685, which in turn connects to a N-Channel MOSFET (FQP30N06L), which has a 12 volt power supply (DRP012V100W1AA - DIN Rail power supply) feeding an MR16 12v Led.

The circuit has a resistor (10k) between the gate and source on the MOSFET, the led and power are on the drain, with the source grounded (and the other end of the led also connected there).

All seems to work nicely - I do not have a scope, but the voltages seems to flow nicely up and down when I measure with a multimeter, and overall the led seems to dim and get brighter as would be expected ..

.. but ..

When I drop the PWM cycle down the led gets dimmer, then does a sudden drop in brightness, and then doesn't fade down all the way to nothing ..

My initial thought was the pulse frequency - so I have dropped this to 100Hz, no change. Then I started thinking it may have to do with the led power driver - do I need one or not - but after some reading I concluded that standard downlight leds already have a driver, so current shouldn't be a problem. Then I wondered if the led I had wasn't dimmable - tried some different ones - no changes .. and the fact it does actually dim overall seems to indicate that it is dimmable.

I will post an actual circuit later - just need to draw it up - its all on the breadboard at the moment :-)

(slight mistake - its not PWM coming from Arduino, but I2C)

My guess is that I am forgetting something silly (a resister between the LED and the mosfet?).

Anyhow, if anyone can suggest an avenue of investigation, it would be VERY much appreciated.

Thanks & kind regards,


MR16 LEDs already have a switched mode constant current regulator in them, so they aren't really suitable for external PWM dimming. You best bet is to buy the LEDs and the regulator board separately. Most of the regulator boards are based on a chip that has an external PWM input, which you can usually tap into.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


Appreciated, but I am not really intending to build my own downlight leds - don't get me wrong .. it would be rather fun  XD .. but considering the volume I will need for my little project, I feel this is probably best left to the mass producers :-)

I should also mention that I have had these leds dimming quite nicely using a DMX dimmer (which uses PWM according to its specs).

Also, I am a little unclear as to why the regulator board inside the MR16 LED wouldn't play nice with PWM (there must be something, otherwise they would't sell dimmable / non-dimmable leds) .. my understanding of PWM is that it is like flicking the switch rather quickly, with a varying amount of delay between turning it off and then back on again .. overall it doesn't limit the current to the device, etc. .. so assuming the driver can keep up, shouldn't it just work?

Thanks & kind regards,


For those interested - I think I have figured out what the problem was ..

I was using 'delay' after I set each PWM cycle level - this seems to have been causing some problems .. not sure why, but when I changed it to use the 'currrentMillis', etc., setup it started becoming responsive to lower PWM cycles .. I can only guess that it was impacting the I2C communication in some way.

I now have a pulsing MR 16 12 volt LED running of the circuit mentioned above .. the drop to 0v still feels a little sudden, but I know this is controllable now (did a test with manual control via serial and was able to gentle turn the led to 0).

If anyone knows why this may be, please do say as I would love to understand what is going on .. also, any feedback on the circuit would also be appreciated.

Thanks & kind regards,


Hi Jake
In dimmer control circuits, it is usual to use a look-up table, and use the value in that to set the brightness of a lamp.
This is because all lights including LED's don't have a linear response to the PWM level against brightness

i.e.  0% (0) would be off    100% (255)= full on   but 50%(128) s unlikely to be half brightness more likely 40% brightness and as it gets 'darker' so the linearity gets worse .
Also works at the top end; setting 80% PWM  maybe much nearer 100% brightness  something like 85+% brightness..

The look up table has a series of values that represent the PWM value for each brightness required, and will give he illusion of a 'linear' brightness as you fade in up and down.
The look up table is an array of values that convert the brightness level either 0-100 or 0-255 and as an example, and convert it to a value to use for the PWM value.

http://en.wikipedia.org/wiki/Dimmer#Dimming_curves  this is for tungsten lamps often used in theaters
http://doityourselfchristmas.com/forums/showthread.php?19487-Empirical-LED-Dimming-Curve  a forum discussion

I hope this may be of some help.


Go Up