Pages: [1]   Go Down
Author Topic: New Here - Looking for project help  (Read 1392 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to create something that is kinda simple in concept, but I am getting lost in determining how to do this with the fewest components and the best way...

Concept:  I am going to trigger, with a digital input (or possibly analog input) from a sensor a bunch of RGB LEDs (maybe 10-20 of them).  I really would like to have some cool effects with the lights that I could trigger, which means individually controlling the lights.  I will have several light patterns, both triggered by sensor, but 1 coming up randomly (software controlled).

I was looking at the Arduino controller (Nano V3).  But how to control the lights the best?  And is this the best controller for it?  If I use the PWM outputs, I think I can only control 2 of the LEDs.

Should I re-think?  What is your advice?

Thank you!
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure, fairly standard.
You need to multiplex the LEDs.
Say you can common cathode parts.
You drive the Anodes from a PWM pin each.
The cathodes are all pulled low using shift registers like TPIC6D595 (or 6B595 or 6C595, check avnet.com for availability).
You will analogWrite the PWM value LED1, and takes its cathode low for small time, then back high.
Repeat for as many RGB LEDs as you have.
The longer you have each on, the brighter the overall display will appear.
If each is on for 1/40 of a second, they will all appear to be on without flickering.

So, 3 outputs, 3 more to control the string of shift registers, and whatever buttons or analog inputs you want to control program flow on the remaining pins.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, mostly makes sense.

What confuses me is the PWM outputs.  There are 6 on the board I am using which would power 2 RGB LEDs (Typically).  However, the configuration you mention would allow me to power 6 from the Audrino board I was going to purchase.  Does that sound correct?

How can I, then, individually control all the LEDs I had mentioned (10-20)?  Would I need additional PWM outputs, I assume?

And, lastly, how do I modulate the color in this scenario?

Sorry if the questions are dumb, I am just starting and this will be my first project smiley  I know electronics from my EE days, but it's been awhile since I have breadboarded anything.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Picture is worth a thousand words, as the saying goes...


* PWM_RGB_LEDs.jpg (62.74 KB, 960x720 - viewed 23 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24364
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Picture is worth a thousand words, as the saying goes...
But 1000 words is just less than 2kB, but your picture is over 60kB   smiley-yell
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I guess more cropping next time then!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking forward to giving this a try when all my parts come in smiley-wink

Thanks!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe I'm just not getting it smiley-sad  I do have it setup as you suggested, but seem to always be getting the same colors across the 4 RGB LED's.  Can you show me a bit of example code where I can differentiate each RGB?  I'll keep trying here as i have the circuit setup like you suggest (except with a 74HC595)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

With a 74HC595 you need different data, walking a 0 across the outputs for the different rows.

B01111111
B10111111
B11011111
B11101111
B11110111
B11111011
B11111101
B11111110

with the TPIC6B595, the output goes low when the input is high.
with the 74HC595, 1 in = 1 out.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did get that working, thank you very much for the help and direction! smiley

Curious now... I have 20 RGB LED's that will be mounted around a circle opening (in wood) with LENS Caps to protect them.  Now I am wondering, how best to wire them?  Is there any good way to have a wiring harness that would go from each LED back to a central board?  I guess I'm thinking more like a PC board where all the wires are removable.  I've been looking around and I'm sure I could make something myself, but just curious if there is a 'typical' way to do this.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure, wire all the Rs together, all the Gs together, all the Bs together, bring back to 3 PWM pins. Wire the Anodes, or Cathodes, to separate drivers, and create a multiplexing loop in software.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've already done all that smiley  And the programming is completed, even.

I'm more wondering about circuit board design.  Since the LEDs will be remote from the board, I was curious if there are pre-made wiring harnesses to go from 'pins' on a circuit board to RGB LEDs?  Something that will make it easy to wire up (not hard-wired).
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can make up a wiring harness really easily.
http://www.pololu.com/catalog/product/1905
http://www.pololu.com/catalog/category/50
http://www.pololu.com/catalog/category/71

These housings & terminated wires work great.
Buy a bag of housings and wires, make up what you need.
Male terminated wires in a housing will plug right into female headers.
Solder LED to resistor to the other end of the wire.

Here's an example - wires in headers connecting a pro-mini to a custom board, with some loose ends ready to be attached to a DB9 connector.
The headers come in all sizes, pick some adjacent pins to plug into, or use 1x1 if you're spreading the pins used around a lot more.


* lights_assembly_smaller.jpg (138.78 KB, 912x498 - viewed 10 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice, thank you!

And, as always... I have a next question smiley  I was, initially, looking at ExpressPCB to create the circuit board.  Since it is basically like the ShiftOut example on this site, there isn't much to it.  Do you create your own boards?  I don't mind learning - haven't done it before, but have soldered plenty when I was in engineering school and in my first job (oh, so long ago).  But - if I can get the boards made professionally and relatively cheaply - I would rather that be done.
Logged

Pages: [1]   Go Up
Jump to: