Go Down

Topic: Dimming the LED light (Read 609 times) previous topic - next topic

swapino

Aug 31, 2019, 11:51 am Last Edit: Aug 31, 2019, 11:53 am by swapino
Hello everyone ... after a few years looking for my answers ... using google, I am going here for little help.

I have something like "smart home" .... using Arduinos, Raspberry, Open Hab and so on ... and at this moment I need to listen to any advice on how to do follows ...

I've got few of lights circuits using LEDs ...

It is controlled by ARDUINO MEGA with PWM signal, with this little MOSFET board  https://arduino-shop.cz/photos/produkty/d/1/1155.jpg?m=1550312675, but instead of IRF520, I am using IRL530N.

Dimming is working like a charm ... but my question is. I would like to dim more on the down limit ... so the LEDs will be able to have less brightness. I was trying to put resistors of different values and it worked, but also dramatically decreased the brightness of the LED at the full power...

so not sure how to do it ... if I need different Mosfet or different logic?

Thank you for any advice ...

Paul__B

Yes, your problem is that the PWM has only 256 steps, and it turns out that - due to the logarithmic response of the eye - 1/256 of your full power is actually a not unreasonable brightness.  A 20 mA LED will be quite visible when driven by 100 µA.

DVDdoug

Does it go off with a PWM value of zero?   Then PWM =1 is not dim enough?

Quote
if I need different Mosfet or different logic?
Typically, high-power LEDs use a switchmode constant current (controlled current) driver.    But with 8-bit PWM you'd still only have 256 steps.

Wawa

I use the 12-bit PWM from a PCA9685 for my LED lighting.
Dims down to very low brightness.
Leo..

JohnRob

For my LED dimmer I used the 328P 16 bit timer (I think it was timer1).

John
Please do not PM me with thread based messages.  If your thoughts are worth responding,  the group should benefit from your insight.

swapino

Guys really appreciate for your answers ... they were quick and probably hit the target!

I use the 12-bit PWM from a PCA9685 for my LED lighting.
Dims down to very low brightness.
Leo..
So probably I will go this way ... do you think that these 4096 steps ... will do the job, that I will be able to dimmer much more? (Also solve my other problem, cause I have 16 light circuits and for that reason, I am using 2 MEGA ARDUINOs due to the lack of PWM signals ...  if I am going to use this board I need only one )

If I understand right, instead of using ARDUINO MEGA I am gonna use this board ... and communicate with I2C (which I am anyway using to communicate with MASTER ARDUINO which controls all others board I need in my HOME AUTOMATION), and this board will be sending the signal to the MOSFET BOARD ... RIGHT ?

THX anyway, saved me a lot of nerves ...

BR

Ondrej






Paul__B

Most of the time, you are doing something wrong if you think you need a Mega 2560.

Expander boards like the PCA9685 will handle lots of input and output, often performing the buffering you need for higher currents and multiplexing.  Only for very complex code not involving WiFi might you need the extra code memory on the Mega 2560.

12 bit PWM is probably enough.  :smiley-lol:

Idahowalker

If one was using the ESP32 one could use the ESP32 LED API:
Quote
The LED PWM Controller is designed primarily to drive LEDs. It provides a wide resolution for PWM duty cycle settings. For instance, the PWM frequency of 5 kHz can have the maximum duty resolution of 13 bits. It means that the duty can be set anywhere from 0 to 100% with a resolution of ~0.012% (2 ** 13 = 8192 discrete levels of the LED intensity).
https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/ledc.html
The ESP32 LED API works great.

swapino

#8
Sep 04, 2019, 11:32 am Last Edit: Sep 04, 2019, 11:34 am by swapino
Most of the time, you are doing something wrong if you think you need a Mega 2560.

Expander boards like the PCA9685 will handle lots of input and output, often performing the buffering you need for higher currents and multiplexing.  Only for very complex code not involving WiFi might you need the extra code memory on the Mega 2560.

12 bit PWM is probably enough.  :smiley-lol:
Be honest I wasn't thinking about it too much ... for me the Arduino board was the first option which came on my mind ... :) But that's the life ... the FIRST option doesn't have to be the best ONE ... so thank you ... :) And in future probably going to spend more time on research ... or kindly ask on this forum ... seems you guys here are very experienced ...

Let you know, when and how I've finished ... :) :)

THANKS

BR

Ondrej

Go Up