1

I'm trying to figure out my first RaspberryPi (3B+) project, where I'm going to manage 3-4 White LED Strips with following specifics for a single one:

  • 350mA Constant Current (max 400mA)
  • 39,6V Voltage
  • 13,86W for each LED module
  • Dimmerable LEDs

I'm trying to avoid the "hard way" for the moment (not for lazyness; I want to start gradually), so I would like to avoid any DIY electrical circuitry (if not absolutely mandatory), but I'm trying to find a specific dimmer/multi-dimmer module to manage the LEDs:

  • attachable to RPi GPIO
  • able to provide the right amount of power to the LED(s)

Can you help me to find such a module or is it just "a dream" and I need to dirty my hands :) ? In this case ... could you suggest to me a feasible solution or explanation?

Thanks a lot for your help and sorry if I have not provided all requested info.

tlfong01
  • 4,665
  • 3
  • 10
  • 24
Echoes_86
  • 129
  • 5
  • RGB or white? single led or stripe? (1) https://www.aliexpress.com/popular/led-rgb-dimmer.html, (2) https://electronics.stackexchange.com/questions/552849/led-driver-for-street-light-50w – tlfong01 Mar 13 '21 at 08:17
  • 1
    Sorry ... Stripes and White – Echoes_86 Mar 13 '21 at 09:56
  • 1
    Ah, for dimming white LED stripes, Alibaba has cheap solutions for you. DIY, on the other hand, is very hard. See my comments in the following question: LED Driver for street light 50W: https://electronics.stackexchange.com/questions/552849/led-driver-for-street-light-50w. Cheers. – tlfong01 Mar 13 '21 at 10:18
  • 1
    @tlfong01 could you please explain or link some material where I can understand how I can get the connections? I mean "where" I need to plug the strips, the power supplies, etc. I'm missing the part: out of GPIO I have 3mA per Pin. I need 350mA. Where I can get it from? Do I need an auxiliary power supply? How can I link it ? Thanks a lot! – Echoes_86 Mar 13 '21 at 10:28
  • 1
    Just a quick reply. (1) You need a transistor to amplifier the GPIO pin's small, less than 5mA current to bigger than 300mA current. For example, you can use a 2N2222 transistor to control a 20mA status/indicator LED, or 100mA for a power RGBYW LED. (2) You can then use a GPIO output pin in PWM mode connected to the Base of the 2N2222 to control the Collector current and thus the brightness of the power LED. – tlfong01 Mar 13 '21 at 13:58
  • 1
    You might find useful references in this chat: https://chat.stackexchange.com/transcript/119380/2021/2/5 – tlfong01 Mar 13 '21 at 14:05
  • 1
    You might be interested of the following: AliExpress Diymore LED Lamp Driver PWM Dimmer DC7-30V to DC1.2-28V 350mA 1W - US$1 https://es.aliexpress.com/item/32657349303.html?spm=a2g0o.search0302.0.0.35d25296IARNu5&algo_pvid=02914dd4-33ae-4fca-9c11-d1ed877b5e59&algo_expid=02914dd4-33ae-4fca-9c11-d1ed877b5e59-11&btsid=0bb0623c16111425876046832e55c1&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_. Cheers – tlfong01 Mar 13 '21 at 15:23
  • (1) Your question mentioning "*39,6V" seems confusing, please clarify. (2) You spec of "13.86W*" seems too strict. Perhaps you can give us a link to your stripe" Cheers. – tlfong01 Mar 14 '21 at 01:09
  • PT4115 seems to fit your spec well. (1) PT4115E 30V, 1.2A Step-down High Brightness LED Driver with 5000:1 Dimming Datasheet - PowTech https://www.electroschematics.com/wp-content/uploads/2014/07/PT4115E-datasheet.pdf – tlfong01 Mar 14 '21 at 01:25
  • 1
    I must confess that I have not yet tried this PT4115E LED driver, so I am just suggesting, withou any guarantee it works OK. Anyway, I got nothing to do this gloomy Covid-19 locking down Sunday afternoon, so perhaps I should investigate further and try to give a little bit more advice for newbies how to start. Please stay tuned to the coming answer. I am giving a "live" step by step answer. You are welcome to make comments and counter suggestions on how my live answer should go. Cheers. – tlfong01 Mar 14 '21 at 09:10

1 Answers1

5

Question

How can Rpi Thonny Python PWM GPIO pins control brightness of white LED strips of 3 to 4 1W 350mA power LEDs?

It would be nice to start easy with a cheap module, and later do a DIY project using ICs to assemble one's own module which would hopefully be more flexible for newbies' general understanding and applications.


Answer

Update 202mar26hkt1543

Preliminary test OK - Vcc = 48V, Duty Cycle = 2% Dimming, PT4115E 50V 1A LED Driver Module, 13 LED x 4 = 52 LED 5050 LED Lamp (See Appendix F)


pt4225e test 3


Part A - Project Plan

(1) User requirements

