Go Down

Topic: Controlling ceiling light LEDs (Read 5469 times) previous topic - next topic

MaxG

Mar 30, 2017, 08:19 am Last Edit: Mar 30, 2017, 08:29 am by MaxG
I have been looking at LEDs and how I could control them for two days flat... and am getting nowhere.

I am adding LED lighting to all rooms; some rooms like open plan living will have up to 20 different Watt LEDs; and I wonder how to control these.
E.g. the open plan area has 4 zones, each with two sets of LEDs, direct/strong/hight wattage and light/background lighting/low wattage LEDs.

  • One idea is to use standard LED + driver (230V), connect to a 16-port relay board, and connect the input for the relay board to a triac trailing edge dimmer. this approach takes out any uncertainties about what Voltage each LED requires (as each LED has its own driver).
  • The other idea is to connect the LEDs with DC to a current source with PWM dimming capability and shared high Wattage power supply.


The advantage for 1. is standard off-the-shelf products, but from what I am reading the triac-dimming may result in flicker.
The advantage for 2. may dim better, but seems more difficult to build.

The LEDs will ultimately grouped into zones and controlled by home automation software; here openHAB.

If I can find the right circuit or diagram, I could build boards with 8 individual outputs, maybe where I can adjust V and A to adapt the output to different LED Wattage.

I opened a few drivers, and measured the V; 3W LED runs on 9.5V, and a 5W runs on 18V. It must have something to do how these LED lights are wired internally.

Maybe some DMX controller could drive this???

Any hints, comments appreciated. Thanks.

Mainly using UNOs. Everything needs to be defined.

septillion

1) I don't really get what you want to do but relays an dimming are not friends.. You just want fixed dim levels?

2) Yes, that's the way I would go. Dimming leds via mains (aka, sin chopping) is a pain. And if it's done cheaply you end up with 100Hz dimming. Which looks okay if just sit but watch what happens when objects move at speed... Terrible...

The advantage for 2. may dim better, but seems more difficult to build.
Mm, depends. The pro is you don't have to mess with mains, mains filtering, triac driving etc. And you can just buy the led drivers as modules.

If I can find the right circuit or diagram, I could build boards with 8 individual outputs, maybe where I can adjust V and A to adapt the output to different LED Wattage.
Just but a module for the right wattage. And remember, you NEVER drive a led with voltage, just current. If you set the right current the voltage will just match.

I opened a few drivers, and measured the V; 3W LED runs on 9.5V, and a 5W runs on 18V. It must have something to do how these LED lights are wired internally.
Most of them are just 1W leds in series. As many to match the wattage. 9,5V / 3 = 3,2V, 18V / 5 = 3,6. Last is a bit high but as expected both are close to the forward voltage of a white led :)

Maybe some DMX controller could drive this???
You can probably buy DMX led drivers. But that's going to be some specialist or pro equipment. Not going to be cheap or DIY (why otherwise post on a Arduino forum). And don't know if that's the best setup.

Any hints, comments appreciated. Thanks.
Try to break it up. Easier to have more Arduino nodes in every corner of the room then 1 ├╝ber Arduino that has to manage 20 groups with long wires etc.

And if you're still building, go for a wired communication system. A RS485 bus or something. More reliable (not that wireless is really unreliable but yeah), less energy, less clutter of the spectrum, easier to secure etc.

And controlling it with OpenHAB is cool but don't forget buttons. It's a cool gadget factor you can do everything with your phone but nothing is quicker then pressing a button for normal operations (that can't be done automatic with sensors).
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

MaxG

Thanks... :)
What I want to do... use LED ceiling lights; e.g. like this LED recessed lighting panel... they usually come with a suitable and dimmable driver.

Given I want to do the whole house, say 6 rooms; all up 50-ish LEDs.

Envisage to have an Arduino per room.

Have Ethernet everywhere, and can run KNX, DALI, whatever (like DMX only an example); since I haven't built it, why I am asking.

The set-up won't have buttons, as it simply pointless, given the number of lights. This decision has been made with great considerations and debate, and I won't deviate from it other than: each room has one central LED Oyster, which also houses temp, light, humidity, microphone, presence and motion sensors -- hence, this light can be operated in a traditional way with a switch.

Have you got an example of module to buy? driver and dimmer?

I posted on electrical engineering and got chucked out, as the questions was to broad. However, this is a strategic question, I would expect an engineer would explore. I do not have the current knowledge to decide how to best drive these different wattage LEDs in different rooms, with a system that uses some sort of standard comms and components... while I am open to build circuits if I can't find them ready-made.
The components have to go on DIN rails and subpanels; happy to surface mount, or build circuits which fit on a DIN rail holder; but first I need to get to understand which LEDs, which drivers, and how to dim these.

