Author Topic: Multi-channel LED controller for doll house  (Read 7693 times)

0 Members and 1 Guest are viewing this topic.

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Multi-channel LED controller for doll house
« Reply #25 on: July 07, 2019, 04:02:26 pm »
03-APA102-multi-strands-code can be used to drive two APA102 strands at once.

Tested on an Arduino Pro clone, using pins D2 for shared clock, D3 for data 1, D4 for data 2, D7 for IR output, D8 for IR Vcc, D9 for IR GND
 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #26 on: July 08, 2019, 12:37:08 am »
Good stuff. I'm eagerly waiting for HW to arrive and start tinkering. In a meanwhile I'll at least try to compile it locally to make sure my SW toolchain is working.

Btw, kudos for talking me into APA102 instead of WS8212. After learning about PRM, its frequency, flickering, and POV I think I'd much appreciate APA's much higher PWM frequency (5-20khz vs ~500hz).
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Multi-channel LED controller for doll house
« Reply #27 on: July 08, 2019, 01:09:11 am »
The software drive is way more reliable as well. Very much timing insensitive; you can drive it with hacky code on any pair of pins you like, including sharing clock pins, very easily.
 
The following users thanked this post: haizaar

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #28 on: July 16, 2019, 11:49:03 am »
Project update - arduino and a led strip have arrived.

I can't succeed in driving leds though :(
The details are here https://github.com/haizaar/doll-house-lights/issues/5
If anyone can help with hints on how further to debug it, I'll be grateful.
 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #29 on: July 17, 2019, 03:02:10 pm »
Eventually  the first led was somehow broken and blocked the path towards the rest. Cutting it off and resoldering did the tick. Hooray!!!

Now waiting for IR stuff to arrive.
 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #30 on: July 18, 2019, 02:40:22 pm »
Here is SCRUM-style progress (sorry for the mess in the house :)

https://photos.app.goo.gl/LJ43Cp7cCqx1h2Va6
https://photos.app.goo.gl/vRmkdq2oC7HZSFLf9
https://photos.app.goo.gl/j2LyQtoV4fQSu8mJA

I'll get some end-user feedback when she wakes up :)

The light looks bright on pictures, but in reality is not that strong. I though I'll get away with a single led per room, but I think I'll need about 4. Once my 30led/m strip arrives, I'll cut it in lengths or 4 and will make nice 12cm long "light fixtures" out of it.

Also it turned out to be quite challenging to configure leds to produce something that looks like "warm white" light - I fiddles quite a lot with RGB/HSV, and even tried conversion tables [1] and still couldn't find that ~3500k warm white that my home (human home) LED globes produce.
Does anyone have any ideas on this?

http://planetpixelemporium.com/tutorialpages/light.html
 

Online Kasper

  • Frequent Contributor
  • **
  • Posts: 742
  • Country: ca
Re: Multi-channel LED controller for doll house
« Reply #31 on: July 18, 2019, 05:23:24 pm »
Congratulations on getting it running!

Adafruit has a lot of example code and tutorials for LED strips.  Following this point might reduce the chance of first LED dieing again:
Quote from: adafruit
adding a 1000µF (6.3V or higher) capacitor close to the strip (between 5V and GND wires) is a good idea, do it!
https://learn.adafruit.com/adafruit-dotstar-leds/power-and-connections

If you really want white or warm white, there are a variety of other LED strips:
RGBW
White yellow orange
White only
Warm white only
 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #32 on: July 18, 2019, 11:55:54 pm »
Thanks pointing out about capacitor. I missed that.

Can you comment on why is it a good idea as they say, what does it impact?

As for other strips - yes, but they are not addressable, which is the whole point of the project. I though that if leds can reproduce any colour, then they should be capable producing warm white as well. Isn't it so?
 

Online Kasper

  • Frequent Contributor
  • **
  • Posts: 742
  • Country: ca
Re: Multi-channel LED controller for doll house
« Reply #33 on: July 19, 2019, 04:12:58 am »
Why is a 1000uF electrolytic recommended for LED strips:

Short answer = to dampen transient voltage spikes.

Medium answer =
Wires act like inductors, they resist changes in current.

When all the LEDs are on, current is flowing through the wires to the strip and through the strip.

