Can someone explain why LED lights need resistors when connecting to pi. The raspberry Pi is either providing 3.3v or 5v depending on if it's connected to power pins or gpio pins. Your set up would depend on the LED(Cathode or Anode). If the LED supports up to 5 volts why do u need a resistor? Previously I hooked up an Ultrasonic Senor. The pi's general gpio pins only support 3.3v. Therefore needed to hook a resistor from senors trig pin to pi general gpio(input). This is because the Ultrasonic Senor needs 5v to operate. If I am sending a 3.3v signal from pi to LED light then why does it need a resistor before goes to ground?
A LED only needs between 1.6 V and 3.6V. If you supply a higher voltage the current would increase more than it is good for the LED.
Every Diode (and also an LED) is not linear, that means if the voltage is to high the current would be higher than
- the current that can be supplied by the Raspberry PI (which could damage the PI)
- the current allowed for the LED (which could damage the LED)
For a more in-depth background look at https://www.electronics-tutorials.ws/diode/diode_8.html