I've been building a Lego city/street and I want to use an Arduino Uno to automate a few things. I'm building a Lego metro train with a station underneath my city and will automate the starts/stops, lights, and doors for that using some sensors and infrared LEDs (to control the train). I'll create an Android App for higher level control of everything using my phone's Bluetooth and a Bluetooth module connected to the Uno. I have all that working in a 'proof of concept'.
On to the things I'm hoping to get some advice about:
I also want to add and automate lights in the Lego buildings I have. I want this to be controlled by an optic sensor so the lights go on/off when it's dark/light 'outside' I also want to use RGB LEDs so I can control the color for each floor of each building. 32 RGB LEDs should be enough to accomplish what I want to do, but I would like to be able to easily expand to 64, etc, when I add more buildings.
I've read up on controlling many LEDs with an Arduino, but there are several options and I'm not sure which one is best for my application. I do want to be able to control each LED individually (in addition to color, I want to randomize when they turn on when it gets dark for additional realism). I've read about LED controllers, charlieplexing and multiplexing, and I've read several tutorials. I'm kind of lost on what direction would work best for me though...
I'm specifically looking for advice on what hardware to buy. Like I mentioned, I'm looking for a system that I can expand as painless as possible as my city/street grows. In addition, There will be lots of long'ish wires to reach each building, so a solution that has a certain rythm or pattern to it would be great. I've looked at Charliecube tutorials, but wasn't sure if something like that would work well in my case.
I would greatly appreciate any and all advice!!
Thanks,
Paul van der Maas
P.S. I'm a software engineer by day, so I'm not worried about complexity on that side.
@groundFungus That uses a LED strip it seems, which wouldn't work in how I need to place the LEDs. Check out the image at the bottom. It's a picture of my Lego project. Wasn't able to include it in the post...
@Wawa Thanks for the advice. I'll take a look right now. Any specific modules that you are familiar with? Pre-wired LEDs (like in a strip) will not work for me, btw
You can easily cut the strips and place individual LEDs where you want them and then solder wires to provide power and data lines. I think that you would end up using a lot less wire than a muliplexed system.
@Wawa Those look really interesting! Seems like a very simple setup also.
How many of these addressable LEDs could you chain to a single pin? I didn't see any information about that. I guess I could calculate it based on how long each update takes?
Also, would you be able to turn some of the LEDs in a single chain off while keeping others on?
Thanks! Really appreciate the valuable information!
I have not used the 3mm or 5mm versions, but it looks like the wiring is the same as the WS 2812s. There is a 5V pin, ground, data in and data out. So they are wire in a "daisy chain". You can turn any one or any number on, off or control the color. See the FastLED library. 32 or 64 LEDs should pose no problem.
The LEDs are vastly cheaper if you buy them in a strip. Like $10 will only buy a few loose LEDs but it will buy a strip with a hundred of them. Somehow there's a big premium for being able to solder them yourself.
For 'street lighting' you can probably run thousands of these LEDs off one pin. Each LED cleans up the signal for the following ones, so there's no degradation over long runs. With some of the faster Arduino variants such as the Teensy 3.2 you can even do full-motion video on thousands of LEDs.
The real limitation is the Arduino's memory space.
an 8x8 LED matrix has 64 individually addressable LED's. Obviously in the matrix they're in this nice little grid, but I don't see any reason they'd need to stay in that grid (if that makes sense).