Lets say you are driving the LED strip with 5V at I_load =1A.  You could say the strip is a load of:
R_load = V / I
R_load = 5V / 1A
R_load = 5 ohms

At the instant the LEDs are turned off, R_load increases to about 100 kohm but I_load takes a bit of time to change because of the inductance so:

V_load = I*R
V_load = 1A * 100 kohm
V_load = 100 kV

This is an over simplified example with rough numbers, you probably won't get 100,000 volts across your LED strip but you might get slightly more than the LEDs can handle.

An electrolytic capacitor near the LEDs will give that transient current somewhere to go which will dampen the transient voltage spike when the load changes.

You can also get spikes when connecting / disconnecting wires and when turning LEDs on.  If you study transient voltage spikes, you should learn what is happening and why electrolytics (with higher ESR) are recommended over other capacitors.

It can mostly be summed up by the rules a prof I had stated at least 100 times:
Inductors resist change in current.
Capacitors resist change in voltage.

/////////////////////
// LED strip types

I'm pretty sure all the LED strips I listed are available with addressable LEDs. 
RGBW
White yellow orange
White only
Warm white only

White only and warm white only here:
https://learn.adafruit.com/adafruit-dotstar-leds/dotstar-strips

warm white, cool white, or amber here:
https://www.sparkfun.com/products/13898
(note this one uses the more difficult SK6812)

 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #34 on: July 19, 2019, 11:16:40 am »
Thanks for the detailed explanation! Now I get it.
Looking at another 30led/m strip that has just arrived, I see that it has two elements soldered on the PCB on the 1st and 15th led (where power boost solder points are). Are these capacitors as well?? https://photos.app.goo.gl/LA2coMS1JfbQVBFH9. The strip is sealed, so I can't test it. I thought if they were capacitors soldered between + and -, I'd would be able to measure them through led +/- wires, but my DMM shows nothing.

About the warm light - it's interesting that they have white only pixel strips. I guess you can even mix and match RGB and white ones in the same strip and drive them the way you like! Listening to the lady in the product description video I understand that it's indeed not quite possible to get pure white colors with RGB leds and that's a particular reason they made white only leds.
 

Online Kasper

  • Frequent Contributor
  • **
  • Posts: 742
  • Country: ca
Re: Multi-channel LED controller for doll house
« Reply #35 on: July 19, 2019, 05:54:07 pm »
Those look like 27 ohm resistors. Probably in series with the data lines.

That is often recommended for the older 3 wire strips like this:
https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices

It is discussed more here:
https://electronics.stackexchange.com/questions/177019/why-does-a-resistor-in-my-neopixel-data-line-work-at-all

On stackexchange someone mentions internal esd diodes.  Dave gives a great explaination in this video:
EEVblog #831 - Power A Micro With No Power Pin!

////////////
// my version:
2 reasons:
1 - limit current through LEDs internal ESD diodes if user makes mistake of powering the data / clk line(s) when Vcc is not powered.

Voltage across resistor:
5V - 0.7V ~= 4.3V

Current through resistor and ESD diode:
4.3V / 27 ohms ~= 160mA

2 -
Round off the square data signals aka
Filter higher harmonics of the noise emitted by the data signals.
This is done in consumer electronics to help pass EMC testing.  The resistor in series combined with parasitic capacitors to GND and Vcc in the LED (and elsewhere) create an LPF (low pass filter).

- Edited to change 270 ohm to 27 ohm.
« Last Edit: July 23, 2019, 03:43:33 pm by Kasper »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6260
  • Country: fi
    • My home page and email address
