How would you make RGB leds fade into each color? - Page 1
Forum section: electronics / beginners

author: Beamin
author_rank: Super Contributor
timestamp: March 01, 2018, 08:44:31 pm
content: 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.

author: Paul Price
author_rank: Super Contributor
timestamp: March 01, 2018, 09:53:51 pm
content: 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.

author: Brumby
author_rank: Unknown
timestamp: March 01, 2018, 11:04:23 pm
content: 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.

author: Brumby
author_rank: Unknown
timestamp: March 01, 2018, 11:10:41 pm
content: 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.

author: Audioguru
author_rank: Super Contributor
timestamp: March 01, 2018, 11:55:21 pm
content: Quote from: Brumby on March 01, 2018, 11:10:41 pmMany 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.

author: Cerebus
author_rank: Super Contributor
timestamp: March 02, 2018, 12:04:47 am
content: Quote from: Brumby on March 01, 2018, 11:10:41 pmIndeed, 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.

author: Brumby
author_rank: Unknown
timestamp: March 02, 2018, 03:32:52 am
content: Quote from: Cerebus on March 02, 2018, 12:04:47 am(Yeah ... but I didn't want to use the "m" word.)

author: danadak
author_rank: Super Contributor
timestamp: March 02, 2018, 01:33:41 pm
content: Look at this thread. Use PSOC state machine capability, write no code, and get aworking solution pretty quickly.https://www.eevblog.com/forum/projects/momentary-push-button-to-toggle-switch-ic/Regards, Dana.

author: Beamin
author_rank: Super Contributor
timestamp: March 03, 2018, 11:22:18 pm
content: Quote from: Paul Price on March 01, 2018, 09:53:51 pmIf 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.

author: Audioguru
author_rank: Super Contributor
timestamp: March 04, 2018, 01:23:01 am
content: 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.

author: Jwillis
author_rank: Super Contributor
timestamp: March 04, 2018, 03:53:32 pm
content: 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.

author: Beamin
author_rank: Super Contributor
timestamp: March 04, 2018, 05:48:11 pm
content: Quote from: Audioguru on March 04, 2018, 01:23:01 amWould 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?

author: Zero999
author_rank: Super Contributor
timestamp: March 04, 2018, 06:05:49 pm
content: Here's one of the simplest circuits I know of. The Schmitt trigger can be the 74HC14 or CD40106 and the comparator the LM339.

author: Beamin
author_rank: Super Contributor
timestamp: March 04, 2018, 06:36:07 pm
content: That would fit in two eight pin dips? That's an analog circuit right?

author: Nusa
author_rank: Super Contributor
timestamp: March 04, 2018, 07:24:30 pm
content: Quote from: Beamin on March 04, 2018, 06:36:07 pmNo. 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 04, 2018, 08:01:57 pm
content: Quote from: Beamin on March 04, 2018, 06:36:07 pm1) 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.pdf2) What do you think?

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 06, 2018, 05:25:25 am
content: Quote from: Hero999 on March 04, 2018, 06:05:49 pmif it were not for the tolerance of the components that circuit would produce just a fading white lightby changing the value of the resistors (e.g. 68k, 100k, 150k) the light color would change more frequently

author: jh15
author_rank: Frequent Contributor
timestamp: March 06, 2018, 07:44:12 am
content: 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:)

author: Beamin
author_rank: Super Contributor
timestamp: March 06, 2018, 01:01:07 pm
content: Quote from: Hero999 on March 04, 2018, 08:01:57 pmNot 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.. '

author: Zero999
author_rank: Super Contributor
timestamp: March 06, 2018, 02:07:11 pm
content: Quote from: not1xor1 on March 06, 2018, 05:25:25 amYou 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.Quote from: Beamin on March 06, 2018, 01:01:07 pmOne 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.

author: Cerebus
author_rank: Super Contributor
timestamp: March 06, 2018, 03:37:35 pm
content: 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.

author: Cerebus
author_rank: Super Contributor
timestamp: March 06, 2018, 06:15:19 pm
content: Quote from: cleaningOut on March 06, 2018, 03:43:16 pmI 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 06, 2018, 06:51:01 pm
content: Quote from: cleaningOut on March 06, 2018, 06:46:09 pmThat'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.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 07, 2018, 07:54:17 am
content: Quote from: Cerebus on March 06, 2018, 03:37:35 pmbut the subject does not require a mere randomness, but a slow fade effectthe 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

author: Cerebus
author_rank: Super Contributor
timestamp: March 07, 2018, 04:25:36 pm
content: Quote from: not1xor1 on March 07, 2018, 07:54:17 amSo? Many chaotic functions are continuous and it's easy enough to pick time constants that are 'slow' in terms of human perception.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 08, 2018, 08:39:42 am
content: Quote from: Cerebus on March 07, 2018, 04:25:36 pmok... you are rightwhat kind of circuit would you suggest?

author: Cerebus
author_rank: Super Contributor
timestamp: March 08, 2018, 11:41:06 am
content: Quote from: not1xor1 on March 08, 2018, 08:39:42 amTo quote myself:Quote from: Cerebus on March 06, 2018, 03:37:35 pm

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 09, 2018, 05:16:30 am
content: Quote from: Cerebus on March 08, 2018, 11:41:06 amI did not know anything about that kind of circuit, but from a quick search with google I got the feeling they are a bit too complicated.I think it would be easier to produce a sort of fake randomness by just driving the PWM comparator with the sum of multiple schmitt trigger oscillators.

author: Beamin
author_rank: Super Contributor
timestamp: March 09, 2018, 07:38:19 pm
content: Quote from: Hero999 on March 06, 2018, 02:07:11 pmSo that circuit would break SPICE if you put it in it? The first time I used SPICE I built a multivibrator and it crashed. I quickly realized that in theory that circuit would never get started. In practice it almost always will. Are there any other spice killing circuits like things with perfect left right symmetry?

author: Zero999
author_rank: Super Contributor
timestamp: March 09, 2018, 11:09:01 pm
content: Quote from: Beamin on March 09, 2018, 07:38:19 pmIf you want to simulate the classic two transistor astable, then use slightly different values for the resistors or capacitors and it will work perfectly.If you simulated, the circuit I posted here, you'll find it will oscillate, but PWM to all the LEDs will remain the same, so there would be no colour changing. Again this can be fixed, by using slightly different values for the RC circuits in each oscillator.