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

0 Members and 1 Guest are viewing this topic.

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
How would you make RGB leds fade into each color?
« on: March 01, 2018, 08:44:31 pm »
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.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: How would you make RGB leds fade into each color?
« Reply #1 on: March 01, 2018, 09:53:51 pm »
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 01, 2018, 10:11:34 pm by Paul Price »
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: How would you make RGB leds fade into each color?
« Reply #2 on: March 01, 2018, 11:04:23 pm »
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 01, 2018, 11:06:21 pm by Brumby »
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: How would you make RGB leds fade into each color?
« Reply #3 on: March 01, 2018, 11:10:41 pm »
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: 1507
  • Country: ca
Re: How would you make RGB leds fade into each color?
« Reply #4 on: March 01, 2018, 11:55:21 pm »
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: 10576
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #5 on: March 02, 2018, 12: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: 12288
  • Country: au
Re: How would you make RGB leds fade into each color?
« Reply #6 on: March 02, 2018, 03:32:52 am »
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: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: How would you make RGB leds fade into each color?
« Reply #7 on: March 02, 2018, 01:33:41 pm »
Look at this thread. Use PSOC state machine capability, write no code, and get a
working solution pretty quickly.


https://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 BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Re: How would you make RGB leds fade into each color?
« Reply #8 on: March 03, 2018, 11:22:18 pm »
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.
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: How would you make RGB leds fade into each color?
« Reply #9 on: March 04, 2018, 01:23:01 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.
 

Offline Jwillis

  • Super Contributor
  • ***
  • Posts: 1689
  • Country: ca
Re: How would you make RGB leds fade into each color?
« Reply #10 on: March 04, 2018, 03:53:32 pm »
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 BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Re: How would you make RGB leds fade into each color?
« Reply #11 on: March 04, 2018, 05:48:11 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.
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?
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: How would you make RGB leds fade into each color?
« Reply #12 on: March 04, 2018, 06:05:49 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.
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Re: How would you make RGB leds fade into each color?
« Reply #13 on: March 04, 2018, 06:36:07 pm »
That would fit in two eight pin dips? That's an analog circuit right?
Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: How would you make RGB leds fade into each color?
« Reply #14 on: March 04, 2018, 07:24:30 pm »
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 Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: How would you make RGB leds fade into each color?
« Reply #15 on: March 04, 2018, 08:01:57 pm »
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

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: How would you make RGB leds fade into each color?
« Reply #16 on: March 06, 2018, 05:25:25 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.


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: 561
  • Country: us
Re: How would you make RGB leds fade into each color?
« Reply #17 on: March 06, 2018, 07:44:12 am »
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 trcr top shape, Tek 535, Tek 465. Tek 545 Hickok clone, Tesla Model S,  Ohio Scientific c24P SBC, c-64's from club days, Giant electric bicycle, Rigol stuff, Heathkit AR-15's. Heathkit ET- 3400a trainer&interface. Starlink pizza.
 

Offline BeaminTopic starter

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: us
  • If you think my Boobs are big you should see my ba
Re: How would you make RGB leds fade into each color?
« Reply #18 on: March 06, 2018, 01:01:07 pm »
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.. '

Max characters: 300; characters remaining: 191
Images in your signature must be no greater than 500x25 pixels
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: How would you make RGB leds fade into each color?
« Reply #19 on: March 06, 2018, 02:07:11 pm »
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: 10576
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #20 on: March 06, 2018, 03:37:35 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.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #21 on: March 06, 2018, 06:15:19 pm »
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 Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: How would you make RGB leds fade into each color?
« Reply #22 on: March 06, 2018, 06:51:01 pm »
https://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

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: How would you make RGB leds fade into each color?
« Reply #23 on: March 07, 2018, 07:54:17 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.

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: 10576
  • Country: gb
Re: How would you make RGB leds fade into each color?
« Reply #24 on: March 07, 2018, 04:25:36 pm »
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