Re: Multi-channel LED controller for doll house
« Reply #36 on: July 19, 2019, 06:33:09 pm »
Just in case you aren't aware, you can get WS2812 (RGB) in circular PCBs with 1 (10mm), 3 (17mm), or 7 (22mm) LEDs per PCB; and SK6812 (RGBW) in round 10mm circular PCBs.  I'd think round PCBs are easier to form into light fixtures than tape is.  They behave just like strips, and you can chain them together (although you'll need to use a different library than for APA102s).
 
The following users thanked this post: haizaar

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #37 on: July 23, 2019, 12:06:34 pm »
Those look like 270 ohm resistors. Probably in series with the data lines.

That is often recommended for the older 3 wire strips like this:
https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices

It is discussed more here:
https://electronics.stackexchange.com/questions/177019/why-does-a-resistor-in-my-neopixel-data-line-work-at-all

On stackexchange someone mentions internal esd diodes.  Dave gives a great explaination in this video:
EEVblog #831 - Power A Micro With No Power Pin!

////////////
// my version:
2 reasons:
1 - limit current through LEDs internal ESD diodes if user makes mistake of powering the data / clk line(s) when Vcc is not powered.

Voltage across resistor:
5V - 0.7V ~= 4.3V

Current through resistor and ESD diode:
4.3V / 270 ohms ~= 16mA

2 -
Round off the square data signals aka
Filter higher harmonics of the noise emitted by the data signals.
This is done in consumer electronics to help pass EMC testing.  The resistor in series combined with parasitic capacitors to GND and Vcc in the LED (and elsewhere) create an LPF (low pass filter).

These are 27 (not 270) ohm resistors indeed in series with data lines. So, they are there protect data lines from accidental high current, right (caused by electromagnetic noise, etc)?

Any idea why they are 27ohm while the stamp says 270ohm? I mean, is it some special marking, marking bug, or a plain forgery?
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Multi-channel LED controller for doll house
« Reply #38 on: July 23, 2019, 12:57:46 pm »
Those look like 270 ohm resistors. Probably in series with the data lines.
These are 27 (not 270) ohm resistors indeed in series with data lines. So, they are there protect data lines from accidental high current, right (caused by electromagnetic noise, etc)?

Any idea why they are 27ohm while the stamp says 270ohm? I mean, is it some special marking, marking bug, or a plain forgery?
Nothing nefarious like that. SMD resistors are marked such that that code is interpreted as 27 * 100 = 27. 270 ohm would be marked as 271 (27 * 101), 2.7K marked as 272, etc.
 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #39 on: July 23, 2019, 01:02:48 pm »
Intriguing  ;D

I guess I'll better instrument those 27 ohm resistor into the short strips I'm making, right?

P.S. Started to fabricate 4-led light "fixtures": https://photos.app.goo.gl/xEbySGH1Q4VeHtP77
The "terminator" board is growing :)
 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #40 on: July 23, 2019, 01:07:53 pm »
