You’ll be able to calculate the appropriate resistor value. There are plenty of calculators online to do it for you (a quick google for LED Resistor Calculator will bring some up), but we’ve got a full article about how to work it out here:
We do have an illuminated toggle switch, but unfortunately our supplier is currently out of stock. You can sign up to get notified when they’re available again using the link on the product page:
As for dimming the LEDs, you’re probably better off using a PWM dimmer, though a potentiometer would also work - they just tend to be very sensitive.
You might find this is a good starter project for a microcontroller, something like an Arduino Uno (or a compatible board):
The power to illuminate the LED in that video comes from the battery in the meter. The meter passes some current through the LED and then measures the voltage across it.
You do realise that to change colour you have to reverse the voltage on the LED. You will need that DPDT switch you mentioned but I can’t recollect ever seeing a rocker switch in that configuration. I haven’t had a look either.
Thank you. Today, the seller of that bicolour LED wrote:
“220 ohms 1/4w, 1 resistance per LED”
I hope that makes it simple to work out?
Regarding the DPDT switch, I can select another one.
Michael has put together a guide I think you will find super helpful for LED circuits.
To start with I’d just get your LEDs set up with just one colour on a breadboard as a proof of concept then worry about wiring up the second colour and adding flashing lights later.
I can see in your email you said the forward voltage for Red was 2V and Warm White was 3V.
Try to set your LEDs up with current limiting resistors so they use around 5mA, as you don’t have the current limit specs, then see how bright they are before experimenting further from there.
You would do well to read Trent’s reply above and do what he suggests.
As previously suggested if you want to have LED brightness adjustable PWM is the way to go. You would have to generate the PWM signal which would suggest one of the Arduino flavours.
You need to reverse the voltage on the LED / resistor combination to change colours. If you did not want to use a DPDT switch one of the H bridge motor driver units would probably do. This could be driven by PWM from Arduino to control brightness and also switch the H bridge to change colours from Arduino as well. Flashing Red worry about at a later time when all else is working. This could also be handled by Arduino.
Unfortunately, this is not enough information by itself.
LED’s (and all electrical components) are governed by Ohm’s law - Trent linked a good article above.
Ohm’s law in it’s basic form for DC circuits has three variables - Voltage (V in Volts, symbol V), Current (I in Amps, symbol A), and Resistance (R in Ohms, symbol Ω).
For any component in a circuit, you’ll need to know (or work out) 2 of the three to be able to calculate the third. 1/4W is the maximum power rating for the resistor, but it doesn’t let us know anything more about the LED (Though it does let us know that if the LED needs more than 0.25 / 220 = I^2 => I = √(0.25 / 220) = 0.034m or 34mA, the resistor would burn out, so it can’t need more than this).
You also need to know that the current is the same everywhere through a simple circuit (described by Kirchoff’s Current Law), and that the voltage across each component in series adds up to the total voltage across those components (Kirchoff’s Voltage Law).
At the moment, the seller has provided 1 value for a resistor (220Ω), and 1 value for each of your 2 LEDs (2V and 3V).
To work out the missing information, you’ll need to know the current rating for your LEDs, or the Voltage the seller is recommending across Resistor (so you can workout the current through it, and hence the current the seller is recommending for your LED).
Or as you previously suggested MEASURE IT. This is a very simple task and would stop this back and forth dialog. If we were also advised what the supply definitely was we could make some resistor suggestions to give say 10mA per LED. But as Steve has suggested he wants to control brightness this is a bit academic as long as Max is not exceeded. I would suggest 20mA as a max figure.
Sometimes you will find different symbols for Volts and Amps. Just to confuse the issue.
“V” (volts) often used is “E” (EMF maybe?).
“A” (Amps) often used is “I” (no idea why).
“Ω” (Ohms) often used “R” (resistance).
When looking at technical publications you will mainly find E = I * R and not V = A * Ω and also P = E * I
and when you see the relationship triangles you will find P, E, I, R used in favour of W, V, A, Ω.
Typically, the little LED’s (not the bright or super bright ones) use 20mA (0.02A) per LED color. Red’s usually operate at 1.8V, greens and white (and shades of it) at 2V.
My suggestion, if you want to use bi-color LED’s is get one with a common cathode (3 prongs instead of two). Less headache during wiring and a two way switch can easily control them.
If you have only a 6V power supply or a 3.V one from an old cell phone charger - I have a few of them from the non-smart phone days, just calculate what is the voltage you need (connect the track LED’s in parallel circuit, that way one LED blows, you don’t have to trouble shoot by testing each of them), let us say the the max voltage is 2V, subtract it from the max voltage of the power supply. You can use diodes (1N4001 with a voltage drop of 0.7V per diode) or use plain red 3mm LED’s (Voltage drop of 1.8V) to reduce the voltage down to the desired value.
Connecting diodes in series at the start of the circuit will also protect the other diodes, which are harder to replace in the track.
I do not know much about track cars and how they are switched, but in my previous life I was a railroad modeller (N-scale). Made LED signals that would change color when track is switched (turnout switches in American or points as in English). I was using DCC (14V, 2.5A square wave) and made a homegrown circuit to make it work. I used 5050 LED’s (3.2V optimum and 60mA per chip). In this video, you can see around 53 seconds, the track switching and signal color in the yard changing, then the train gets stuck in that finicky turnout and then passes through with the signals to the yard changing color as per the switched turnout configuration.
Today I’ve happily more info on my planned LED track layout. Ideally 15mA whatever the LED or color, max 20mA. Also, I would like to cancel my plans for a flashing unit. I can always put that in later. I guess I was being a bit fussy. What situation is, is that I have a disability (wheelchair, limited hand function) but I have a friend who can solder but not much else. What I’m doing is trying to put together a plan with 20 LEDs and resistors with 6 volt power. I can change to 9v or even 12v if that makes it easier to work and run my LEDs for 2 to 3 hours at a time. Thank you for your time, Steve.
Earlier in this thread you were told that you need to know the forward voltage drop of your LEDs.
Oliver even posted a video showing how you can easily do this. You said you understood this and how the multimeter is used.
So far there is no indication that you have done it or at least you have not let anyone know the result of any measurement.
The forum needs to know this to be able to calculate resistor values. Then we can give you values for 6V, 9V, or 12V whichever you are going to use.
Another thing to be aware of. With those LEDs you have to reverse the volts to change colour. Each colour will probably be different voltage drop but you can only have one resistor so the actual value might be a bit of a compromise. That is you may get a little more current one way than the opposite but in practice that probably won’t matter much as the eye is pretty forgiving.
Are these LEDs all going to be on together or switched individually or in groups etc.
With a bit of guesswork you now have enough information to do the calculation. This calculator will give you an idea of the options available. You will want to see how your choice of power supply and wiring arrangement affects what you need, so look at each of the solution options to see what would most suit your setup.
I would recommend using the suggested typical LED values at that site rather than your approximate measurements. The information from your supplier indicates that IF he was assuming a supply of 5v then the suggested 220ohm resistor implies a LED current of about 15mA. That is very typical for LEDs and is what I would recommend. A higher current (up to about 20mA) will mean brighter LEDs, but possibly a shorter life, and less room for error if your information is not quite correct. Resistors are cheap and you could try different values before deciding.
From this end it makes no difference. Just changes resistor value.
Jeff has posted good advice. Please try it. If you don’t do some of this yourself you are going to learn nothing so at this stage I will leave the calc to you.
Your main problem is you have 2 different colours hence 2 different forward voltages (3V, 2V) and have to use only 1 resistor. For this exercise average the voltages (2.5V) and use that with 15mA the required current. Once you get the hang of it you will find it easy to change the current by changing resistor values. The forward voltage across the LEDs will only change slightly and for practical purposes can be ignored.
If you are using individual resistors (1 per LED) put “1” in the number of LEDs box. Individual resistors would be the safest and easiest to get right at this stage so carry on with that scenario.
And you can get our latest projects and tips straight away by following us on: