Hey everyone! I misspeak at 3:00 - 3:04 - I should have said "cathode" not "anode" (thanks to Sachin Rane for catching that!) Also, we have a great written tutorial that shows the schematic diagram, provides the part list, and goes into more detail - check it out here: www.circuitbread.com/tutorials/how-rgb-leds-work-and-how-to-control-color
So I’m laying in bed and I have rgb lights, I had a thought about how it works and I just looked it up and found this. Glad I learned something, Andrew out🤙
working with christmas lights, c-7 & c-9 bulb sizes, (have small pixel/led combo, 4 GE color change (50 bulbs per string, .3 amps, 36W) but main controller board in 4 sets crapped out), stuff is made so cheap anymore but still costs 50-80 bucks at local big box home improvement stores). thinking for next year to build my own Arduino/raspberry pi setup and power supply, fully enclosed in waterproof box. but need to know more about power supply and arduino combo build. will be checking out your link to the code in the coming days. thanks for good info video.
I watch your videos, and THIS is what I call Great content. Thank you very much. But the problem is that I don't have an Arduino and I would REALLY like to try this Project on Raspberry PI 4. Help is Appreciated.
Thanks, I appreciate the feedback! I've been thinking about doing an embedded series with a Raspberry Pi because I want to start doing something with my nearly 8 year old son and I want something that'll be easy for him to work with. Unfortunately, I haven't put anything together yet and I've only done one project ever, nearly two years ago, using the GPIOs on a Pi. It's kind of lame to do this to you, but have you checked out this page? www.raspberrypi.org/documentation/usage/gpio/python/README.md
Thanks Royal! I looked through some of our tutorials and realize we don't have a super-great explanation of duty cycle but if you haven't seen this, it is helpful and does touch on it heavier - www.circuitbread.com/tutorials/how-to-dim-an-led As for basic circuits to practice building, I actually recommend our PIC10F200 tutorial series that Sergey has created - it's a fun combination of both circuits and microcontrollers. www.circuitbread.com/tutorials/tags/microcontroller
Basically, how long it is on during a time period, then how long is it off. Using a pulse width modulated dimmer on a light, a 70% duty cycle means the light is on 70% of the time of each pulse at full brightness, so the light seems dimmed to 70% of the brightness. Say your pulse is 100 milliseconds (msec). The light will be on for 70 msec, then off for 30 msec and it will make the light APPEAR dimmer. The light comes on to full brightness, but isn't on all the time. This is different than a resistor based dimmer, which lowers the voltage to the light and it puts out less light
I was wondering the following: - If I have a circuit with a resistor and an LED, and I change the resistor, outside of the current through the LED, does the voltage across the LED change? - If I change the LED and not the resistor, what changes outside the threshold voltage?
If you change the resistor, then it does modify the voltage across the LED. But if you look at the VI curve of an LED, once you pass the "knee" or forward voltage, a tiny change in the voltage causes a large change in both current and light output. If you change the LED, since you're changing the threshold voltage, you'll also change the amount of current through it. That's why, for an RGB LED, you probably want to have different resistor values for each LED.
Ok. Interesting and useful. But now I need to apply this to my problem. I have a variable speed drive for a dc treadmill motor. I’m using a SCR and bridge rectifier. I have 2 potentiometers connected to the SCR. One for course speed adjustment and one for fine adjustment (120 kO and 20 kO). What I’d like is a LED indicator light that starts at green for low RPM and goes to red for high RPM , with all the colors of the rainbow between. Silly, I know. But it would be cool and I’m trying to learn electronics. When both pots are maxed counter clockwise, the resistance is 140 k Ohms. The motor starts turning just below that. When I rotate either pot clockwise, the resistance goes down and the motor starts turning. How do I hook up this RGB LED to get what I want? Your help is appreciated. Thanks, Paul
Alright so I’ve just watched Adam savages latest build involving an infinity pool, you might find it interesting tbh, but I’ve gotten the insatiable urge to make a wall out of the object he builds, many of them tbh lol but it’s going to be probably a couple hundred feet of LED strip cut into smaller pieces by necessity of the build. Say I wanted to add color changes to specific lights throughout the entirety of the display at once while having other sections be other colors simultaneously, in your opinion how would this be easiest? To do as you do in the video and make each unit it’s own thing and time each controller with another or run them all in sequence and off on controller?
Sounds like a fun project! I would not follow this tutorial - the complexity would get out of control very quickly. I guess, technically, it would be possible, but I would go with some addressable RGB strips as it would be a lot easier.
Dang it! Usually we catch when I misspeak when reviewing (which, I misspeak *all* the time) but somehow this one slipped through and remained unnoticed for nearly a year. You are correct - at that point, I should have used the word "cathode" not "anode". Thanks for catching that and commenting!
My friend gave me an arduino set includes this led and i had no idea what was that 4 leaded led is. Thanks to youtube algorithm they saw the situation through my camera and popped this onto my stream.
I haven't tried doing PWM with the led I have. I just connected each of the RGB pins through a resistor each to +3.3V to see what it looked like. I was expecting to see 'white' with all 3 colours but I could just see each individual colour lit as if it really were 3 LEDs stuck together. Does PWM assist in the illusion of blending the colours or are some LEDs just not diffuse and suitable for colour blending?
If you look directly at an RGB LED, you can almost always see the individual colors but if you put some sort of diffuser on it or see the light splayed on a wall or something, it *should* look white. The PWM in this case probably won't make much of a difference unless you're balancing the colors by making one particular color stronger or weaker. But you'll still see them individually if you look directly at the LED.
I really don't know what duty cycle modulation is. I need to learn that first but I understood that the colors are produced by mixing colors from three different leds with a common + and - terminal.
If you setup your software that way, yes. Or if you have a "smart" RGB LED. The kind of LEDs referenced in this video would not be able to without the software.
You can use a single potentiometer and no arduino to control all three LEDs inside an RGB LED at the same time though, as we discussed in this video (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-3kntdICTuUQ.html) , it's not recommended. But you can have a potentiometer for each color without an Arduino, you just need to make sure that you don't go outside of the voltage specs of the LED as you're adjusting the resistance. Shouldn't be a problem!
Yes, you could figure something out but it wouldn't be orange, as that's not one of the primary colors of the RGB LED. You could choose between red, green, or blue, otherwise you'll need a mechanism to mix the colors. Also, to choose between off and one of the two other colors would be easier with an SP3T switch.
how would one go about linking these in series and then connecting multiple links of leds in parellel with each set of links individually programmable?
While it would be possible to do this, have you looked into WS2812 LEDs? They're individually addressable and may end up being easier to deal with in the long run. Definitely more consistent and flexible.
hey, I'm trying to see if its possible to change the color ov my car amp led lights, its one solid color (red) I want to make them blue. the red light is annoying... ? can you help me ? fyi its not the power on lights but the whole interior amp.
If it's accessible, you could directly swap the red LEDs with a blue LED and see what happens. The problem is that blue LEDs require a higher voltage to drive them and, most likely, it won't work. Green LEDs (less irritating to my eyes than both red and blue, personally) have a lower forward voltage than blue but, if I remember correctly, a little higher than red. But it would be more likely to work than blue.
Are there packages where the three diodes are so close to each other or in a comb pattern that even with a clear plastic lens the light cannot be distinguished? Why do RGB LED displays use individual LEDs?
They use individual LEDs because, in the vast majority of the cases, it works well enough, and it's much, much cheaper/easier/better than trying to put those discrete LEDs even closer together in an even smaller array. The thing is that LEDs create their color based off the material they're made out of. So, if you want to put those different-colored LEDs close together, at the semiconductor level you'll need completely different materials. Or at least, different enough to be a huge pain that their lattices don't connect to each other naturally or easily - a surprisingly large challenge that scientists have had to overcome as they're developing LEDs.
@@CircuitBread I thought you could cut an LED in quarters and the mix the colors ( weakest technology gets 2 quarters ). Then press those together. Maybe even nicer would be 60° sectors (waffles) and then opposing sectors have the same color to let them all have the effective center in the same spot. The overall emitting surface better stays below the diffraction limit ( so below 1µm ). Maybe some precisely placed air bubbles can give us a high emission with good uniformity.
Yep, that sounds that it would work! I think that's where the demand question comes in. That would be more work and cost more and, if there's no demand for it, I doubt anyone is making it. I could be totally off on this but I haven't heard of anyone going to significant lengths to make it so the LED itself was completely indistinguishable from a single color light source.
@@CircuitBread cost is probably the main factor. We pay for the whole semiconductor crystal. If we go to the cooling limit, we have lots of payload for low overhead of wire pads and cutting margins. I would love if those fancy upscalers could be used to translate bitmaps to an RGB hex pattern with very high fps ( LED is fast and we need hex pattern for dense packing of the plastic lenses to aim all light towards the viewer). Maybe one could press a PMMA front plate with a hex pattern for even more focus. Difficult to wipe clean though.
I agree with mrr882008 - it won't be as bright nor will it be as "nice" of a white. You can tweak it to get the hue you want, but it very likely won't look quite as good as a dedicated white LED and won't be as bright as a dedicated LED of similar size.
@@CircuitBread Thanks That's What I'm Beginning To Conclude Also. Now With A Little Bit More Technicality... Would A 3528 White LED Be Brighter Than An RGB 5050 Casting White?
@@salvatorehayes2753 If we're getting down into specifics instead of generalities, I'd say - check the datasheets! The lumens and the viewing angle should be in there, giving you a more realistic comparison.
Thank you so much for the video!!! I have a question about a project I’m trying to do: I’m new to the Arduino and electrical side so I don’t know much about... anything :( This may be a silly question but, if I were to make a pink salt lamp with an rgb led in the base, how would I control and power the led without placing an entire arduino uno in the lamp’s base? Thanks!
Glad the video helped! This may seem overly easy, but just run some wires from the Arduino (wherever you place it) to the LED. You'll need four wires and just connect them on both ends. You could probably just strip all but four conductors from an old-school IDE cable to keep it neat - or buy something like this: www.sparkfun.com/products/14992 The power levels are low enough that you shouldn't have any issues with this method, as long as you're not trying to run the cable from one end of the house to the other.
Thank you for responding! I have a second question if you don’t mind: Is there any way I can control and power the led WITHOUT an arduino at all? The salt lamp was $8 and only had an rgb led that had a smooth rainbow flowing led effect. I didn’t really like that and just wanted to fix it to a solid color, but when I opened it, I saw that one of the two pins (it was rgb but only had two pins 🤷♂️) was broken. So I was just trying to figure out how to place in my own led and control/power it without a whole arduino. Could I just buy an led controller chip online? If so, do you have a good one in mind? Thanks!
LEDs can easily be controlled without an Arduino but it does depend a lot on how much flexibility and control you want. We talk about how to do this in our PIC10F200 microcontroller series, which those are small and cheap but 1) I doubt you're looking for something as complicated as those tutorials get and 2) while the chip itself is very inexpensive, there is some less-inexpensive hardware needed to program it in the first place. Unfortunately, I don't have any LED controller chips to recommend and, honestly, wonder if a smaller, non-brand name Arduino board would be cheaper and give you more flexibility. Something like: www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html? That being said, if you're just looking for a solid color, get some resistors or small trimmers and hardwire them in. You'll pay more for shipping than you will for the resistors, and you won't be able to change the color without replacing the resistors, but it should give you the opportunity to choose the color you'd like. This entire conversation is assuming that these are low-voltage LEDs, of course.
Okay my question is I have underglow will ring lights and a rear burgers panel light I would like to know how to wire a single LED for each for inside the cab of my car to indicate that they are the same color so I don't have one green then once blue and then once red I want to be able to visually see that each one is green or red or blue blue
Just getting into arduino, so forgive the ignorance, but would an arduino Nano work just as well as the Uno used here, for the exact same purpose? Great video🤙🏽
Yep, swapping out any of those resistors with a potentiometer would work. Granted, you need to be careful to not drop the resistance so much that the LED burns out (you could put a fixed resistor and potentiometer in series, if you're nervous) but this would be a very easy way to do it.
Weird - it's hard to control to get the exact color you want, but if you have a potentiometer to control them, you should be able to fiddle with it to find what you want. Are you able to get the three colors distinctly?
Definitely! This can be done as an analog control (directly with a potentiometer or hardwired), with specific ICs, or with any other microcontroller/PLC/FPGA/control device you want.
I noticed the website has crashed. If there's any way, can you give us the arduino code for this one. We were using your video for our engineering project.
Hi! If it's just a connection issue, then it should be easy to fix. If the actual LED portion inside the molded plastic is no longer producing light, then it would be a lot easier to replace than to fix.
CircuitBread I have a replacement shipping to me right now, but I might not need it. I’m not very familiar with you know fixing connectors and wired and stuff, but I know people who can do it. If it’s a connection issue is it just to use a solderig iron or something to put it in place? And if I replace it will i still need to do the same as if it was a connection issue?
If it's just a connection issue, then it depends on where the issue is. If If it's at the point where the LED is attached, then just a soldering iron and some solder should be able to fix it quickly. And replacing the LED would accomplish the same thing of reestablishing a connection at that point. If the connection issue is elsewhere in the circuit, then it's going to be a much bigger challenge to find and fix. I've successfully been able to solder flex wires that have been broken but it was difficult for me (my soldering skills are okay but not great) and the end result was rather tenuous. If you have a multimeter, it should be able to help you find breaks in circuits that you can't see. And depending on where it is, you can either dab a bit of solder on with a the soldering iron or replace something or ... well, it just depends on what is causing the problem.
Yep, this general concept should work for any RGB LED (that gives you direct access to common and each individual lead, anyway), you'll just have some variety in forward voltage and power consumption.
Ok so if I want to connect 4 of these instead of a 5050 RGB strip to my computer's motherboard (+12V RGB 4 pin), what resistor should I need and do I need common anode or cathode? This is all too confusing :/
You can hook all four of them in parallel (which may be an interesting challenge! but just hook all four pins of all four RGB LEDs to the same things). To keep things simple, you could use 120 ohm resistors between the motherboard and EACH color input. If you put less than 4 of them in parallel, that resistance will need to increase or you will increase the likelihood of damaging the LED. And it could be either common anode or common cathode, you just need to hook them up differently depending on what you get. A couple helpful tools for this project so you can double check my numbers and assumptions - (www.circuitbread.com/tools/led-resistor-calculator) (www.circuitbread.com/tools/led-colors-and-materials-chart)(www.circuitbread.com/tools/standard-resistor-values)
Y'know, that's such a good question, we made a video about it! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-3kntdICTuUQ.html Hopefully this clarifies things.
Hi Ozair, depends on your setup! With the Arduino, if you set it up to take commands through the serial port, yes, you can control the color with your computer. And frankly, it should be quite easy. We have a few high-level tutorials on Arduino on CircuitBread.com that we just posted and those should be enough to get you pointed in the right direction. But Arduinos are so popular, I'm sure you can find exactly what you want somewhere on the internet.
@@CircuitBread thanks for the help does it have to be an Arduino? My situation is that i have an led lamp that forms an image of the acrylic design u have chosen. Ive placed it inside my pc and ran it through the back of the case so i can connect to the back usb port. Only rponlem is u can only chanhe the colour by physically clicking the button on the device which i cant as it's inside the case and id rather not open the side panel each time to change colour lol
can i use an rgb music controller with a led light strip that only has two wires (Black and Red)? I simply need a device that will make my current led strip (again with only two wires) pulsate to the sound of music.
Kind of... if you're not trying to control colors and/or individual LEDs, you can pulse the entire strip with the music. But if you want to do anything fancy, you'll need more control (either more wires for different colors or digital control for both individual LED and color). With what I'm imagining from your description, you're just basically treating the LED strip as simple LEDs in series.
sorry for bothering but I have many questions! I have a motherboard have 4 pin for RGB (+12v-R-G-B) I have a cpu cool which have 8x red leds 5mm I want to exchange them to RGB instead of red 1- do I need 3x 470 ohm resistor for each led? or 3 are enough for all leds ? 2- can I add RGB strip+ the previews 8 rgb Leds to this Circuit? (the rgb strip will include 6~8 leds only) I hope you reply me as soon as possible thanks!
Hey Ali - no worries about the questions! You will need one resistor per LED (so, three per *RGB* LED). And the value of each resistor does depend on the color of the LED, as the different colors have different forward voltages. LED strips, however, are completely different beasts. They usually run off of a higher voltage and are controlled differently, either with a communications protocol or a constant current source.
@@CircuitBread thank you very much for the fast reply so can you give me the right value of Resistor for each led? Red, Greed and Blue? I thought all will need 470 ohm I would be thankful if you help me selecting the right resistors
Is there an RGBU (U=Ultraviolet) LED? Such a LED would have agricultural applications because of the different vision of various animals. For example, insects see in GBU. Birds see in RGBU. A Night Light van therefore be devised to give Birds ab advantage over harmful Insects.
Hmmm... not that I'm aware of but it's been a few years since I've looked into UV LEDs and the technology still wasn't great at that point. But that's a fascinating idea! In that application, though, you'd probably just have physically different LEDs in one enclosure rather than trying to get an RGBU monolithic device.
Are you talking about programmable RGB LEDs? Those are controlled completely differently, they put another layer of control on top of what is discussed in this video.
Hi, love your projects. I have been all over youtube here looking for a project. I know very little electronics but learning slow. What I am looking for is a RGB led, chip and a veritable resister setup. Just a battery with a rgb bulb and veritable resistor to control the speed the rgb changes color. Can this or will this work without the Arduino board?
Hey Tom, the word "chip" is a bit too vague in this context - what does that mean? I know you can do this with an Arduino, RGB LED, potentiometer, and some resistors. But if you remove the logic device (the Arduino) and don't replace it with another logic device, then you will only be able to manually change the RGB color (with the potentiometer).
Thank you for your fat reply. I was calling a integrated circuit a CHIP. I was looking to make this as compact as possible and the Arduino board makes it to large. Maybe a 555 chip with pnp's and npn's to control the direction of the current to the tri-color led with a potentiometer to control the speed of color change. Thank you for the fast reply again.
Using a chip like a 555 could be an option but, depending on your learning curve, our PIC10F200 series specifically covers how to do things like this with an incredibly small chip. But, to be frank, while it would give you an immensely greater amount of flexibility and power at the same size as a 555, it would be a commitment to learn the platform and probably an entirely new programming language.
Hey Joe! That is entirely possible and is fairly simple. The odd thing is that changes to the potentiometer will cause non-linear effects but, frankly, if you're just doing things by eye, that would probably be the best way to approach it.
So I bought a bunch of common cathode LEDs and am using arduino PWM output to control each color intensity. Each color leg is connected to a PWM output pin through a resistor, and the cathode is connected to the GND pin. However, only one color of the RGB will light up at any one time, even if all 3 colors are set to full intensity. For example, if I set the analogWrite output of both red and green to 255, the LED will just light up green. If I unplug the green leg, it lights up just red. Anyone know what's going on here?
You weren't explicit so I'm not sure if you are using 3 resistors or just one, though I think it's three. If you ARE using just one resistor, check out our video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-3kntdICTuUQ.html If not, I imagine there is a similar problem going on but I'm not sure. I'd recommend turning all three of them on completely and then measuring the voltage drop across the different LEDs. Each LED within the package has a different forward voltage and, if you measure them, you will probably see where you've set your circuit up wrong so that you're somehow not reaching the forward voltage required for the LEDs that have a larger forward voltage drop as everything is flowing through an LED with a lower forward voltage.
@@CircuitBread I actually figured it out from the end of your video where you talk about the resistor values. The red was just incredibly dim compared to the green because I was using resistors of the same resistance for both colors, although I'm not really sure why that caused a much bigger problem for me than it did in your video. Anyway I appreciate the response and love the video! Thanks
I'm not great at the actual color mixing portion, so I stole this straight from this site: springtree.net/audio-visual-blog/rgb-led-color-mixing/ "Hot Pink: Red at 90 percent brightness, no green, and blue at 40 percent of brightness Light Pink: Red at 90 percent of its intensity, green and blue at 50 percent Pink Purple: Red at full brightness, green at 30, and blue at 90" They have some other colors as well, if you want to check out the site and see.
Hello, i've recently bought the best Budget Keyboard it's called "HP GK200", Just wondering if i can manually change the Static RGB Color into "just Static Red", by opening the case ( i have solder experience ) Thanks!
Hey Adam, I'm not familiar with these keyboards (I'd like to blame my wife but even without her influence, I'm just not much of a gamer) so I have no clue how they're wired internally. However, if all of the lights in they keyboard are RGBs, then technically, yes, you could make it so all the LEDs are red. I imagine it would be a bit of a nightmare, though. Is there not a simple way to control it in software? If not, then your best hope is that there is some sort of signal line that you can tap into and, with just a few modifications, drive all of the RGBs red.
Actually swapping them out? That sounds like it would be even more challenging. If you can, I'd recommend popping it open, taking a look at what you have, and, if you're still unsure, jump onto our Discord channel and upload the picture so we can take a look at it as well. It would be easier to provide thoughts and advice there rather than here on RU-vid (where we don't get notified of follow up comments).
@@CircuitBread I mean would it work? because i know how to open up my keyboard and pop them off ( if you're concerned about it ), I just wonder if the Lights would even turn on if i put Static Red LEDs replacing my Static RGB LED
Hey Adam, my only concern is that if the RGB LEDs have three signal wires, which one will you hook your static RGB LED up to? You don't want to short the signal wires together or you'll have problems. And if you can control which signal wire is used at any point, then there's not much point in swapping them out as you can drive just the red portion of your RGB LEDs. And sorry for the delay in response - RU-vid does a terrible (nonexistent) job of notifying me when there are followup comments. I have to look for them manually and I miss them sometimes.
Hey Akash! Same principle as in this video, but with a different package. In a phone, the LEDs will be much, much smaller but the idea of having three different channels and a common anode or cathode would still apply (assuming they're using RGB LEDs instead of discrete LEDs or, more likely, an LED backlit LCD panel).
That mark on your head is distracting me... remember, violence happens to men too! Although I am sure there is a reasonable explanation. Awesome vid, really need a tester that can test bulk RGB LEDs quickly
Maybe not a reasonable explanation... I tried to do a backflip on the trampoline with my kids and my first attempt had me land face first, so it's just a trampoline burn. 😬 It didn't look too bad at first but then it got worse for a couple days (including this day) before going away. I feel like a tester like that would be pretty easy to put together, honestly. Not sure if they're already available or if that's an unexploited market.
wouldn't this RGB led be perfectly color rendered? just like sunlight? it got all the primaries unlike general low-grade leds which is boosted with blue light only.
I don't think so... if I'm not mistaken, if you take an RGB LED like the one used in the example, and put it through a prism, you would get a strong red, green, and blue line and not much else. Unlike sunlight, which would break into a more continuous entire rainbow. I'd be mighty curious if someone could verify that practically, though.