If I have say 50 LEDs and buy modules for them, they seem to be significantly more expensive than the cheap stuff that comes with LED and runs on 230V... but then, maybe this module can dim the LED properly.

I will install more Watt than I need to light the rooms, and dim them to what I need based on activity or ambient light sensor levels, which simply augments the natural light with additional percent for the LEDs.

I hope this makes sense, otherwise please ask more questions.
Mainly using UNOs. Everything needs to be defined.

septillion

The ceiling lamps like that I've had do indeed have nice light but the driver is always cheap and of the 100Hz (120Hz) mains PWM dimming. Aka, terrible...

And depending on how big a room is that might be okay. But if that means a single Arduino needs to control 8 groups I would rethink that and just scale it down. If you make small universal nodes it's easy to use more then one.

And ethernet is cool but it's not simple nor energy efficient... So I would just use some sort of dedicated wired bus. And if you want wireless I would use something like MySensors. But keep security in mind with wireless. Manufactures ignored that for to long...

And I had to look up "led oyster" :D But do you mean every rooms still has a single, non-domotics light? Okay, it is personal preference but I think mixing normal (/manual) light into a smart home just detracts from the smart aspect...

And again personal preference, but I would hate it if I need to get my phone out of my pocket every time I just want to increase the light because I look for something or I want to start cooking and need more light or even if I want to enable the "romantic mode". Because that you can't detect with normal sensors... I rather just have a button. That buttons triggers a content aware event instead of stupidly turning on the light. So the number of lights is not a part of the equation, it doesn't matter.

And about drivers, the PT4115 is a cool driver. It's a switch mode step down led driver with PWM capability. And you simply set the desired led current with a sens resistor. Up to you to measure the current of the panels and the voltage. Not to drive them with a voltage but because it's a step down driver so you need a supply voltage bigger then that. You can also buy them as modules, already set for a specific current (but you can always change it by swapping the sense resistor).

And on the topic on dimming, keep in mind our eyes are not linear. So you need to implement gamma control if you want it to look more linear. And 8-bit is barely enough to give you some range. And if you need wayy more light then you normally do you might even find that 1/256 of the brightness (step 1 of 8-bit PWM) is still quite bright / to bright for a super low light setting (night mode, movie mode or whatever).
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Wawa

#4
Mar 31, 2017, 02:22 am Last Edit: Mar 31, 2017, 02:23 am by Wawa
I faced the same problems when I wanted to change the lighting in my basement/workshop.
Solved it by designing my own 16-channel PCA9685 LED driver boards.

Currently two of these boards are connected via a 2-wire I2C bus to a Mega with ethernet shield.
The mega also has movement/daylight sensors etc., a voice recognition module with RF link, and a web page to control things. Each LED driver board has a beefy 24volt supply.
I am using the 60-LEDs/12watt downlights from your link, and had to modify them for a Vf of ~18-20volt.
It involved cutting the LED strip inside in half, and connecting the two 30-LED halves in parallel.
This would not be needed if you would use 30-LED/6watt downlights.
All working 24/7 without big problems.

I am currently experimenting/designing the same LED driver board with onboard "bare" ESP-12 WiFi module.
That would eleminate the Mega and I2C/ethernet wiring.
Could be a few months away though.
Leo..


MaxG

And ethernet is cool but it's not simple nor energy efficient...
Ethernet is a must, as I have everything wired... as I am wired and do not like radiation in my house...

do you mean every rooms still has a single, non-domotics light?rom the smart aspect...
This is a compromise for all the nay sayers who think we need a light switch... however, I started to like the idea for two reasons:
1. Any stranger / visitor can operate a light switch
2. it provides a "housing" for my electronics I had to put somewhere; and this type of light fitting (so not to everyone's taste) is a nice 'case' to house my electronics/sensors.


I would hate it if I need to get my phone out of my pocket every time I just want to
Me too :) No, this is the first step of the puzzle... voice control will follow later...
Lights go on based on presence and by ambient lighting...


drivers, the PT4115 is a cool driver
Had a look, should do the trick...

dimming, keep in mind our eyes are not linear.
... understood.



I faced the same problems when I wanted to change the lighting in my basement/workshop.
Thank you! I have been waiting for a response like this for almost one year. The big picture questions was raised then, as it was now. I could not believe that I was unable to round up an answer to my question, because people were either concerned with connecting 'a' LED to an Arduino, or they used off-the-shelve products.

What you have done is very close to to what I envisage... and I am very interested in hard and software of your project.


There seems to be an advantage for using the same wattage, but I can see different, say, 16-port boards (when using the PCA9685 -- which I would use too), each covering a different LED power consumption range.

I would use MQTT for the messaging / comms -- as this is the standard I have adopted for home automation control (as much as possible).

Why was the modification for the 12W LEDs required?
I rather use 12W than having to go to lower watt LEDs. In fact I am aiming to use three different Watt LEDs, and distribute these like bubbles in soda; meaning in (seemingly) a random size random location on the ceiling. "Seemingly" because the bigger ones will sit where needed, while the smaller ones fill in.

Mainly using UNOs. Everything needs to be defined.

Wawa

Why was the modification for the 12W LEDs required?
I rather use 12W than having to go to lower watt LEDs. In fact I am aiming to use three different Watt LEDs, and distribute these like bubbles in soda; meaning in (seemingly) a random size random location on the ceiling. "Seemingly" because the bigger ones will sit where needed, while the smaller ones fill in.
Those ceiling lights have five 0.2watt LEDs in parallel.
Power rating of the light is how many of those groups of five are connected in series.
6 groups for a 6watt light, and 12 groups for a 12watt light.

Common/cheap (buck) CC LED drivers need a higher supply voltage than Vf (working voltage) of the LEDs.
If you use a 24volt supply (common/cheap), you should use LED strings of six (Vf 6 * ~3.3volt) for max efficiency.
A 6watt light (30 LEDs) is already a string of six, and can be used directly.
A 12watt light (60 LEDs) would need a 36-40volt supply.
Costly/rare, and buck LED drivers don't like such a high voltage.
Not too hard to cut the ribbon in half, and parallel the two.

https://www.sparkfun.com/products/13705
This LED driver can be configurated for 6watt (330mA) or 12watt (660mA) with a solder bridge.

I would first order one of each light (they come with a small, not dimmable, mains power supply).
I think you will find that there is not that much light difference between a 6watt and a 12watt light.
Leo..

MaxG

#7
Mar 31, 2017, 02:36 pm Last Edit: Mar 31, 2017, 02:43 pm by MaxG
Thank you... this post makes it clear to me what has puzzled me for a quite a while... how these LEDs are build and why they have the V and A they have... just pulled a 3W of these apart and it has 15 diodes... this should be 3 groups of 5 LEDs or 5 x 0.2W = 1W with 3 in series = 3W; the driver puts out 9.5V.

Would you share code and PCB files so that I can replicate the project?

Well, your post has certainly given me some answers I was looking for...

Assuming I can build this board, I can solve the following problems:
a) it is a working solution
b) I have software control over it; e.g. theme-ing, grouping
c) I should be able to change the schematic to cater for, say 3 different LED wattages
d) it is low Voltage; hence, no need for an electrician to install (which at 230V is a legal requirement in AU)
e) no plugs and drivers in the ceiling; thus reducing the risk of fire or repair in the ceiling
f) the PCA9685  you've used staggers the switching on of LEDs, thus avoiding the initial spike if all come on at the same time.

Nice!
Mainly using UNOs. Everything needs to be defined.

septillion

Ethernet is a must, as I have everything wired... as I am wired and do not like radiation in my house...
Not saying you must use Wifi or wireless at all. But I think it's a stupid connection method for just dimmers... It's made for speed, not efficiency. And every mode then needs to have a separate cable to a switch. So I would opt for a dedicated bus.

This is a compromise for all the nay sayers who think we need a light switch... however, I started to like the idea for two reasons:
1. Any stranger / visitor can operate a light switch
2. it provides a "housing" for my electronics I had to put somewhere; and this type of light fitting (so not to everyone's taste) is a nice 'case' to house my electronics/sensors.
Nothing against a switch or a "housing" :) What I do find stupid in a smart home is to have non-smart lights mixed in... Just let the system control that light as well. And for the visitors, that switch is great. Just let it trigger a macro and let it do the expected aka turn on the light :)

voice control will follow later...
If you like that, that's up to you. (Y) But for day to day tasks a switch is simpler and in my opinion voice commands are just a gimmick :) Especially when I have the volume cranked up to 11 and I'm practicing my dance moves and I just want to turn on the work light (/work light mode) in the kitchen to start cooking.

Not saying you should not have voice commands! Just saying, don't skip on switches and/or control panels as well :)

Lights go on based on presence and by ambient lighting...
That's indeed the minimum. Without it I wouldn't dare to call it smart :p But keep in mind sensors can't sens every situation.

