Go Down

Topic: I need to have full control from PC of 24 RGB LED's (Read 583 times) previous topic - next topic

INTP


septillion

Mm, don't know if I would use RS232 to overcome length nowadays... RS485 is way more robust. But anyway, just add a RS232 (or RS485) driver on both side and be done with it. Although I don't get why you would put a controller for a piece of software more then 5m away from the PC....

But question, how are the buttons connected now? Seems a bit weird to use a different interface and controller for the buttons and the leds...

Next step, get the protocol that the "software written by us" is sending out :)

And as for the leds, just pick one of the drivers out there. WS2812B is nice but if the leds are already in teh buttons that's a problem. Which driver to pick is on you. If each led is just a regular led there is no limit because of current. Never worked with the PCA9635 so don't know about the library support for that. The TLC5940 is a bit weird to control (because you have to send the PWM clock as well) but works just fine with a library. That's all I can say about it.

And ow, 24 RGB leds, that's a bit different. That makes for 72(!!!!) leds. That is A LOT of wiring...

PS USB does 5m ;)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

CrossRoads

How about these?
https://www.sparkfun.com/products/12986
They look & mount like regular 5mm LEDs, but you can wire them up in a string, +5/Gnd in parallel to all and then just data out to data in on the next LED.
Have a promini with RS232 adapter (male or female connector needed?) receiving a burst of 72 bytes to pass to the LEDs using the Adafruit neopixel library for WS2812s.
http://www.nkcelectronics.com/RS232-to-TTL-converter-board-DTE-with-Male-DB9-33V-to-5V_p_369.html
http://www.nkcelectronics.com/rs232-to-ttl-converter-board-33v232335.html
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Do you need the full range of colors that PWM supplies?
Or just the 8 basic colors that having the 3 LEDs full on or full off can provide?
3 full on = white
red
green
blue
red+green
red+blue
green+blue
all off
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Runkos

Sorry for not answering for a long time.
I got more information now.

There is my software, if I click the button  1 on my box it sends a code like 1001 and it shows me on the software which button is clicked by getting red, same thing the other way around.

There is also a remote protocol.

Well that's how it works without the arduino, and to do it with the arduino to control the 24 LED's I have SN3218 two times here.

septillion

sends a code like 1001
That's a pretty pore description but I assume, looking at the picture, you mean it's sending carriage return terminated ASCII string?

But in a quick look I see limited colors.. Red, Green and "all" (whatever that may be...)? So why do you need all the PWM for? Without PWM it gets simpler :) Shift register and a simple driver and call it done. Few lines of code (not even that much because it's just 72 times the same shit :p

And I lost if you already told me, what are the specs of the leds? They are in buttons so I assume a single normal led? But do they have a build in resistor? For what voltage? And what doe you have available in the box anyway?

And about current, worst case 72 times 20mA = 1,5A which is not nothing... Might be less because 20mA through each led is A LOT but what current per led do yo need?

And have you thought about the internal wiring? 24 RGB leds makes 72 leds to control and 96!!!! wires to connect...

And about the connection, does the Arduino needs to do the button part as well? Or will you split the Rx and Tx completely? Aka, the Arduino only listening on the Rx and the other hardware only using the Tx to push the buttons out to the PC? Or do you need some sort of link in the box?
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Runkos

I just wrote here for 30 min and it failed to post  so I have to start again :/
I know I am not good at explaining but ask me anything and I will try to answer, I'm not very smart yet with arduino but I'm willing to learn it. I think it is ASCII but where can I see it to be sure? Why does it matter ?
The small buttons go green and red and with ''ALL'' they go orange, the big buttons have 2 green leds and one red in the middle.
what is so bad with PWM ? I see many people using different methods
Yes I wanted shift register but they bought something else (the sn3218) but I think they bought something else too that has not arrived yet.
 It's easier to show you the datasheet of the LED's.
Is there an example for the code?
I have a Power supply with 3-12V and 1A.
I just have to wire one so I can show them how it works and the rest isn't my business
Yes the button part too, what do you mean by splitting RX from TX what do you think is easier?

Thanks for taking your time :)

septillion

I think it is ASCII but where can I see it to be sure?
The proper way: check the specs / documentation of the program. If it has non, curse the writer of that software (tip, don't do it near him) and ask the programmer to give you a proper protocol specification. If that's also not an option, connect that computer to another computer (or use one of those serial port loop programs to fake that) and open the serial in one of those terminal program (CoolTerm, Realterm, Putty or wahtever) and check it. If it gives you readable text in ASCII mode, its ASCII (duuuhhhhh).

Why does it matter ?
Would you listen if i would cal you bfgkduf^*&gvnb$^$^%%*& instead of Runkos? ;) For two thinks to communicate they need the same protocol.

The small buttons go green and red and with ''ALL'' they go orange,
Owwwwwwwwww, that's no RGB. 1 less per button to be concerned about! But uhm, why didn't they just call that orange then... ::)

the big buttons have 2 green leds and one red in the middle.
But the greens are linked aka should light up together? Then just place them in parallel. Even less outputs to drive this way :)

what is so bad with PWM ? I see many people using different methods
I don't say it's hard, it's just harder. And more expensive. Just on and off just makes it a piece of cake (instead of baking a fancy pie).

Yes I wanted shift register but they bought something else (the sn3218) but I think they bought something else too that has not arrived yet.
Okay, looks alright. Constant current, so 1 chip for 18 leds, no resistors. Probably not cheap but okay, if you have it. If the program doesn't give you a brightness the PWM part is a bit useless though. (But as a gimmic you could do light green instead of off or something or a dimmer function.)

Only one big fat annoying problem with that chip, it only has a single and fixed I2C address. So without extra parts you can only connect one to an Arduino... There are ways around it but yeahhh, grrrrrr. Takes it quite a bit more complex then a simple shift register :p

It's easier to show you the datasheet of the LED's.
Okay, normal leds without resistors. Then it's up to you to determine the current you want for the brightness you want. And to check if that's the same current for red and green.

Is there an example for the code?
You have to write the code yourself but to give you an idea about the serial part, have a look at:
https://forum.arduino.cc/index.php?topic=396450.0

I have a Power supply with 3-12V and 1A.
1A @ 5V might be a bit tight. But 1A @ 12V with a buck converter should give you enough power.

I just have to wire one so I can show them how it works and the rest isn't my business
One led or one unit? But okay, the number of leds dropped quite a bit today. We now have 36 leds which can have a common line to all.

Yes the button part too, what do you mean by splitting RX from TX what do you think is easier?
I thought the button sending part was already build and you only had to do the led part. But that would make it easier as in, one device (one Arduino) does the whole connection.

Reading the buttons and sending the commands is pretty easy and can be done in like 20 lines of code with a library like Bounce2.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Go Up