Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Simple LED strip Control? #46

Open
GeorgeIoak opened this issue Dec 12, 2018 · 8 comments
Open

Add Simple LED strip Control? #46

GeorgeIoak opened this issue Dec 12, 2018 · 8 comments

Comments

@GeorgeIoak
Copy link

I was wondering if there was an "easy" way to add support for a new type of LEDs. I made a short video of the LED string and it's different lighting effects. I made some notes in the video description of how this strip is working.

It seems relatively easy to make these effects (or others) with code and directly connecting the LED string to an ESP8266 running the ESPixel firmware. I'd like to integrate these into my Xlights show. I just don't know how to take e1.31 and convert that to something that could drive the LEDs. Driving the LEDs is just simple PWM and switching the polarity using an H-Bridge. I know that this strip can't perform most of the effects but it would be nice to just include them with the other lights and have them do something.

@penfold42
Copy link
Owner

What strip ? What video ?

@GeorgeIoak
Copy link
Author

Sorry, I forgot to paste the video link, the description also has a link to the LED strip

LED Fairy Light String

@penfold42
Copy link
Owner

What’s the timing like ?
Have you documented the waveforms ?
Does it need to go negative/reverse polarity?

@GeorgeIoak
Copy link
Author

GeorgeIoak commented Dec 12, 2018

I can measure the timing but it's not too critical. Yes, you reverse the polarity but they probably use a H-Bridge for that. There's a WEMOS Mini Motor Shield which I ordered that should work. Since the TB6612FNG chip on the shield supports 2 motors you can connect 2 strings instead of 2 motors.

The string is wired so that every other LED is connected with reverse polarity. The string colors go:
[Pink]--[Yellow]--[Blue]--[Green]

If you apply power in 1 direction the [Pink] and [Blue] LEDs will turn on, when you reverse the polarity the [Yellow] and [Green] will turn on. That's the same as telling the motor to go forward or going reverse. Speed would be the same PWM signal as controlling the brightness. After that it's just coming up with different patterns.

@GeorgeIoak
Copy link
Author

I took some scope plots of the simple switching between the 2 series (pink/blue and yellow/green). I need to look at the circuit board but I think they're controlling the current by the PWM that's used during the on time for the LEDs,

@GeorgeIoak
Copy link
Author

Can you point me in the right direction to add a new class for these? I'm thinking initially to just be able to accept data from xlights and then rather than trying to decode what to do just hard code in 1 mode for now, like breathing LEDs.

@penfold42
Copy link
Owner

You might not need any code.

This branch can map dmx channels to GPIO pins doing PWM on the brightness based on the dmx value of a channel.

Are there only 2 wires feeding the strip ?

From memory, I force a gpio high if the dmx channel is 65535

@GeorgeIoak
Copy link
Author

Yes, there are only 2 wires on the strip with the LEDs connected directly across the 2 wires. I need to take the board out of the box and take a closer look but I don't think the board has any current limiting so they use PWM extensively to limit the current to the LEDs, or at least that's my guess since I never saw a flat line on the scope.

Directly sending a PWM would light up 2/4 of the LEDs so we need some hook to tell the H-Bridge to switch direction. The Wemos Motor Shield has a STM32 MCU on it which is used I guess to minimize the work load of the ESP. It seems that the connection between the shield and the ESP is done with I2C. Wemos wrote a library so there's very little code to be written to drive a motor or LED in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants