1

This question already has an answer here:

I know there's quite a few threads with similar answers already, but I hope you won't mind me asking anyways. One thread has what looks like a good solution but it's old and thought it may be better to ask fresh.

I have ten 12v rgb strips with 4 wires each, a 12v power supply and 30 mosfets. I want to control them individually with an Uno.

I'd like to make a wave effect where the strips increase and decrease in brightness at separate times. It's fine if they are all the same color during a wave. Then a wave of a different color.

(1) I'm thinking of trying the approach in this thread where AMADANON suggests using 3 pins for the color and then each strip gets its own common pin, 13 pins in my case. If I go this route, will I be able to set a color for all strips and a brightness for individual strips? This would let me make the wave effect I'd like.

(2) Alternately I'm thinking of upgrading to a Mega with 54 pins. I assume I could then control each strip individually using 3x10 = 30 pins?

(3) I've read lots of advice on chips to control the strips, but I'm a newbie and would like to keep it as simple as possible (plus delivery to my country takes 3 weeks or more, and I'd like to get started now)

Thanks for any advice!

EDIT: (I replied to answers in comments, and I now see I should just instead edit this question. Thanks for your patience with a newbie!)

The mosfets are N-Channel MOSFET 60V 30A.

The led strips are rgb non-addressable with 4 wires, wired on both ends so they can be easily daisy-chained. But in my project the strips are snaking around some tracks and connected them in serial poses a problem. I'd prefer to wire each from only one end.

I think I'll try Gerben's and Andrew's advice about a chip and check out PCA9685 chip module as per Andrew's suggestion. Sounds inexpensive!

chrisl's suggestion for using WS2811 chips sounds easy too and maybe less wiring. In the same vein was an idea from this thread from gre_gor:

Setting 10 RGB Strips Independently from Single Arduino

... which talks about chainable STM32 rgb chips, only about 2 bucks on ebay, no mosfets, and pretty efficient.

Thanks for all the advice guys! I'm finishing the box and strips placement now and waiting for my Arduino to arrive which should be any day. This is my first venture into this domain (though I've done plenty of coding and have some experience with electronics).

marked as duplicate by gre_gor, VE7JRO, sempaiscuba, Greenonline, MatsK Oct 7 '18 at 12:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • which LED strips? Many can be daisy chained into longer strips controlled by the same 4 wires. – ratchet freak Oct 4 '18 at 14:01
  • you should get addressable LEDs; not only could you hook them all up with one pin, you don't have to have the whole strip the same color, which makes for MUCH nicer effects, speaking from experience. – dandavis Oct 4 '18 at 16:05
  • Sounds like you need 30 PWM pins. No Arduino has that. So either get one/multiple external chips that do that for you. Or do PWM in software. Or do multiplexing and software PWM, to require fewer pins (13), like you said in option 2. This will reduce the maximum brightness. It's also not the easiest to write. There might be a library for it. – Gerben Oct 4 '18 at 16:13
  • Hi gre_gor -- I'm really interested in your idea with the STM32 rgb drivers. Will these plug into a breadboard for daisychaining, or are there connector plugs in that size, or will I need to fire up a soldering iron? Thank you. – Abacaba Oct 5 '18 at 19:24
  • @Abacaba No you can't put them on the breadboard. You need 4 female dupont wires to daisy chain them. – gre_gor Oct 6 '18 at 5:08
2

I know what you mean - LED strips with all the same colour at the same time. I've used these and I assume you can wire up the MOSFETs ok. If you don't need individually-addressable LEDs they can still produce some effects.

To control 30 PWM lines, at first I thought using the Mega would solve it, but as someone else reminded us, only 15 are full (hardware) PWM and some would have to be software PWM. This may be good enough, I don't know. More expensively, you could use two MEGAs with one acting as a slave to get 30 full PWM pins.

Another idea would be to use a PCA9685 chip module. I got a couple of these on ebay some while ago (dirt cheap, under £2/$2 ) and each board provides 16 PWM outputs, all controlled from I2C input. They aren't hard to use and have library code for Arduino. Two of these and an UNO would do it or one and a MEGA.

  • Thanks! Two megas is definitely a possibility (they're only $11 at kumantech.com) but that PCA9685 module sounds very promising. I'll check that out! – Abacaba Oct 5 '18 at 16:20
1

It sounds to me that you have this kind of tape leds.

If I'm right then your led strip has 4 pins:

1- Blue

2- Green

3- Red

4- GND

With this you can create up to (2^8)(2^8)(2^8) = 16,777,216 colors (using PWM or any other dimming technique with the Arduino), BUT ALWAYS having the same color in all the led strip. So, at least as far as I know, you can not do the effects you want with that strip.

What do you need? You need a "smart" tape, one like this

As you will see in the name says addressable, this means that, for example, you can put the green color on led No1 and the red color on led No2 and so on, and you can move those LEDs making very interesting and cute effects!

Hope you can find this fast explanation helpfull.

  • The OP doesn't want to control the LEDs individually, but only the ten strips he has. The effect would be visible in the difference between the stripes. But yes, if he actually had individually controllable LEDs, this would be way easier, because there would be no need to handle PWM with the Arduino – chrisl Oct 4 '18 at 22:34
  • Sorry about the (perhaps) obvious question: what means "OP"? I see very often when people talk about newbies(?)... And so... yes, it's what you say about the question of the "OP" :D – k.Cyborg Oct 5 '18 at 13:11
  • 1
    OP means Original Poster. In this case I mean the user, that asked the question :D – chrisl Oct 5 '18 at 13:14
  • 1
    Thanks for the answer! Yes, those are the same kind of strips I have (well, mine are shorter and more expensive!) I think you're right that addressable is probably the best route - and now that I'm thinking about it there could be some very cool effects. But I've already bought the strips and am going to try to use these first 'cause another 100 bucks into the project would be getting spendy! – Abacaba Oct 5 '18 at 16:25
1

As stated before by other users, there are multiple ways to go, but you will have to make compromises.

  • When using an Arduino Mega, you will have to bitbang the PWM signal (directly or by using some timer interrupts), because only 15 of it's pins can be used as native PWM pins.
  • In my opinion it would be the cleanest solution, to use a single driver chip for each LED strip. You can use the WS2811 chip, which is used in most LED strips with individually addressable LEDs. It outputs 3 PWM signals (for red, green and blue) and gets controlled by shifting bits through it's input. Also these chips can be daisy-chained; meaning, that only the first is hooked up to the Arduino and all other chips will be chained together (serial output to serial input). In this solution each chip would controll one of the ten LED stripes (note, that you still have to use a capable MOSFET between WS2811 and strip, since the chip cannot provide enough power for a whole strip), and they would be chained together, effectively only using 1 pin on the Arduino. You can then use librarys like the Adafruit_Neopixel to control the strips. Each of your strips then corresponds to 1 LED in the library. You can buy the WS2811 chips at various sources. When googling I found them for 5$ at Adafruit, but you may find them somewhere else for less (This was simply the first shop, where I found them. Didn't searched long). The datasheet (for example here) contains example applications, which show, how the chips have to be connected. For this solution, you would have to replace the depicted LEDs with MOSFETs, that drive the strips PWM lines.
  • Thanks so much! I appreciate the links. It would tricky with my project to chain the strips without drilling holes in my case (which I suppose I could). Is there a way to chain them all from one end with the other ends of strips terminating? I'll look at the examples and see if there's clues there. – Abacaba Oct 5 '18 at 16:18
  • I don't understand, what you mean. The driver chips have to be chained together, not the strips. And you can put the chips, where you need them. Either directly with your Arduino or where the strips are. – chrisl Oct 5 '18 at 17:30
0

I have ten 12v rgb strips with 4 wires each, a 12v power supply and 30 mosfets. I want to control them individually with an Uno.

These sound like non-smart LED strips, where you supply 12V on one pin and then there is a control line for each color. Three resistors for each 3 LEDs, with the groups of 3 wired in parallel on the strip. In which case, 3 MOSFETs per strip to sink current to Gnd sounds good, and you can likely one MOSFET control the same color on multiple strips. Thus you can use the 18 IO of an UNO, leaving D0/D1 free for serial comms with your PC.

Uno has 6 hardware PWM pins for 256 levels of brightness via analogWrite(), and you can create software PWM for the other pins as well.

Which MOSFET do you have?

Not the answer you're looking for? Browse other questions tagged or ask your own question.