RGB Light Control from 3-Wire Port

I’m trying to control the color of an RGB light strip from a single (or two) 3-Wire port on the V5 brain. I’ve been able to do this with 3 ports and 3 motor controllers (https://www.youtube.com/watch?v=iXHzCdNFipw), but I’ve been unable to do this without the mc29’s or less than 3 ports. Does anyone know how I could do this?

The lights have a Red, Green, Blue, and Ground channel. This is 4 wires in total on the lights.

Can anyone help me. Thanks in advance.

The MC29s give you control of the voltage. Without, you just have a permanent 5V and a PWM signal that you can’t do anything with.
Now if you were rocking a Cortex, you could probably use addressable LEDs and I2C.

3 Likes

So I pretty much have to use 3x MC29 and waste 3 ports for this? rip.

If you want 3 channels for R, G and B, yeah. 3-wire expanders all the way.

That’s why I sneaked one into our parts order, lol.

Taran, you can always expand your learning horizon by getting a small Arduino (or similar MCU) that will receive control value from a single 3-wire port and then use its built-in PWM output lines to drive MC29s or some other way to controlling R, G, B channels.

1 Like

I could, but like wouldn’t that take up even more space than 3 mc29’s? That’s what I was wondering about.

You will need something like MC29 or an additional transistor to drive RGB strip from a low power I/O pins anyways.

Official V5 3-wire expander weighs in at around 27 grams and will set you you back $40 (ouch).

Arduino Pro Mini weights around 2 grams and you can get it tomorrow for $10 or, if you are willing to wait a few weeks for delivery, you can find a deal as little as $3 on eBay.

This will give you 6 PWM output lines to drive two independent RGB strips and a great opportunity to learn how to bit-bang a custom communication protocol from V5 to control Arduino.

On the other hand, if you invest into 3-wire expander you will have a legal way to connect more than 8 legacy 3-wire sensor lines to your robot.

I would suggest you to do both methods and then come back with a video tutorial comparing and contrasting them. :slight_smile:

8 Likes

Another option would be using a 12v individually addressable LED strip like this connected to a single smart port. That way you can easily communicate over serial to the strip. The added bonus is each LED can be a different color and brightness and you can do cool patterns. Controlling them isn’t super straightforward but is definitely possible. It may or may not work to do the same thing with a 3-wire but it would most certainly be more of a pain.

Also remember that you could have a separate battery to power the lights and just use the smart port for data.

3 Likes

I got it working with 3x MC29’s. I’ll see about ordering arduino when I finish the actual robot part of the robot.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.