Author Topic: How would you make RGB leds fade into each color?  (Read 1214 times)

0 Members and 1 Guest are viewing this topic.

Offline Beamin

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: us
  • Beamin=She not He
How would you make RGB leds fade into each color?
« on: March 02, 2018, 07:44:31 am »
Without using an Arduino. That's not electronics that's cheating. I was thinking you could tie together 555's but that's not going to help because the blinking needs to constantly change speeds. I saw a bigclive video with LED pearls that do this and was thinking how many transistors have they crammed into the LED package as the outside doesn't have many discrete parts. There must be a simpler way where you change the speed by bleeding down a capacitor: as the voltage lowers the pulse gets shorter. It would be three circuits that are tied together? It crazy that can fit an entire chip into the plastic that surrounds the LED would be cool to see how they make them or how fast they crank them out as it's probably all one part with two leads and plastic package.
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1411
Re: How would you make RGB leds fade into each color?
« Reply #1 on: March 02, 2018, 08:53:51 am »
There are no extra transistors in a RGB LED, each RGB LED has its on connection to a driver source. By varying the duty cycle(timeon versus timeoff at a steady frequency), the apparent color and brightness can be seen changed as the duty cycle driving each R G B LED is changed. This can be done with at least three 555 timers with a pot adjusting duty cycle of each color, but it is much more easier and and practical to use a MCU and some simple coding to do this.
« Last Edit: March 02, 2018, 09:11:34 am by Paul Price »
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 6979
  • Country: au
Re: How would you make RGB leds fade into each color?
« Reply #2 on: March 02, 2018, 10:04:23 am »
That's not what Beamin is talking about.

THIS is:


This is a self-contained, finished product.  The ones indicated are on ... and they change colour.
« Last Edit: March 02, 2018, 10:06:21 am by Brumby »
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 6979
  • Country: au
Re: How would you make RGB leds fade into each color?
« Reply #3 on: March 02, 2018, 10:10:41 am »
And to answer the question...

My expectation is that there will be a dedicated chip designed to do just this - and it will have hundreds of transistors, all in one small package.

I have little doubt that the mechanism of colour change is a varying PWM signal on each of the R, G & B LEDs inside the package.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1197
  • Country: ca
Re: How would you make RGB leds fade into each color?
« Reply #4 on: March 02, 2018, 10:55:21 am »
I have little doubt that the mechanism of colour change is a varying PWM signal on each of the R, G & B LEDs inside the package.
Many of my cheap Chinese solar garden lights have RGB LEDs with the colors changing IC inside. They have only two wires for current-limited power.
Some of them fade in brightness between the colors and others slowly add colors making many colors but without fading in brightness. Some of them blink different colors in a pattern that repeats over and over. Yes, the fading uses PWM, because I see the trail of dots when I move my eyes.
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #5 on: March 02, 2018, 11:04:47 am »
And to answer the question...

My expectation is that there will be a dedicated chip designed to do just this - and it will have hundreds of transistors, all in one small package.

I have little doubt that the mechanism of colour change is a varying PWM signal on each of the R, G & B LEDs inside the package.

Indeed, it's probably just a mask programmed microcontroller.

A home-brew, and to my mind more satisfying, implementation could be made with three ramp or sawtooth generators.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 6979
  • Country: au
Re: How would you make RGB leds fade into each color?
« Reply #6 on: March 02, 2018, 02:32:52 pm »
Indeed, it's probably just a mask programmed microcontroller.

(Yeah ... but I didn't want to use the "m" word.   ;) )
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1869
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: How would you make RGB leds fade into each color?
« Reply #7 on: March 03, 2018, 12:33:41 am »
Look at this thread. Use PSOC state machine capability, write no code, and get a
working solution pretty quickly.


http://www.eevblog.com/forum/projects/momentary-push-button-to-toggle-switch-ic/


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Beamin

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: us
  • Beamin=She not He
Re: How would you make RGB leds fade into each color?
« Reply #8 on: March 04, 2018, 10:22:18 am »
There are no extra transistors in a RGB LED, each RGB LED has its on connection to a driver source. By varying the duty cycle(timeon versus timeoff at a steady frequency), the apparent color and brightness can be seen changed as the duty cycle driving each R G B LED is changed. This can be done with at least three 555 timers with a pot adjusting duty cycle of each color, but it is much more easier and and practical to use a MCU and some simple coding to do this.

If you have to turn a pot then its not fading. Simpler would be use two transistor circuit then 1 555 chip per color.

So a self adjusting saw tooth? If you were to discrete transistors or even 555 chips would you be talking dozens of transistors? I always try to figure out how to build things without having to write code. Writing code is both boring and feels like cheating. When I was a young lass were didn't have arduinos we did things the old fashioned way.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1197
  • Country: ca
Re: How would you make RGB leds fade into each color?
« Reply #9 on: March 04, 2018, 12:23:01 pm »
Many years ago I designed and built a colors changing trio of LEDs circuit. A Schmitt-trigger opamp and an integrating opamp made a ramping voltage for each color and the frequencies were a little different for each color.
 

Offline Jwillis

  • Regular Contributor
  • *
  • Posts: 207
  • Country: ca
Re: How would you make RGB leds fade into each color?
« Reply #10 on: March 05, 2018, 02:53:32 am »
I'm a noob but I was going to give this a try.Of course its all thru hole but I imagine that most of the components could be cross referenced to SMD. SMD is to small for my eyes so I try not to use them if I can help it.
 

Offline Beamin

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: us
  • Beamin=She not He
Re: How would you make RGB leds fade into each color?
« Reply #11 on: March 05, 2018, 04:48:11 am »
Many years ago I designed and built a colors changing trio of LEDs circuit. A Schmitt-trigger opamp and an integrating opamp made a ramping voltage for each color and the frequencies were a little different for each color.
Would this be an example of a analog circuit? This I'm guessing it would not be a beginner project?

So how did they do this before we had cheap micros and chip in LEDs? Or did they not do it? Notice on star trek that inside Data's head there were no blue LED in the 24t century? The warp drive is blue but not LEDs. It's funny to see how then envisioned their eBooks and how thick they were.

Say you do use an eight pin PIC like in the other thread do you have to program each one with assembly code?
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 10265
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #12 on: March 05, 2018, 05:05:49 am »
Here's one of the simplest circuits I know of. The Schmitt trigger can be the 74HC14 or CD40106 and the comparator the LM339.
 

Offline Beamin

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: us
  • Beamin=She not He
Re: How would you make RGB leds fade into each color?
« Reply #13 on: March 05, 2018, 05:36:07 am »
That would fit in two eight pin dips? That's an analog circuit right?
 

Offline Nusa

  • Frequent Contributor
  • **
  • Posts: 859
  • Country: us
Re: How would you make RGB leds fade into each color?
« Reply #14 on: March 05, 2018, 06:24:30 am »
That would fit in two eight pin dips? That's an analog circuit right?

No. Google his part numbers to find the number of pins on the packages.

Tell us what you think the difference between an analog and a digital circuit is. Then perhaps we can answer your question.
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 10265
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #15 on: March 05, 2018, 07:01:57 am »
That would fit in two eight pin dips? That's an analog circuit right?
1) You didn't state that was a requirement. It's not possible to do it with two 8-pin, non-programmable, generic ICs. It's possible to modify my circuit to use an 8-pin and a 14-pin IC. Use an 8-pin, triple Schmitt trigger IC, such as the 74HC3G14 and the spare comparator on the LM339, as the high frequency Schmitt trigger oscillator. The downside is, it would require more resistors and the 8-pin part would be SMT, as it's not available in a through hole package.
https://assets.nexperia.com/documents/data-sheet/74HC_HCT3G14.pdf

2) What do you think?
 

Offline not1xor1

  • Regular Contributor
  • *
  • Posts: 163
  • Country: it
Re: How would you make RGB leds fade into each color?
« Reply #16 on: March 06, 2018, 04:25:25 pm »
Here's one of the simplest circuits I know of. The Schmitt trigger can be the 74HC14 or CD40106 and the comparator the LM339.


if it were not for the tolerance of the components that circuit would produce just a fading white light
by changing the value of the resistors (e.g. 68k, 100k, 150k) the light color would change more frequently
 

Offline jh15

  • Frequent Contributor
  • **
  • Posts: 402
  • Country: us
Re: How would you make RGB leds fade into each color?
« Reply #17 on: March 06, 2018, 06:44:12 pm »
I thought this was how to blend them optically. Had a science museum exhibit where kids could shadow their hands and mix 3 colored floodlights, or a diffused setup. The original star trek liked the diffused lights a lot:)
tek 575 curve tracer top shape, 535 top shape, 465. 545 hickok clone, Telsa Model S,  Ohio Scientific c24P single board computer, many c-64 from my club days, Giant electric bicycle, Rigol stuff, Heathkit AR-15 receivers 2, Heathkit et 3400a trainer and interface,
 

Offline Beamin

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: us
  • Beamin=She not He
Re: How would you make RGB leds fade into each color?
« Reply #18 on: March 07, 2018, 12:01:07 am »
That would fit in two eight pin dips? That's an analog circuit right?
1) You didn't state that was a requirement. It's not possible to do it with two 8-pin, non-programmable, generic ICs. It's possible to modify my circuit to use an 8-pin and a 14-pin IC. Use an 8-pin, triple Schmitt trigger IC, such as the 74HC3G14 and the spare comparator on the LM339, as the high frequency Schmitt trigger oscillator. The downside is, it would require more resistors and the 8-pin part would be SMT, as it's not available in a through hole package.
https://assets.nexperia.com/documents/data-sheet/74HC_HCT3G14.pdf

2) What do you think?
Not really an requirements just a circuit I was considering building and I try to stay away from surface mount since I don't make PCB's. I have the boards and HCL H2O2 but not a inexspensive way to etch them. No free spending money at the moment and I don't have room for a laser printer although I do have an inkjet. Thats why I like through hole things.

So how does that circuit work? How does it vary the legth of the pulses or saw tooth waves? The part I can't figure out is not how to make a pwm signal but how you can vary the duty cycle automatically while each partof te circuits waits its turn while te other colors are lit.. '

 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 10265
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #19 on: March 07, 2018, 01:07:11 am »
if it were not for the tolerance of the components that circuit would produce just a fading white light
by changing the value of the resistors (e.g. 68k, 100k, 150k) the light color would change more frequently
You are right. It depends on the component tolerances to change colour. Standard 10% capacitors will result in a fairly long colour change cycle. There will also be an element of randomness, due to the components' values drifting. Different values could be used for each circuit, to speed up the colour changing. It depends on the desired effect.

That would fit in two eight pin dips? That's an analog circuit right?
1) You didn't state that was a requirement. It's not possible to do it with two 8-pin, non-programmable, generic ICs. It's possible to modify my circuit to use an 8-pin and a 14-pin IC. Use an 8-pin, triple Schmitt trigger IC, such as the 74HC3G14 and the spare comparator on the LM339, as the high frequency Schmitt trigger oscillator. The downside is, it would require more resistors and the 8-pin part would be SMT, as it's not available in a through hole package.
https://assets.nexperia.com/documents/data-sheet/74HC_HCT3G14.pdf

2) What do you think?
Not really an requirements just a circuit I was considering building and I try to stay away from surface mount since I don't make PCB's. I have the boards and HCL H2O2 but not a inexspensive way to etch them. No free spending money at the moment and I don't have room for a laser printer although I do have an inkjet. Thats why I like through hole things.

So how does that circuit work? How does it vary the legth of the pulses or saw tooth waves? The part I can't figure out is not how to make a pwm signal but how you can vary the duty cycle automatically while each partof te circuits waits its turn while te other colors are lit.. '
One part of the circuit doesn't wait for the other. It's three separate low frequency saw tooth generators, controlling three PWM circuits. Due to component tolerances, the saw tooth generators will drift out of phase, causing a LED to light a variety of different colours.
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #20 on: March 07, 2018, 02:37:35 am »
Just thinking about this and it occurred to me that if one can come up with a mathematically chaotic function that can be expressed within the limitations of finite voltage rails and the operations easily obtainable with analogue electronics (+, -, fixed multiplication and division, derivatives, integrals, logs and anti-logs) then one could create a pretty convincing 'random' display. I'll leave it to someone who's looked at chaos theory more recently than me to come up with a suggestion.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #21 on: March 07, 2018, 05:15:19 am »
Look at this thread. Use PSOC state machine capability, write no code, and get a
working solution pretty quickly.
...

I hate to ask this, Dana, but do you work for Cypress? A good 80% of your posts are just telling people to use PSoC.

I think he's just got a big man-crush on them.  :)

To be fair, most of Danadak's posts are quick pointers to relevant web pages, datasheets and the like, and as such are usually probably quite helpful to the questions being asked.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 10265
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #22 on: March 07, 2018, 05:51:01 am »
http://www.eevblog.com/forum/beginners/detecting-a-closed-circuit-with-a-few-complications/msg1441114/#msg1441114

I guess he's learned nothing
That's not fair. Look at the timings of the posts!

Hopefully from now on, he'll only suggest it, when relevant, which clearly wasn't the case here, as the orginal poster mentioned not using a programmable device, such as the Arduino in the first post.

Personally speaking, I've never used a PSoC before. They do look good, but I doubt they're a magic pill which can solve all problems.
 

Offline not1xor1

  • Regular Contributor
  • *
  • Posts: 163
  • Country: it
Re: How would you make RGB leds fade into each color?
« Reply #23 on: March 07, 2018, 06:54:17 pm »
Just thinking about this and it occurred to me that if one can come up with a mathematically chaotic function that can be expressed within the limitations of finite voltage rails and the operations easily obtainable with analogue electronics (+, -, fixed multiplication and division, derivatives, integrals, logs and anti-logs) then one could create a pretty convincing 'random' display. I'll leave it to someone who's looked at chaos theory more recently than me to come up with a suggestion.

but the subject does not require a mere randomness, but a slow fade effect

the original circuit might perhaps be improved by summing the output of multiple oscillators, for instance 2 different low frequency oscillators per colour to fully exploit all the available inverters while using the fourth comparator for the high frequency oscillator
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #24 on: March 08, 2018, 03:25:36 am »
but the subject does not require a mere randomness, but a slow fade effect

So? Many chaotic functions are continuous and it's easy enough to pick time constants that are 'slow' in terms of human perception.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf