I am using a femtobuck LED driver (driving 5 of those 3W star LEDs in series). I am controlling the light brightness via PWM from an Arduino and was wondering if there was any benefit to getting a DAC and using that instead.
I am ramping the light level up and down using analogWrite() over several minutes and I can visually notice each time the duty cycle value is changed. It would be nice if that was smother. Would that be different if I used the DAC and fed the femtobuck the analog signal?
I also noticed that a duty cycle of 1 results in no light output. Is that expected?
Sure; you would just create a sliding scale to correlate/update it’s duty cycle in smaller, more continuous increments (make the function a percentage of the last value, and update the correlated DAC value relative to itself…something like
LED_PWM_Slide = 0.2LED_PWM + 0.8LED_PWM_Slide
Where the “slide” function is the actual output TO the LED, and the LED_PWM is the duty cycle as it changes
I tried using a DAC (MCP4725) to control the femtobuck with an analog signal. It works and makes much smoother transitions. However, the minimum brightness I can make the LEDs is a lot more brighter then what I can do with a minimal duty cycle when use PWM (even that is a bit brighter then I would like). For my use case (wake-up light), I need to go from very dim to full intensity and the PWM control does that better. The drawback is the bigger jumps from one level to the next.
Saw this in the hookup guide:
Dimming can be done by an analog voltage (20%-100% of max current by varying voltage from .5V-2.5V)
You might consider PWM for the first 25% of brightness, then switch to analog for the last 75%. You'd need to build a circuit that switches from analog to PWM though.