Undervolting LED damage?

Status
Not open for further replies.
Feb 25, 2011
16,822
1,493
126
I bought some lighted switches on ebay for a raspberry pi project, and they say they are 12v. I tested them with some batteries at 3v, 6v, and 12v, and they light up even running at 3v. (And, of course, they function as switches regardless.)

If I run them off of the Raspberry Pi using the 3.3v output, is it possible this might wear out or damage the LEDs?

Thanks
 
Feb 25, 2011
16,822
1,493
126
Cool, thanks!

I did find a different problem - the LED adds enough current pull that the GPIO pin on the Pi can't always tell if it's been flipped. I'll have to figure out something. :/
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
LED current is directly related to voltage so you can try reducing the voltage further or current limit the LED itself independently of the switch. (IE resistor added at the switch)

Generally for an LED, the lower the voltage, the lower the current draw. This is the reverse of some other devices like motors where lower voltage can increase current draw.
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
You'll want to use a transistor and a secondary power source (can be the source that's directly powering the RPI) when driving something from an IO pin. Technically you can get away without it for LEDs but I'd still recommend it. If you take something like an Arduino for example there is a total draw limitation so while you may get away with a few IO pins as you add stuff you could exceed it's limits and possibly damage it.
 
Last edited:
May 11, 2008
20,041
1,289
126
Cool, thanks!

I did find a different problem - the LED adds enough current pull that the GPIO pin on the Pi can't always tell if it's been flipped. I'll have to figure out something. :/

Red, green or yellow Leds light up with a voltage between 1.4 to 1.8 Volts is applied.
When you want to use them at 12V, you need a resistor.
Assuming they have a resistor in series to be able to be used for 12V, there is something else going on.
The led consumes a certain amount of current.
The GPIO pin when set as an output is actually a current source that can only provide limited current, for example 2mA when high(sourcing) and 5mA when low(sinking). It is not uncommon that GPIO pins can sink more current then they can source.
If the led draws more current then the GPIO pin can deliver when high, the sourcing GPIO output will lower in voltage to be able to supply maximum current. This means that the voltage on the GPIO pin lowers.

When a GPIO pin is read as an input and logic voltage levels :
To a GPIO pin has to be applied a certain amount of voltage to be seen as logic high or as logic low. If this amount is not high enough, you might get into the "grey" area where the GPIO input can not determine if the pin is high or low and it randomly switches depending on temperature and power supply noise.

For non schmitt trigger inputs :

For CMOS voltage levels :
Logic low is an input voltage lower then 1/3 supply voltage.
Grey area is between 1/3 voltage and 2/3 voltage.
Logic high is an input voltage higher then 2/3 supply voltage.

TTL level :
Logic low is an input voltage lower then 0,8V.
Grey area is between 0,8V en 2V.
Logic high is an input voltage higher then 2V.

Best way is to use a transistor.
A cheap way is to let the GPIO output sink the led current.
You connect the - side of the led to the GPIO pin and the + side to the 3.3V.
But make sure you have a resistor in series.
 
Last edited:

videogames101

Diamond Member
Aug 24, 2005
6,777
19
81
Undervolting an LED won't be a problem. As for connecting it, a transistor or optocoupler is the way to go, as a rule I wouldn't try to power things directly with a micro's IO pins. It can work, but why chance burning a pin on your expensive micro. Also use a resistor with your LED to limit current draw.
 

Jeff7

Lifer
Jan 4, 2001
41,599
19
81
Undervolting an LED won't be a problem. As for connecting it, a transistor or optocoupler is the way to go, as a rule I wouldn't try to power things directly with a micro's IO pins. It can work, but why chance burning a pin on your expensive micro. Also use a resistor with your LED to limit current draw.
Aw come on, the PIC18F46K22 datasheet says that it can dissipate up to 1 watt, and sink up to 200mA of I/O.
(And I think those pins are current-limited too.)


But it's nothing a little MOSFET can't cure.
 

ctbaars

Golden Member
Nov 4, 2009
1,568
163
106
Cool, thanks!

I did find a different problem - the LED adds enough current pull that the GPIO pin on the Pi can't always tell if it's been flipped. I'll have to figure out something. :/
Is this photo-transistor output that the i/o pin is connected to so to indicated if the the switch is physically on or off?
 

Aluvus

Platinum Member
Apr 27, 2006
2,913
1
0
LED current is directly related to voltage so you can try reducing the voltage further or current limit the LED itself independently of the switch. (IE resistor added at the switch)

Generally for an LED, the lower the voltage, the lower the current draw. This is the reverse of some other devices like motors where lower voltage can increase current draw.

This is a little misleading.

LEDs, like other diodes, behave like a fixed voltage drop. Current through the LED will be governed by the resistance of the circuit (resistors in series, wires, internal resistance of the LED, etc.). Without a current-limiting resistor they will often pop and let out the magic smoke even at relatively low voltages. Devices like what OP has have resistors built in to ensure the right current draw at the specified voltage.

The voltage-current relationship for a motor depends on the type of motor and the load placed on it, but yes it can be an inverse relationship.
 

Aluvus

Platinum Member
Apr 27, 2006
2,913
1
0
Cool, thanks!

I did find a different problem - the LED adds enough current pull that the GPIO pin on the Pi can't always tell if it's been flipped. I'll have to figure out something. :/

How many terminals does your switch have? I'm guessing 2? My guess is that the LED (and an internal resistor) is wired in series with the switch. The LED probably drops 1.8 V or so (if it's red; generally more for other colors). 3.3 - 1.8 = 1.5 V, which is going to be pretty close to the threshold of what the Pi considers "high".

So if that's the case, you have a voltage problem rather than a current problem.
 
Last edited:
Status
Not open for further replies.
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |