I am looking for a way to control LED strips by USB or ethernet or serial port. I know I could use an Arduino or similar but is there a way to do so using a mini-Maestro or similar. I am writing custom software that controls most of everything in my model-train room so I want to be able to add the controls right into my existing software.
Our LED strips use a non-standard protocol, and a bit-banging approach is usually needed to control it from a microcontroller. Since it requires sub-microsecond timing, the code generally needs to be written in assembly or very carefully optimized C. Unfortunately, because of these strict timing requirements, it would be very unlikely to get our LED strips working with a Maestro servo controller.
Why do you prefer the Mini Maestro (or similar) to an Arduino (or similar)? Is there some specific functionality you are looking for? Our A-Star programmable controllers might be a solution for you to consider.
I’ll be using both non-addressable and addressable strips and I would like my software to have near real-time control. Until earlier today I was thinking an Arduino couldn’t do that but after further research it seems it can. Timing on this is probably not crucial I will be dimming the LEDS to simulate different times of day as well as lightning (hopefully). So if an Arduino or other controller can be programmed via USB or serial port to send signals in real-time I’m fine with that. I would like to keep cost down and I will be using 2- 5meter 300 LED non-addressable strips and 1- 1 meter 60 LED addressable strips to start.
To further complicate matters they run off 12V and 5V respectively.
With proper circuitry can two Arduino’s handle that or could one even control all three?
I would expect a single Arduino to be able to control all three of them. However, you will probably have to power them separately since that many LEDs are probably going to draw a lot of power. As noted on our LED strip product pages, when chaining our LED strips together, we recommend chains of LEDs powered from a single supply not exceed 180 total RGB LEDs. You can make longer chains with the data line, but you should power each 180-LED section separately. If you choose to do this, keep in mind that you will need to connect your grounds of each section together, and you will need to cut the power wires between the sections so you do not short the output of two different power supplies together.
Just an update on this.
Using both an Arduino Uno and Arduino Mega I was able to control both addressable and non-addressable led strips using Vb.Net.
It turned out to be insanely simple and if I had really thought about it I would have seen it.
But for anyone else that needs this info:
Use the Serial Port component and set the options on the component to
PortName = enter the name that matches your Arduino port
BaudRate = 9600
DataBits = 8
StopBits = One
Handshake = None
Encoding = System.Text.Encoding.Default
Then to send data to the Arduino you use:
SerialPort1.WriteLine("0,255,0") 'set RGB to 0,255,0,
This is if you are using the Pololu Test LED sketch called: LedStripColorTester
If you are sending multiple commands then do not close the serial port until you finish open it once and close it once but be sure to close it before you exit the software.
Thanks for pointing me in right direction. Sometimes there is so much info available it’s easy to miss the simple stuff
I am glad you found a solution that worked well with your system; thanks for letting us know and sharing your procedure.
These LED strips are a great way to express your inner nerd. I know this is an old thread, but I wanted to suggest an alternative method to bit banging the protocol. I’ve never used an Arduino, so I’m not sure about their capabilities. Instead, I’m using a STM32F4 based Nucleo board. I expect that this method would work with other microcontrollers depending on their capabilities.
I use an SPI MOSI pin to format the signal. For every bit transmitted, I use 4 SPI bits of data. To transmit a 0, I send binary 1000 (0x8 msb first). To transmit a 1, I send binary 1110 (0xe). The spi bit rate needs to be approximately: 4 bits/1.25us = 3.2Mbits/sec. If this bitrate is achieved, the pulse high time to transmit a 0 is 1.25us25% = 312.5ns. The pulse high time to transmit a 1 is 1.25us75% = 937.5ns. These times are well within the spec of 350ns+/-150ns and 900ns+/-150ns.
To achieve this frequency on the STM32F4, I set the PLL to generate a sysclock of 51.25MHz with an SPI divider of 16. This achieves an SPI bitrate of 51.25M/16 = 3.203Mbit/sec. Since the chip I’m using has tons of available SRAM, I use 2 buffers big enough to store all of the SPI data. I let the DMA engine stream out one buffer while the CPU is populating the next. This method requires no assembly code or disabling of interrupts.
It’s also possible to use a lookup table to turn each byte’s color data into the 32bit SPI stream data. The lookup table must be 256*32bits = 1024bytes in size. The values in the lookup table look like:
Thank you for sharing your method for controlling the LED strips. We are glad you like them; it is great to see other approaches to using those LED strips!