There seems to be an advantage for using the same wattage, but I can see different, say, 16-port boards (when using the PCA9685 -- which I would use too), each covering a different LED power consumption range.
If you make them yourself you can just wack on different sens resistors and mix and match what you need. Or if you really don't want to think about it while assembling, just add multiple and add jumpers to select the current. But I would say that's a bit overkill and just using the resistor you need is easier.

@Wawa, apart from 24V supplies being more widely available, is the efficiency that much better by dropping less? After all the PT4115  is a pretty efficient switch mode driver overall.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Wawa

@Wawa, apart from 24V supplies being more widely available, is the efficiency that much better by dropping less? After all the PT4115  is a pretty efficient switch mode driver overall.
Look at the efficiency graph in the PT4115 datasheet.
Efficiency of a buck driver is highest (>95%) if Vf is about 3-5volt less than supply.
A 3-string on 24volt drops to ~91%, and a single LED on 24volt drops to 80%.
24volt, and a string of six, works quite well.

24volt is also easier if you eventually want to run the whole lighting system on solar power.
Leo..

Wawa

I would make a test setup with an Adafruit PCA9685 breakout board (clones on ebay).
https://www.adafruit.com/product/815

And some CC LED drivers that can be changed from 330mA (6watt downlight) to 660mA (12watt downlight).
e.g. this one
https://www.sparkfun.com/products/13705

Meanwell also has suitable (fixed) ones.

Then start coding, untill you are happy with the results.
I use this library.
https://github.com/brunnels/PCA9685

Recent post.
http://forum.arduino.cc/index.php?topic=466709.0

Moving to a dedicated all in one circuitboard could be a final stage.
Leo..

MaxG

What I do find stupid in a smart home is to have non-smart lights mixed in...
Any system will have risks associated with it.
The dumb light will cater for a failure of the home automation (HA) system.
However, I could still make it controllable... :)


Focussing on LED control on its own, I now understand:

  • why I need constant current (CC), and
  • why the V per LED fixture is different for different Wattages
  • why adding fixtures in series


The principle design of a 16-channel controller as I see it at present is:

  • Use of a PCA9685 for on, off, PWM dimming, to
  • drive CC modules -- most likely settling on either Meanwell LDD-L and LDD-H drivers
  • matching the number of fixtures to the driver


... all I need to do is figure out the combinations of fixtures and drivers, and whether I mix driver types per board for more versatility; e.g. 16 ports comprised of 8 x 6W, 6 x 12, and 2 x 18W...
Or base the multi-channel board on Voltage required; e.g. LDD-L all 6W on 24V and LDL-H 12/18W on 48V

I have ordered samples of all the components in order to start experimenting and prototyping.

Feel free to chip in if my principle design ideas are flawed which ever way... thanks :)
Mainly using UNOs. Everything needs to be defined.

Wawa

The Meanwell LDD-L is designed for a 24volt supply (6-string LEDs).
It is basically the same as the PicoBuck boards. But fixed current, encapsulated and a higher price.
Use the -300 for 6watt downlights, and the -600 for modded 12watt downlights.

The LDD-H is the high voltage version. It could be used for 12watt/12-string downlights directly.
Downside could be the higher price of an 48volt supply.
Better choice ofcourse if you already have a high power off-grid 48volt battery-powered system.
These, and 48volt supply, is not a good match for <12watt downlights.
Leo..

MaxG

48volt supply, is not a good match for <12watt downlights.
Since I have no issue with not dimming each individual light, I can put e.g. 2 x 6W in series.
I can see myself settling on 48V; it can be adjusted from 40 to 52V. When set to 43V, I will be in the ball park for high efficiency.
Then driving 2 x 6W in series, or 1 x 12W... this should work and simplify things.

E.g a smaller room will either have 2 or four lights.
Larger rooms a mix of 2x6W and 12W fixtures...

 :)
Mainly using UNOs. Everything needs to be defined.

Wawa

Since I have no issue with not dimming each individual light, I can put e.g. 2 x 6W in series.

I can see myself settling on 48V
Yes. If the lights are the same inside.

24volt is about AU$0.10/watt, shipped free from China. Compare that to 48volt.
Go for the natural cooled ones (you don't want to hear/replace fans).
Supplies have coil whine (buzzing noise).
Metal frame supplies have exposed mains power terminals.
You must use them in an "electrically safe" case/box/switchboard.

LDL-H 12/18W on 48V
Don't know what's inside an 18watt light.
Could be two strings of nine (Vf ~30volt) or a single string (Vf ~60volt).
LED CC rating of the power supply in the box will tell you.
Leo..

Go Up