The OP seems to have already done a lot of research, and come up with a very detailed specification. I found his requirements a bit too tight or specific, so I have taken liberty to modify it to become more flexible and newbie friendly. The modified requirements are summarized below.

  1. The OP specified white LED stripes of a number of 1W, 350mA, white power LEDs. I would change it to 1~3W, 350mA~1,000mA RGBYW power LEDs.

  2. The OP specifies, for each module, 39,6V (= 39.6V?, ~= 40V) Power supply voltage, and 13,86W (= 14V, ~= 15W). I would change it to start with (a) 12VDC to 24VDC, (b) 12W to 40W maximum.

  3. The OP specifies Rpi GPIO controlled dimming modules. I would modified it to Rpi Thonny python with GPIO output pin in PWM mode. I always think thonny python is most newbie friendly than C++.


(2) Selection of LED driver module and IC PT4115E

I googled and found that PT4115E based constant current LED driver module and IC best suited the OP's general requirements, except one thing the Vcc max is only 30V.

Errata and apology 2021mar19 - I made a crelesss mistake and mixed up different versions of PT4115, PT4115C, and PT4115E. For PT4115E, the max Vcc is 50V.


PT4115E LED ddriver module


The modules's user manual is a bit too brief. So we need to study the datasheet to get a thorough understanding of the driver IC, before we can DIY our own module using the chip. Another important reason is that the modules seem to use jumpers to change the module characteristics. It would be nice if we can use Rpi Thonny Python to software adjust all the parameters, such as dimming, fading in out (using not just PWM, but also a DC voltage level, which hopefully reduces flickering), and maximum current control etc.

(3) Selection of Dimming Mode

I would prefer DC level dimming over PWM for less brightness flickering.


pt4115 dim


dim pwm dc


(4) Reducing Peak to Peak Ripple


reducing ripple


(5) Testing Plan and Hardware Setup

(5.1) Now I am drafting a plan to test the PT4115E LED driver card. The OP's requirement is a dimming a couple of white 350mA LED stripes with 40V, 14W power. I have no experience in using PWM to dim LEDs. So I am thinking of making things as simple as possible. The test plan is summarized below.

  1. Assemble a short LED stripe with only three 350mA RED LEDs.

  2. Use 12VDC as power source.

  3. Use an adjustable DC voltage level, eg a pot or a PSU to dim the 3-LED strip.


led module test setup


(5.2) Now I have wired the XL4001 LED Driver Module for preliminary functional testing without using PWM dimming dignal.

The testing plan is summarized below:

(a) LED under test = LED x 1 (White, 1W 350mA)

(b) Power supply to XL4001 constant current LED driver module = 5V, 12V

(c) Current to measure = expect 350mA at Vcc = 5V or 12V

(d) PWM = DC 0V (duty cycle 100%) , DC 5V (duty cycle 0%)

test02


(5.3) Test Results (DC Level 0V/5V to turn off/on LED)

(a) Current at Vcc = 5V = 250mA

(b) Current at Vcc = 12V = 150mA (Note - LED has heated up and becomes very hot)

test03


(5.4) Test Results (Using XY-LPWM Square Wave Signal to dim LED Module)

  1. PWM dimming is smooth and flickering free.

  2. Need to use my sun glasses for camera lens filter.


pwm dimming


(6) Evaluating a 4 Channel, 50V, 1A x 4, Constant Current, PWM Dimming, LED Module for RGBYW LEDs

Testing a 350mA white LED using a single channel XL6001 module at 5/12V is so far so good. Next step is evaluating the following 4-channel 50V, 1A x 4 module.

AliEXpress THEIA PT4115E LED Driver Board, Constant Current, PWM, Continuous Dimming, Default 4 Channel Output, 4 * 1A - US$15


theia 4ch led module


(7) Testing a 40VDC LED Lamp

What's the voltage used to power LEDs inside an LED light bulb? - EESE 2021jan21

(7.1) The OP specifies 39.6V for his LED stripe. I guess the length or number of LEDs of his strip might be 39.6V / 3V ~= 13

So I tore down a cheapy 200VAC LED to do the testing. I found the power electronics circuit has stepped down 200VAC to 39VDC, as show below.


200vac 39vdc led lamp


(7.2) Bad luck - the 39V LED lamp can not be turned on by 24.5VDC. I tried another 220VAC LED lamp and found that the lamp steps down 220VAC to 78V DC. I PSU only goes up to 25V, the lamp does not turn on below 25V. So it is another test failure.

Anyway, I tried another 12V LED Lamp. Good luck this time 12VDC with PWM works OK. The photo below shows the 1% duty cycle brightness.


39v lamp no work by 24.5V


I tested another 12VDC white LED strips and found everything, including PWM dimming OK.

white led pwm


(8) Using Manual and Rpi software PWM to dim RGB LEDs

How can Rpi move a Servo motor using a GPIO pin in PWM mode? - RpiSE, 2019may11, Viewed 2k times

Now I am testing RGB LEDs, with different frequencies and duty cycles. I found 1kHz and 10kHz make no difference. I also found that

(a) the cheapy XY sig gen has a too low resolution of duty cycle of only (The photo below shows frequency = 10kHz and duty cycle = 97%), and

(b) the brightness of the LED could nto be easily adjusted at the 1% end (actually 99% setting).

So I am thinking of using Rpi's GPIO pin in output PWM mode to adjust the LED's brightness.


rgb led test


/ to continue, ...


References

(1) AliExpress Adjustable PWM LED Driver, Constant Current Converter (4A, 30V, US$4)

(2) AliExpress Adjustable PWM LED Driver, Constant Current Converter, DC-DC Step Down, DC 9V 12V 18V 24V 20W - US$1.5

(3) WS2812 RGB LED Flickering - EESE 021mar05

(4) 3W/2W/1W LED driver 700mA PWM 5-35V DC-DC Constant Current Driver - TaoBao ¥4.80

(5) PT4115E 30V, 1.2A Step-down High Brightness LED Driver with 5000:1 Dimming - PowTech Shanghai

(6) AliEXpress 1W LED Driver 350mA PWM Dimming, Input 5-35V DC-DC Constant Current Step Module - US$20/10pcs

(7) AliEXpress ZK-JVA-12KX 5.3V-32V in, 1.2V-32V out, 12A, 160W, 50mV, 10mA display resolution, 50mV, 30mA accuracy Step Down Constant Voltage/Constant Current Module - US$13

(8) AliExpress 1W 350mA PWM LED Driver, 5-35V DC-DC dimming input, constant current module - US$17/10pcs

(9) 1 Watt LED Tutorial _Components 101 - 2018mar17

(10) PT4115E Driver Board LED Constant Current Driver Board PWM Stepless Dimming 4-channel Output Default 4*1A

(11) PT4115E Driver Board LED Constant Current Driver Board PWM Stepless Dimming 1-channel Output Default 1A - ¥11.00

(13) Aliexpress PT4115E LED Modules Catalog

(14) How can Rpi4B python UART talk to XY PWM Signal Generators?

(15) What's the voltage used to power LEDs inside an LED light bulb? - EESE 2021jan21

(16) TaoBao PT4115 Constant Current LED Module

(17) PT4115/PT4205/CL6807 LED Module PCB

(18) How can Rpi move a Servo motor using a GPIO pin in PWM mode? RpiSE 2019may11 Viewed 2k times

(19) How to use Rpi python GPIO pins in PWM output mode to create PWM signals?

(20) 24V LED Strip Control Discussion Notes

(21) 24V LED Strip Control Discussion Chat Record

/ to continue, ...


Appendices

Appendix A - PT4115E Datasheet Summary

pt4115 summary

/ to continue, ...


Appendix B - 1W 350mA LED Spec Summary

AliEXpress 1W LED Driver 350mA PWM Dimming, Input 5-35V DC-DC Constant Current Step Module - US$20/10pcs


led driver


  1. Power: LED-1W 350mA ± 20mA

  2. Input range: 5-35V

  3. Supports high PWM dimming off the low output output.

  4. LED buck mode to ensure that the total pressure is less than the input supply voltage 2-3V to work

  5. Ultra-small size design (length 3.6cm * width 2cm), low noise, safety features.

  6. High efficiency, low consumption and stable chip to achieve energy saving and environmental protection projects.

  7. Constant output current, low ripple.

  8. Overload, short circuit, over current protection.


Appendix C - 1W LED Tutorial - Components 101

(9) 1 Watt LED Tutorial _Components 101 - 2018mar17

1 Watt LED Tutorial Summary - Components 101 2018mar17


Appendix D - ZK-JVA-12KX 5.3V-32V in, 1.2V-32V out, 12A, 160W, Constant Voltage / Constant Current PSU

AliEXpress ZK-JVA-12KX 5.3V-32V in, 1.2V-32V out, 12A, 160W, 50mV, 10mA display resolution, 50mV, 30mA accuracy Step Down Constant Voltage/Constant Current Module - US$13


zk_jva_12xx psu


Appendix D - XL Semi XL4001E Constant Current LED Driver

xl4001 led driver


Appendix E - XY-LPWM Sig Gen Notes

(14) How can Rpi4B python UART talk to XY PWM Signal Generators?

xy-lpwm sig gen


Appenidx F - PT4115 Constant Current LED Driver Module DIY References

PT4115 Constant Current LED Module

PT4115/PT4205/CL6807 LED Module PCB


pt4115 led module


pt4115 led module pcb


Appendix F - PT4115E 6V ~ 50V, 1A LED Ddriver Module Preliminary Test v0.1


pt4115e test 1


pt4115e test 2


pt4225e test 3


tlfong01
  • 4,665
  • 3
  • 10
  • 24
  • 1
    thanks a lot! relly interested in the continuation of this part "5. Testing Plan and Hardware Setup". I'm trying to follow everything you wrote ... thank you ! really! – Echoes_86 Mar 15 '21 at 15:01
  • 1
    You are welcome. Stay tuned! – tlfong01 Mar 16 '21 at 01:03
  • 1
    @Echoes_86. Preliminary test of 5050 LED x 13 = 39V, 4 rows (52 LEDs) LED lamp driver (PT4115E) tested OK (Appendix F). Next step is to use Rpi4B and Rpi Pico PWM to do software switching on/off dimming, fade in/out control. Stay tuned. – tlfong01 Mar 26 '21 at 07:57