Other people: It has almost nothing inside, they've skimped on parts, it must be crap. Leo: What a great, price-optimized feat of engineering, it does what it needs to do well at the lowest price point possible, hats off to the designers. It really shows you've designed more than your fair share of products. Anyway, great video, thanks for that! I have to say, I did not expect the synchronization issue at all!
I am a retired EE. I really appreciate your level of expertise. Your videos are entertaining, informative, and I almost always leave them saying “I want to build that!”
You could also try and mess with current sense resistors. You can add another resistor in series with already soldered ones and bridge it with mosfet. you must set minimum current with that resistor, and there is no way to turn it completely off, but you should turn off power anyways. It works even better if IC has separate feedback pin, because you can inject current and make it analog dimmable. * Storage inductor may need to be higher value in some cases when lowering current.
Can't wait to see your channel become famous (and I'll feel proud being an early subscriber 😅). With such amazingly high quality contents, you deserve it.
I really like you style of presenting, which is both technical and layman to move things along. Personally, the DALI thing is probably more of a deterrent for a lot of us who simply want to convert a non-dimmable LED to dimmable via a standard LED dimmer. Excellent work!
I understand your point- consider that there are many other ways to get the dimmer data into that micro. You could add a radio, an IR receiver, Bluetooth... etc.
@@leosbagoftricks3732 I kind of regret being too picky about the DALI protocol, so I came up with this sofware only solution: Set the dimmer value via morse code. Normal on-off switch switches on the last setting, and new brightness value can be added via multiple on-off switch cycles. Even an RTC can be spared (and the button cell too), the PIC16F1575 has 128byte eeprom, so the on time can be written (0.5s, 1s, 2sec, 5sec), so it knows how long was the previous ON time. I'm kind of impatient for the release, but even your specific led lighting model is unavailable here. I could not find the philips BN016C locally only BN013C, which is ~20USD, and I was not able to decipher the modell number of the round one. edit: maybe the philips meson line is a good alternative: www.lighting.philips.com.my/consumer/p/recessed-spot-light/5920431H1
Great job here, you really went in-depth and covered a number of aspects (rather then just hacking a poor solution together). Learned quite a bit and looking forward to more, thanks!
Great video indeed. Very inspiring. What is fantastic is also to get the possibility to understand step by step the engineering process. So a big thanks for sharing
I am not sure how I found your channel. But I am subscribed and I will be watching you previous videos. Thank you for sharing your thoughts on these matters.
Hi, Leo. Thanks for the content. Do you think it would be worth it to build the whole driver from scratch to be dimmable ? It looks to me that, after including another power supply and a microcontroller, it would be easier to make the microcontroller control a current regulator directly, right? (Im a young engineer with little experience) =D
What about using a optocoupler to change the led linear regulator current sense resistor(s), then only one optocopler is needed per lamp if your controlling more than one? much less parts and rework? Thanks for sharing!
Hmmm. Interesting idea. So you mean an analog current loop? That could work, the two problems I see would be linearity and poor dimming ratio. Hard to get large ratios of dimming with analog current control, and you also get color temperature shifts that you don't get with PWM.
@@leosbagoftricks3732 I was thinking pwm the opto's input led (but analog may work also). It would take a little tuning on the resistors (I would use a resistor decade box to speed the tuning up), and pwm freq. It might not be 0 to 100% pwm, but maybe some other value like 15% to 100%. Again thanks for sharing your video.
Which are DALI's accepted commands and in which format ( frame )? , otherwise, great job integrating the synchronization of the PWM into firmware of the PIC!! Quite great stuff!
Hi Leo, I was wondering if you had some ideas for a similar problem I'm facing. I have just replaced a bath fan with an integrated dimmable LED fixture. The light is wired into the rest of the bath lights and the fan is on a separate switch. The new fan light is super bright, jarringly bright in fact. Is it possible to permanently dim that fan light without putting the vanity lights on the same dimmer switch? Could I replace the driver for a lower output one? I should note that I'm an idiot and a lot of this video went straight over my head... Also this particular fan is the only one big enough to cover the existing hole in the ceiling.
It's always a matter of effort Vs. results. You might be able to change some resistors, mess around bypassing some LED's etc. But how about some dumber(smarter) ideas? Buy some window tint film and place it over the LED's ?
The round one is made by LAMPTAN, the other is a PHILIPS product. There are many companies making mains-powered LED fixtures with the same basic topology.
The problem with DALI protocol, the switch also needs Line *AND* Neutral, which usually not the case (normally only the line is present at the switch). THEN it needs 2 more low voltage wires which you need to run separated from the high voltage. So a simple retrofit is almost never possible. To address this problem, I use the switch with an IKEA wireless dimmer (TRADFRI) which costs about 6USD. So I switch the light on-off, and I dimmer it independently if I want lower settings. Would love to see you also incorporating some kind of radio solution. Besides a matching DALI switch (just the switch itself, Berker 2858) costs about 92USD where I live. And I would also needs some remodelling for retrofit(getting Neutral to the switch and also low voltage wire routing), which is price prohibiting. One switch retrofitting would easily costs me about 1000USD at least. So a 6USD RF IKEA dimmer is a better way for my case and I think for most of the others too. What do you think?
@Joachim Shekelberg Everyone's case is different I suppose. For me it is a brick wall with concrete pillars with embedded plastic tubes (conduits), which is crazy expensive to extend it is basically "set in stone" (and for low voltage wires I need a new conduit which is a legal requirement here). Most of the costs comes of the many professions involved here, I need an electrician, there will be masonry work (brick and concrete involved) and also a painter at the end. I think I was a bit optimistic of the 1000 USD pricetag earlier. But if you have a drywall with fake plasterboard ceiling, the price will be most definietly lower, I agree. Still when you need to call workers from different domains(electrician and painters at the very least), it starts to add up pretty fast. Just my opinion though.
I am building a new house from scratch, so it will be cheap and simple to wire this in my case. You are totally right that for retrofit applications the wiring is a pain. I am kind of allergic to all this IoT and wireless stuff, I love the simplicity and reliability of wired solutions.
@@leosbagoftricks3732 Well, I'm in the middle of building my house (7 years now, pretty big), I would be happy to chat about yours, feel free to drop me a DM. Speaking of the lighting, I gravitated towards the middle ground, on-off switching with regular switches, and brightness via RF. I have a friend how wired his whole building without any switches, each room is controlled via smartphone app. Which is kind of the other end of the spectrum maybe even the cheapest (manual labour is always expensive, each room got an ethernet connected relay box). Also the DALI switches are crazy expensives.
@@laszlokrekacs6545 That sound interesting, and a big pain in real life. Decent wired connections for as much as possible is proven, and most likely going to cause far few problems in the years and decades to come... Personally, it while the DALI protocol seems nice, it also seems like a lot of work for those many locations that simply don't need it. If I were to find a really nice light/fixture, as shown, it seems like it would be simpler to simply rebuild the power circuit with PWM included to replace the stock one which can connect to a standard LED dimmer. However, this was a master class at re-engineering.
It would be interesting to see how the 120VAC version of the LED power supply differs from the 230VAC version. Likely only a couple component changes, unless there are any regulatory issues that cause a larger change.
Thanks again ! It's a wonder video. I have very little knowledge about AC circuits so I will probably need to learn more before implementing it, but I definitely have flickering chinese LED strip that I'll try to fix once I understand more. Quick question : how this kind of display of schematics of big manufacturer plays with patents laws ? Is it okay as long as you don't reproduce the circuit and sell it ? I'm clueless.
If it's patented, it's already public information and you can view and show the original patent, they are not secrets. You can't just produce and sell products that violate the patent. But simple little circuits like this are most likely not patented nor patentable, they're just basic electronic circuits (that's like trying to get a patent for a "table"). The circuit board design is (automatically) copyrighted, and that just means Leo can't copy their board design and produce and sell EXACT copies. If you're curious about intellectual property, there are lots of website to learn the basics.
Nice hack , and very good documentation and presenting However , I think the dimming part is a little bit over engineering , considering the original control is done using this three pin KP1050A device . You already mentioned the original feedback resistor in the 3 pin dimming circuit . Wouldn't it be much easier to alter this resistance value instead of a new pwm circuit ? My idea is replacing the original current feedback resistor with lets say some other resistors and making a dimmer shorting accordingly these resistors . It may not have continuous dimming but for more people a few steps dimmer is more than enough. I think it would work OK and would be simpler . Considering the DALI interface needs extra wiring , a retrofit project would perhaps benefit more from a wireless interface , like a BLE controller .
@@jamesbrown99991 Generating an offset voltage based on a smoothed PWM (could be a µC or even a 555) and injecting it on CS via a resistive divider. Rcs can be calculated for the lowest brightness and the offset voltage will add to the control loop all the way to full brightness. However : "A disadvantage to analog dimming is that the color temperature of the emitted light can vary as a function of LED current. In situations where the color of the LEDs is critical, or the particular LED exhibits a large change in color temperature with changes in LED current, dimming the output of the LED by changing the LED current would be prohibitive." source : tinyurl.com/357dy56n
If you read the data sheet for the chip, the way it samples the sense resistor voltage is not straightforward, I don't think it would be that easy. Even if you could, the dynamic range of dimming would not be very large, and OFF is not an option.
@@inotoff CS is not just a feedback pin; the full switch current comes out of this pin (i.e. 250mA). For this reason, you'd need a low impedance driver to inject your voltage. There's the added issue that the CS pin is used reference VCC; this means that the analog voltage you inject will just increase VCC by the same amount, and the current will therefore not be affected by the injected voltage. The combination of resistors will set the current, and because the resistor values are constant, so is the current. One approach that would work is switching in different resistors (e.g. 4 switched resistors could give 16 levels of brightness), but this uses more parts than Leo's version, and doesn't provide an OFF setting.
@@jamesbrown99991 Thank you for detailed reply. If changing the resistors work, what about adding a Mosfet parallel to the resistors to control the overall current flow out of CS? (leaving the OFF option out)
If you just need high/low setting for your dimmer, you can dim many non-dimmable LED bulbs with just a capacitor. ruclips.net/video/JH68wBXO5j0/видео.html If your LED driver dies, on some light fixtures, you can replace the driver board with a simple capacitor dropper LED driver circuit. You can then switch out capacitors to control the brightness level. You can also change the value of the current sense resistor on the LED driver circuit, to control the LED brightness level.
I love your channel the ONLY criticism I have is that, as a novice, I feel you are too quick sometimes when explaining the electronics because it is so easy for you, you have forgotten us aged poor souls who need to slower explanation before they grasp a concept.
Noted! it's really hard to decide what level to aim for. I always want things to be just a bit over my head- if I understand everything then there is nothing to learn? Right?
First time seeing this kind of "sliced up solid pcb tinned" smt method. Maybe you could talk about that. Great videos - a chance to learn from a master.
Other people: It has almost nothing inside, they've skimped on parts, it must be crap.
Leo: What a great, price-optimized feat of engineering, it does what it needs to do well at the lowest price point possible, hats off to the designers.
It really shows you've designed more than your fair share of products. Anyway, great video, thanks for that! I have to say, I did not expect the synchronization issue at all!
The sync thing is really about perfectionism, I hate even the most subtle flickering!
@@leosbagoftricks3732 2:57-3:02 Is it flickering, or just some unfortunate editing? Or the room light is completely different?
I am a retired EE. I really appreciate your level of expertise. Your videos are entertaining, informative, and I almost always leave them saying “I want to build that!”
One of the best channels for this type of content. I also happen to build some of your circuits and they do work well!
This is the best channel on RUclips
It won't be long and you will be huge!! Great Stuff!
You could also try and mess with current sense resistors. You can add another resistor in series with already soldered ones and bridge it with mosfet. you must set minimum current with that resistor, and there is no way to turn it completely off, but you should turn off power anyways.
It works even better if IC has separate feedback pin, because you can inject current and make it analog dimmable.
* Storage inductor may need to be higher value in some cases when lowering current.
Good explanation, good editing, good information = great stuff
Can't wait to see your channel become famous (and I'll feel proud being an early subscriber 😅).
With such amazingly high quality contents, you deserve it.
I really like you style of presenting, which is both technical and layman to move things along. Personally, the DALI thing is probably more of a deterrent for a lot of us who simply want to convert a non-dimmable LED to dimmable via a standard LED dimmer. Excellent work!
I understand your point- consider that there are many other ways to get the dimmer data into that micro. You could add a radio, an IR receiver, Bluetooth... etc.
@@leosbagoftricks3732 I kind of regret being too picky about the DALI protocol, so I came up with this sofware only solution:
Set the dimmer value via morse code. Normal on-off switch switches on the last setting, and new brightness value can be added via multiple on-off switch cycles. Even an RTC can be spared (and the button cell too), the PIC16F1575 has 128byte eeprom, so the on time can be written (0.5s, 1s, 2sec, 5sec), so it knows how long was the previous ON time. I'm kind of impatient for the release, but even your specific led lighting model is unavailable here. I could not find the philips BN016C locally only BN013C, which is ~20USD, and I was not able to decipher the modell number of the round one. edit: maybe the philips meson line is a good alternative: www.lighting.philips.com.my/consumer/p/recessed-spot-light/5920431H1
Great job here, you really went in-depth and covered a number of aspects (rather then just hacking a poor solution together). Learned quite a bit and looking forward to more, thanks!
A great video yet again, you really invested effort into the design i love it
Great video indeed. Very inspiring. What is fantastic is also to get the possibility to understand step by step the engineering process. So a big thanks for sharing
Your channel is extraordinary. I hope you grow.
I am not sure how I found your channel. But I am subscribed and I will be watching you previous videos. Thank you for sharing your thoughts on these matters.
Hi, Leo. Thanks for the content. Do you think it would be worth it to build the whole driver from scratch to be dimmable ? It looks to me that, after including another power supply and a microcontroller, it would be easier to make the microcontroller control a current regulator directly, right? (Im a young engineer with little experience) =D
A microcontroller and current regulator would be more expensive most likely.
What about using a optocoupler to change the led linear regulator current sense resistor(s), then only one optocopler is needed per lamp if your controlling more than one? much less parts and rework? Thanks for sharing!
Hmmm. Interesting idea. So you mean an analog current loop? That could work, the two problems I see would be linearity and poor dimming ratio. Hard to get large ratios of dimming with analog current control, and you also get color temperature shifts that you don't get with PWM.
@@leosbagoftricks3732 I was thinking pwm the opto's input led (but analog may work also). It would take a little tuning on the resistors (I would use a resistor decade box to speed the tuning up), and pwm freq. It might not be 0 to 100% pwm, but maybe some other value like 15% to 100%. Again thanks for sharing your video.
I really like your design philosophy. I too like elegant design.
Thank you!
Thank you for this excellent video! What's the purpose of R6 (510k) in the current source that drive the opto's LED?
Good question - the DALI circuitry is copied from an application note, I stared at it for a while, I don't know what R6 does either!
Awesome, as usual! And so well explained...
I really liked this and I will do my best to point people your way.
Which are DALI's accepted commands and in which format ( frame )? , otherwise, great job integrating the synchronization of the PWM into firmware of the PIC!! Quite great stuff!
Hi Leo, I was wondering if you had some ideas for a similar problem I'm facing. I have just replaced a bath fan with an integrated dimmable LED fixture. The light is wired into the rest of the bath lights and the fan is on a separate switch. The new fan light is super bright, jarringly bright in fact. Is it possible to permanently dim that fan light without putting the vanity lights on the same dimmer switch? Could I replace the driver for a lower output one?
I should note that I'm an idiot and a lot of this video went straight over my head... Also this particular fan is the only one big enough to cover the existing hole in the ceiling.
It's always a matter of effort Vs. results. You might be able to change some resistors, mess around bypassing some LED's etc. But how about some dumber(smarter) ideas? Buy some window tint film and place it over the LED's ?
@leosbagoftricks3732 that's actually brilliant. I have some adhesive tint film specifically for dimming LEDs on electronics. Thanks for the idea
Wow just the right project. I was doing exactly this project!
Share how it goes~
Elegant design, can you tell me who manufacturers LED.
The round one is made by LAMPTAN, the other is a PHILIPS product. There are many companies making mains-powered LED fixtures with the same basic topology.
Thank you from Morocco
The problem with DALI protocol, the switch also needs Line *AND* Neutral, which usually not the case (normally only the line is present at the switch). THEN it needs 2 more low voltage wires which you need to run separated from the high voltage. So a simple retrofit is almost never possible.
To address this problem, I use the switch with an IKEA wireless dimmer (TRADFRI) which costs about 6USD. So I switch the light on-off, and I dimmer it independently if I want lower settings. Would love to see you also incorporating some kind of radio solution. Besides a matching DALI switch (just the switch itself, Berker 2858) costs about 92USD where I live. And I would also needs some remodelling for retrofit(getting Neutral to the switch and also low voltage wire routing), which is price prohibiting. One switch retrofitting would easily costs me about 1000USD at least. So a 6USD RF IKEA dimmer is a better way for my case and I think for most of the others too. What do you think?
@Joachim Shekelberg Everyone's case is different I suppose. For me it is a brick wall with concrete pillars with embedded plastic tubes (conduits), which is crazy expensive to extend it is basically "set in stone" (and for low voltage wires I need a new conduit which is a legal requirement here). Most of the costs comes of the many professions involved here, I need an electrician, there will be masonry work (brick and concrete involved) and also a painter at the end. I think I was a bit optimistic of the 1000 USD pricetag earlier. But if you have a drywall with fake plasterboard ceiling, the price will be most definietly lower, I agree. Still when you need to call workers from different domains(electrician and painters at the very least), it starts to add up pretty fast. Just my opinion though.
I am building a new house from scratch, so it will be cheap and simple to wire this in my case. You are totally right that for retrofit applications the wiring is a pain. I am kind of allergic to all this IoT and wireless stuff, I love the simplicity and reliability of wired solutions.
@@leosbagoftricks3732 Well, I'm in the middle of building my house (7 years now, pretty big), I would be happy to chat about yours, feel free to drop me a DM. Speaking of the lighting, I gravitated towards the middle ground, on-off switching with regular switches, and brightness via RF. I have a friend how wired his whole building without any switches, each room is controlled via smartphone app. Which is kind of the other end of the spectrum maybe even the cheapest (manual labour is always expensive, each room got an ethernet connected relay box). Also the DALI switches are crazy expensives.
@Joachim Shekelberg What are you, ignorant? Most places in the world do not run AC in conduit. So many of your comments are so euro-centric...
@@laszlokrekacs6545 That sound interesting, and a big pain in real life. Decent wired connections for as much as possible is proven, and most likely going to cause far few problems in the years and decades to come... Personally, it while the DALI protocol seems nice, it also seems like a lot of work for those many locations that simply don't need it.
If I were to find a really nice light/fixture, as shown, it seems like it would be simpler to simply rebuild the power circuit with PWM included to replace the stock one which can connect to a standard LED dimmer. However, this was a master class at re-engineering.
Interesting idea to shunt the load in the buck circuit. For me the only solution would have been to replacing the buck ic with a roll-my-own.
@Joachim Shekelberg Cap droppers don't work everywhere.
If the load current is high- the capacitors required become large and very expensive!
It would be interesting to see how the 120VAC version of the LED power supply differs from the 230VAC version. Likely only a couple component changes, unless there are any regulatory issues that cause a larger change.
Yes- I would imagine the main inductor is a smaller value, and maybe some parts are of a lower voltage rating? Save a few pennies?
Thanks again ! It's a wonder video. I have very little knowledge about AC circuits so I will probably need to learn more before implementing it, but I definitely have flickering chinese LED strip that I'll try to fix once I understand more.
Quick question : how this kind of display of schematics of big manufacturer plays with patents laws ? Is it okay as long as you don't reproduce the circuit and sell it ? I'm clueless.
It's an interesting question, do I have the right to draw and publish schematics of a device I own? Who knows just how ridiculous this could get?
If it's patented, it's already public information and you can view and show the original patent, they are not secrets. You can't just produce and sell products that violate the patent. But simple little circuits like this are most likely not patented nor patentable, they're just basic electronic circuits (that's like trying to get a patent for a "table"). The circuit board design is (automatically) copyrighted, and that just means Leo can't copy their board design and produce and sell EXACT copies. If you're curious about intellectual property, there are lots of website to learn the basics.
Awesome ❤😀👍👍
Nice hack , and very good documentation and presenting
However , I think the dimming part is a little bit over engineering , considering the original control is done using this three pin KP1050A device .
You already mentioned the original feedback resistor in the 3 pin dimming circuit . Wouldn't it be much easier to alter this resistance value instead of a new pwm circuit ?
My idea is replacing the original current feedback resistor with lets say some other resistors and making a dimmer shorting accordingly these resistors . It may not have continuous dimming but for more people a few steps dimmer is more than enough.
I think it would work OK and would be simpler .
Considering the DALI interface needs extra wiring , a retrofit project would perhaps benefit more from a wireless interface , like a BLE controller .
Amazing HACK!!
Where are you. People still watch your videos. I hope you're doing ok.
Great video
Why can't we just play with the CS pin?
How do you propose that?
@@jamesbrown99991 Generating an offset voltage based on a smoothed PWM (could be a µC or even a 555) and injecting it on CS via a resistive divider. Rcs can be calculated for the lowest brightness and the offset voltage will add to the control loop all the way to full brightness. However : "A disadvantage to analog dimming is that the color temperature of the emitted light can vary as a function of LED current. In situations where the color of the LEDs is critical, or the particular LED exhibits a large change in color temperature with changes in LED current, dimming the output of the LED by changing the LED current would be prohibitive."
source : tinyurl.com/357dy56n
If you read the data sheet for the chip, the way it samples the sense resistor voltage is not straightforward, I don't think it would be that easy. Even if you could, the dynamic range of dimming would not be very large, and OFF is not an option.
@@inotoff CS is not just a feedback pin; the full switch current comes out of this pin (i.e. 250mA). For this reason, you'd need a low impedance driver to inject your voltage.
There's the added issue that the CS pin is used reference VCC; this means that the analog voltage you inject will just increase VCC by the same amount, and the current will therefore not be affected by the injected voltage. The combination of resistors will set the current, and because the resistor values are constant, so is the current.
One approach that would work is switching in different resistors (e.g. 4 switched resistors could give 16 levels of brightness), but this uses more parts than Leo's version, and doesn't provide an OFF setting.
@@jamesbrown99991 Thank you for detailed reply. If changing the resistors work, what about adding a Mosfet parallel to the resistors to control the overall current flow out of CS? (leaving the OFF option out)
If you just need high/low setting for your dimmer, you can dim many non-dimmable LED bulbs with just a capacitor.
ruclips.net/video/JH68wBXO5j0/видео.html
If your LED driver dies, on some light fixtures, you can replace the driver board with a simple capacitor dropper LED driver circuit. You can then switch out capacitors to control the brightness level. You can also change the value of the current sense resistor on the LED driver circuit, to control the LED brightness level.
Can't we just modify RS1 and RS2 values to adjust the current?
I had to watch this twice but the "light went on" half way through the second view. Great hack...
I love your channel the ONLY criticism I have is that, as a novice, I feel you are too quick sometimes when explaining the electronics because it is so easy for you, you have forgotten us aged poor souls who need to slower explanation before they grasp a concept.
Noted! it's really hard to decide what level to aim for. I always want things to be just a bit over my head- if I understand everything then there is nothing to learn? Right?
First time seeing this kind of "sliced up solid pcb tinned" smt method. Maybe you could talk about that. Great videos - a chance to learn from a master.
This video covers the subject: ruclips.net/video/vq968AFgPhg/видео.html
Huge fan of your engineering attitude. Your videos are not only well put together and entertaining but also very inspiring.