RGB LED Circuit Problem
A common anode RGB LED can be sketched in a schematic like this:simulate this circuit Schematic created using CircuitLabThe positive voltage has to be applied to the top, for all the LEDs together. To light the LEDs up, you have to sink the current on the other end, meaning providing ground level at the bottom of that schematic at the corresponding pins. The current will then flow from your 5V pin, through the LEDs into the Arduinos pin.That means, that analogWrite(pin, 0) will turn the LED on that pin ON and analogWrite(pin, 255) will turn the LED OFF. The logic is inverted here, because the Arduinos output pin is on the other side of the LED.So your circuit and code work perfectly, you just didn't expect the inverted logic.Note: The pins of the Arduino can only source/draw a certain amount of current (20mA continuously, 40mA at maximum) without getting damaged. A single, not too strong RGB LED should be OK, but as soon, as you want to drive more LEDs, you should consider using a driver circuit (for example simple transistors). That way the output pins don't have to provide the LEDs current, but only the current to control the transistor.â¢ Related QuestionsWhy do the brightness, luminous efficacy and power of this lightbulb not agree?Here a similar bulb from same brand in a different country (Canada) is 8.5W 800 Lumens Note they dropped the efficacy spec., possibly correct ! who knows. only your Test Engineer knows for sure.If they started with emitters that were regulated to 7.5W with 106 lumens/Watt sources and had a design with 0.5W loss (14%) then it would use 8W with 100 lumens/Watt. The same bulb at 5000'K but with warm white might absorb 10% more energy to convert the blue source to warmer phosphor emissions and get only 95 lumens/Watt. Yet so many suppliers say they have the same efficacy for any CCT temperature from warm to cool. (Warning fake data)Go to a reputable source like Philips, Cree, etc for better data,.For what it's worth I have bought both warm and neutral white 5000'K in this brand from this suppier and the latter are awful white balance (poor CRI) and hideous so my wife insisted I change them in the hallway to warm white. My preference is tri-phosphor 4500k 4ft T8 tubes or 40004500'K custom LEDs. But this range is also the hardest to control in phosphor thickness and std deviation or consistency vs cool and warm------Why don't I need a resistance when testing a light bulb circuit in a breadboard?With LED's, a small increase in voltage will result in a large increase in current. So it is really hard to get just the right voltage to keep an LED at the right brightness. If you let the voltage just get a tiny bit too high it may destroy the LED.What makes it even harder is that as the LED gets hot, the current will also increase. Naturally when you power it up it will tend to get hot. As a result it is just too much trouble to drive an LED with a voltage. Some form of current limiting usually has to be put in place. It doesn't have to be a resistor, but that is probably the most simple way to do it.LED light bulbs have circuitry integrated into them that overcomes all these problems.Old-fashioned incandescent light bulbs (including halogen bulbs) are different. The part that lights up is made from a thin tungsten wire that glows when it gets hot. The wire has resistance which limits the current automatically. This resistance is also what causes it to heat up. And, icing on the cake, the resistance goes up with temperature, so incandescent light bulbs are really stable when powered from a voltage source------Single Pole Motion Sensing Light SwitchTL;DR YesFull answer: Normally the only restriction is the amount of power. An ordinary switch will be rated for the full power of the circuit - e.g., 1875 W for a 15 A circuit. However, a smart switch, dimmer, motion switch, etc. is much more complex and will typically be rated for less total power. That helps save money as the electronic components don't need to be designed to transmit, switch, dim, etc. as much power or to dissipate as much heat.The good news is that with CFL and now LED lights - which you should be using pretty much everywhere now as the power savings pay for the bulbs very quickly - the power ratings of switches are typically far more than ordinary residential needs. For example, if you have 2 3-bulb fixtures, in the old days (incandescent), that could easily be 6 x 60 W 360 W. With typical CFL bulbs, the power used is 13 - 16 W, and with typical LED bulbs 9 - 10 W, for a total of 54 - 96 W.Just check the rating on the new switch and compare it with your existing bulbs & fixtures. There may be different ratings depending on the type of bulb, but 2 fixtures in a small hallway is unlikely to be a problem------Lifehack to remove GU10 lightbulbs from light fixture?I have this exact problem with one of my light fittings. When I bought the light, it came supplied with a special sucker for removing and refitting the bulbs. Stupidly, I used the device when the bulb was hot - and melted the soft rubber.What I now do is to use disposable latex gloves, pushing the front glass quite firmly with the extra grip of the thumbs is enough to turn the bulb for removal and refitting. If you have normal household rubber gloves, this will probably work even better, but I just happen to have latex ones and none of the others.Be aware, some (cheaper) GU10s have a very thin piece of glass with a square edge that is bonded to the front of the bulb. This square edge is razor sharp and will slice your thumb open without the gloves. Even with the gloves it is possible to cut yourself. Know your enemy!Extra tip - when you replace the bulbs next time, get really high quality LED bulbs. Not only will you get all of the standard benefits of LED bulbs, but they will last for around 7 years so you will minimise the number of times you need to change them in the future------Do LED dimmers work with non-LED bulbs?There are a number of different light technologies in use (e.g., incandescent, halogen, fluorescent, LED) and dimmers have evolved to handle each new type. But some are easier to dim than others. In general, if you have a light that is dimmable then if you use a new dimmer it will work with it as well as newer technology lights.For example, this Lutron dimmer can work with:You might wonder why fewer Watts of LED & CFL bulbs work than incandescent or halogen. There are technical reasons, but it doesn't matter because 150W of LED is comparable to 600W (or more!) of incandescent lighting - i.e., with any technology enough to light up a large room.On the other hand, this less expensive dimmer from the same manufacturer/product line can handle 600W of incandescent/halogen but clearly states that it is not LED or CFL.So the new dimmers are designed to handle the old light bulbs as well. Otherwise there would be a lot of problems as people upgrade dimmers without replacing the light bulbs at the same time. But plenty of people find out the hard way that you can't necessarily put a new bulb (LED or CFL) on an old dimmer------doesn't ohm's law applied to every thing? closeddoesn't ohm's law applied to every thing?No, Ohm's law describes ohmic devices only. From the Wikipedia article "Ohm's law":An element (resistor or conductor) that behaves according to Ohm's law over some operating range is referred to as an ohmic deviceBut there are many devices that are not ohmic such as capacitors, inductors, and PN junctions to name just a few. You will learn about these later in your studies.I've read that voltage is high in step up transformer due to greater no. of turns it makes sense but why it reduce current?A transformer is not an amplifier; it cannot increase the power. Ideally, there is no power loss (practically, there must be some loss).But power is the product of the voltage and associated current.$$p v cdot i $$Thus, if the secondary voltage is greater than the primary voltage, the secondary current must be less than the primary current in precisely the right proportion such that the primary and secondary powers are equal:$$v_P cdot i_P v_S cdot i_S$$or$$fracv_Sv_P fraci_Pi_S$$For example, if the secondary voltage is twice the primary voltage, the secondary current is half the primary current.------Dimmers don't turn on at low settingMany modern dimmable LED bulbs will dim with older dimmer switches, there are some issues. One is that the bulbs may not dim as low as they can, the other is that the bulbs may not come on at the lowest setting. You may need to bring them up and then back down. I've typically had issues with the first while you seem to be having problems with the latter.New CFL/LED compatible dimmers solve a lot of problems. In addition to being engineered to be more compatible with dimmable LEDs and CFLs they also have a low trim adjustment. Either a sliding switch, knob or some other mechanism to adjust the lowest dimming setting where the bulbs perform satisfactorily.There are still compatibility issues so it's best to see what dimmers are compatible with the bulbs you have. The manufacturers of dimmers (and usually the bulb manufacturers too) will have a compatibility list so you can get the right dimmer for your bulbs or vice versa.I got tired of not being able to dim my LED bulbs as low as I wanted so I replaced my dimmers and have been very happy. Most of my bulbs have been Philips and my dimmers Lutron C-L------Using an arduino to read a 5050 LED signalThe LEDs are almost certainly controlled via PWM, so the RGB signals are 12 V PWM.You can read these into an Arduino (with a slight loss of precision), by low-pass filtering the PWM signal to get an analog voltage between 0 and 12 V, and then adding a voltage divider to scale the 12 V down to a maximum of 5 V so that you can use the Arduino ADC to read the values. The order of the voltage divider and LPF is non-critical, either way works.However, beware that the impedance of the voltage divider will affect your LPF and vice versa, so you need to either carefully design your circuit, or add a buffer of some sort in between.One of the simplest ways to avoid this inter-circuit interaction would be to use the 12 V PWM to switch a MOSFET supplied from 5 V, effectively level shifting the 12 V down to 5 V, and then choosing an appropriate RC LPF to adequately smooth the 5 V PWM on the Arduino analog input. You will want to choose your filter cutoff based on both the PWM frequency and your expected response time (how fast you want to detect changes); a larger filter time constant will give you better accuracy at the cost of slower response time.