Btw, will these do? https://www.jaycar.com.au/27-ohm-0-5-watt-metal-film-resistors-pack-of-8/p/RR0534
0.5w should be plenty right for data wires, right?
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Multi-channel LED controller for doll house
« Reply #41 on: July 23, 2019, 01:19:55 pm »
I didn't bother with the LED stick figure costumes that we built for Halloween and everything worked just fine. It's probably good practice to do so (and if I'd have thought about it, I'd have put them on the PCBs I made, but I didn't...)

1/8 of a watt would be WAY MORE than enough of a power rating on the resistor you're contemplating adding. If you dead short an ideal 5V supply across a 27 ohm resistor, it will draw almost a Watt of power, but these are in series with the data lines and not easily able to short across the power rails.

One other tip I might suggest is to buy an assortment of Dupont connector housings and put all the random loose Dupont connectors into a single plastic housing. You can use a small pick to unlock and remove the existing "1x1" Dupont plastic and insert that wire with the existing crimp into a "1x3" or "1x4" housing which will make the breadboard a little more tidy and less susceptible to plugging wires in incorrectly if something gets jostled.
 
The following users thanked this post: haizaar

Online Kasper

  • Frequent Contributor
  • **
  • Posts: 742
  • Country: ca
Re: Multi-channel LED controller for doll house
« Reply #42 on: July 23, 2019, 03:55:10 pm »
2 reasons:
1 - limit current through LEDs internal ESD diodes if user makes mistake of powering the data / clk line(s) when Vcc is not powered. [...]


2 -
Round off the square data signals aka
Filter higher harmonics of the noise emitted by the data signals. [...]

These are 27 (not 270) ohm resistors indeed in series with data lines. So, they are there protect data lines from accidental high current, right (caused by electromagnetic noise, etc)?

Any idea why they are 27ohm while the stamp says 270ohm? I mean, is it some special marking, marking bug, or a plain forgery?

My mistake, sorry, I have't used readable resistors in a while. 
270: 27 ohms
271: 270 ohms
273: 27,000 ohms

The 2 reasons I gave for series resistors are for separate cases.

1 - over current protection. This only applies when user makes mistake. And doesnt really apply with only 27 ohms. That isnt going to help much. But Daves video about internal ESD diodes is still worth a watch.

2 - Noise reduction for EMC compliance. This is for anytime data is flowing through the strip.  It reduces the chance your LED strips will cause your wifi or any other wireless systems nearby to stop working.

3 - There could be other reasons, some maybe a combination of 1 and 2.
 

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Project update
« Reply #43 on: August 24, 2019, 02:52:44 am »
Hey guys,

Here are some news.

I finished wiring LED strips to USB cables:
https://photos.app.goo.gl/dZjtXW4ToEKpfA5c7
https://photos.app.goo.gl/2kHXXaeAgmgFQT9L6
https://photos.app.goo.gl/VMGrkWdFiDpt55yW8
https://photos.app.goo.gl/YpXCkbzdoggaAhg47
https://photos.app.goo.gl/iT9oEZN6atRxBM4J7

Soldering is quite addictive... May be that's because I do not have a fume extractor and there is something in those fumes :)

I also prepared distribution "boards" for mounting into jiffy box: https://photos.app.goo.gl/eDvtzrg6QCMA2DPY9
Now the bunch of cables is ready: https://photos.app.goo.gl/6F4A6Eq7e1Z88UgXA

Eventually I ended up having 6 strip X 4 LEDs for rooms and another 40 LEDs strip for eaves. 64 LEDs total can consume up to 64*.06A = 3.84A. Hence I decided to power it through two USB warts.
In practice however on full power they only consume 2.78A: https://photos.app.goo.gl/2KmdkYNnaYqivFqk9

I tried removing some channels and the rest of LEDs didn't become any brighter, meaning they consume all they need. The long 40 LED strip (60led/m) is just a tiny bit dimmer though. Probably because they recommend to solder in additional power lines every 50cm and I didn't do that. Also my USB cable that powers it is 3m long and has about 0.3Ohm resistance meaning it will get to 1.1V drop on 2.4A that this strip can consume.

Current-per-wart is split not exactly 50/50 for some reason: 1.26A vs 1.52A (https://photos.app.goo.gl/ebmsT88hvD5tk2sm9  vs  https://photos.app.goo.gl/eANxm6hR9BXx922C6)

I tried both standard 5V 2.1A warts and QC3 warts that should be capable of 5V 3A. However it seems that to get 3A from QC3 wart, you need to negotiate it, because when powered through single QC3 wart, it didn't give more than 2.4A.

I did smoke tests running all lights on max to see if anything gets too hot. All cables remained cool, may be a tiny bit warmer than room temperature (I use 22awg cables in distribution boards).
2.1A warts got quite hot, though they were well within their spec'ed amps - after 30 minutes they got to above 50C. I didn't want to take any chances and switched to QC3 warts that got to 41C and stayed there stable for 2 hours. So I'll use QC3 warts for my final installation.

That's all for now. Too bad there is nothing more to solder :(

IR remotes have arrived and through my phone cam I see they do emit something when I press buttons. Still waiting for IR receivers though. Probably will buy one locally since this is the only part the left and it's blocker.




 
The following users thanked this post: sokoloff

Offline haizaarTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: au
Re: Multi-channel LED controller for doll house
« Reply #44 on: April 13, 2023, 05:28:30 am »
Better later than never - the project was concluded successfully and my daughter was very happy to play with it for several years. Now she grew out of it and I'll be selling the thing and I wanted to share how it all looked like in the end.

Here is the working demo of it all assembled (and here are just the guts of the system: )
And here is the code again: https://github.com/zarmory/doll-house-lights

Thanks again for everyone's help back in the days - I wouldn't have embarked on this amazing adventure without your support and encouragement.
 
The following users thanked this post: Nominal Animal

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Multi-channel LED controller for doll house
« Reply #45 on: April 13, 2023, 03:35:04 pm »
Thanks for the follow-up of how it turned out. That's often the least "fun" part of the project.

Glad your daughter enjoyed it and hope the next family does as well.

I laughed when you talked about her playing with the bare LEDs for a long time on the bench. That tracks with my experience with the kids as well.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf