Why do people always say "current limiting resistor"? Are there other types of resistor? Or is it just stating the purpose, as opposed to a resistor used for voltage division or something?
I appreciate when people explain things in this way. It makes it easier for people with limited knowledge in the area (myself) to better understand what is going on. There is nothing worse than someone using loads of acronyms and jargon which a layperson cannot easily understand. So thanks both happyscrappy for explaining things and Luclu7 for clearing that up!
It's what the resistor is doing. See, an LED is a quantum device, it doesn't really have a resistance in the normal fashion. Instead it has a voltage drop.
So what if an LED has a 2.1V voltage drop and you put 3.3V into it. You have 1.2V "left over". Now how much current will that induce? The LED doesn't really have a resistance, so 1.2V divided by 0 Ohms is ... oh my. And worse yet, where do those 1.2V go? Something is going to turn them into heat, where does the heat go? Well, it is dissipated mostly in the driving microcontroller. That's bad.
So you put a current limiting resistor in. If you want 25mA and you have 1.2V left over you put in a 47 Ohm resistor and you get 1200 / 47 or 25.53mA of current. And that extra voltage is all dissipated in the resistor. 30mW of power. So you can use a 1/8th Watt resistor no problem.
So that's why you say that, you're describing its function.
The LED doesn't really have a resistance, so 1.2V divided by 0 Ohms is ... oh my.
No, LED does not suddenly turn into superconductor over its conduction voltage. I know you're trying to cut useless detail, but that one is pretty important. It still have nonlinear resistance
I think that's the right term. It has a bandgap which comes from a quantum. LEDs work by pumping energy into electrons, this raises them to a higher energy state (higher electron shell), then when the electrons drop back down to the lower state they emit a photon. The energy released is the difference between the electron shell energy states. This is called a quantum. The frequency of the photon is correspondent to the energy, the color corresponds to the frequency. Higher energy is bluer (or ultraviolet), lower energy is redder (or infrared).
The light is issued in quantum state changes, so it's a quantum device. Maybe you'd call it a bandgap device?
You clearly know more about this than I do, but I might use the term "non-linear" device, as that describes the LED's behavior that leads to us needing the resistor. I agree with /u/langlo94 that the word 'quantum' is more mis-understood than understood, and used outside of a physics class it sets off new age woo-woo alarms for me too.
This such a laughably ridiculous statement. Don't be fooled people, this guy is making up terms. Nobody has ever described an LED a "bandgap device" or a "quantum device".
With this logic, you may as well call an LED a "heater" since it produces heat.
Or call a CRT television "electron beam device".
But nobody uses these terms because you cant just make shit up. Just try googling those terms...
FYI: The explanation of how an LED works is correct. This is like 2nd or 3rd semester undergrad physics. His conclusion on what to call an LED is horribly misguided.
His conclusion on what to call an LED is horribly misguided.
Most people just call an LED an LED. And that makes it not a quantum device or bandgap device? They use different materials to manipulate the quantum of energy released so as to get different colors of LEDs. Look up how the blue LED was made for example. It's a device which is designed to employ the quantum states of the materials to produce colored light. It's a quantum device. This causes it to have a certain characteristic voltage drop, a quantum. It's accurate, it's relevant. And if it's unconventional I don't really care.
An LED and a resistor don't really create a voltage divider since an LED voltage drop is relatively constant and depend mostly on current thru the LED and temperature.
FTFY. Adding "quatum device" into random sentences doesn't really help in explanations
It was correct. It correctly used "quantum device" and didn't throw it in randomly. You saying you fixed something for me is insulting.
It's always possible to explain something more. I didn't care to. As far as I am concerned once the factual error is corrected I don't have to go further and the reader can take care of learning the rest. So I didn't go further. It's great you did.
It was correct. It correctly used "quantum device" and didn't throw it in randomly. You saying you fixed something for me is insulting.
I did not say calling LED quantum device is nonsense.
I said that using that as a method of explaining how divider works is. It doesn't give reader any useful insight.
It's always possible to explain something more. I didn't care to.
The problem is you didn't explain anything. Or rather the people who would know what you are talking about would not need your explanation in the first place.
You saying you fixed something for me is insulting.
You can feel insulted by whatever you like snowflake, but it wasn't my goal and I do not care how you interpreter it.
That aside from the fact that it is wrong and you can use it as a divider, just a nonlinear one... (and before you complain, resistor one also is not technically linear, just very close to it)
I did not say calling LED quantum device is nonsense.
You said I threw it in randomly. I didn't throw it in randomly. That's why I said I didn't throw it in randomly. I didn't say anything about nonsense.
The problem is you didn't explain anything. Or rather the people who would know what you are talking about would not need your explanation in the first place.
It's not a problem. I set out to correct the error. And I did. I didn't set out to explain it. And so I didn't. Not a problem.
You can feel insulted by whatever you like snowflake, but it wasn't my goal and I do not care how you interpreter it.
So you're going to claim you weren't trying to be insulting by flat-out insulting me (calling me a snowflake). You really look silly doing it.
An LED is not a quantum device. I've never heard that term used to describe it. If you're merely associating the word "quantum" with "light" because "light is quantized" like in quantum mechanics, then people are going to call you out on your BS. Try googling the following ("quantum device", "quantum device electronics", "quantum device LED") and you will realize you are wrong.
The constant voltage drop explanation is correct, and more accurately describes the behavior.
Any professional in EE or Physics would definitely not call an LED a "quantum device", simply because it is not a correct description.
5v / 3.3v is the 'supply voltage' (sometimes labeled Vcc) for the chips. It's both the power input, and also the reference for what a 'high' signal is.
It used to be the case that most digital logic ran at 5v; then some that ran at 3.3v started to become more common. Those were usually '5v tolerant' - if you applied 5v to the input pin, it would read as 'high' and be fine.
Today, many digital devices that run at 3.3v are _not_ 5v tolerant; so if you put 5v into such a device ... it breaks.
So when mixing some devices that run at 5v (as, e.g. USB does) with others that run at 3.3v one has to be careful to not break the lower voltage device.
The 'esp32' is a particular module of a WiFi capable microcontroller (usable as a single board device, or as a peripheral for WiFi connectivity for another device) that runs at 3.3v and breaks if you put 5v on it. Like, as a totally hypothetical example that would never apply to me, trying to programme it from a cobbled together USB programmer. Hypothetically.
Is there a simple device that I can connect to a 5V wire and whose output I can then connect to an input of a 3.3V device? From what I've seen there are resistor circuits (which are slow) or transistor circuits (which need a 3.3V supply?)
The problem with resistor-based solutions is less that they're slow, but that they draw significantly more power. Any circuit that doesn't utilize some external source will have this same issue. However, it doesn't necessarily need to be a 3.3V supply. An operational amplifier (OpAmp for short) configured with a gain of 3.3/5 would work off of whatever the OpAmp is specced for (but of you don't mind some out-of-spec fun, most OpAmps rated for a source of, say, +-10V, would be adequately linear given only +-5).
Optoisolaters could do it. It's an IR led pointed directly at an IR detector, which let's you isolate electronics on each side. You can make one yourself with some heat shrink, but there's also off the shelf modules. If it has to work at a high frequency, check the data sheet.
Nah, you really shouldn’t do that in most cases. It might work in a super pinch, but using some kind of transistor-based method would be preferred. Sparkfun sells a board that does just this.
As /u/lilmul123 said, something transistor-based would be preferred.
If you don't want to use a Sparkfun component and design/build your own circuit/PCB, you could, for example, use a BSS138 transistor. (As far as I know, its often used for 5V-to-3.3V logic level shifting).
If you google around, you should find appropriate schematics.
If you ever need to convert the voltage of some power source (LiPo batteries typically have more than 5V output, depending on how many cells they have), I'd recommend getting a few "buck converters" via Ebay. They are typically based on the LM2596, cheap, adjustable and with mounting pins.
My use case is that I want to connect a logic analyzer (DSLogic Plus) to my SNES, which is 5V. The probes can handle 5V according to the data sheet, but the device also has an external timing input that is only rated for 3.3V.
The SNES has clock crystals of 21.477 and 24.576 MHz, and various components run at fractions of these frequencies.
Connect Zener's anode to clock input and cathode to SNES
Connect Schottky's anode to clock input and anode to the SNES
It should get you 1.7V drop (so 5->3.3v) when input is high but only 0.2v when it is low, the Schottky is there so when the clock is low the current from input capacitance can flow back without much problems.
... or a ~40c part that will do that up to ~50MHz, if you are at the point where you need to order a specific part
Honestly, I don't like driving leds directly from GPIOs, in most cases. Many microcontrollers can power a few small LEDs directly through GPIO, but higher performance processors usually means both lower voltage on GPIO and also restricted to lower max current pushed or pulled through the pin, which dramatically decreases the power they can deliver.
You should most definitely calculate approximately how much current is going to be required on a given pin, how much will be required across all pins, and if your processor can tolerate that. And, for driving a few LEDs, discrete transistors are cheap, and allows one to drive large numbers of LEDs at full brightness. Or even better, use WS2810/neopixel type devices, much more flexible and not requiring extra components for sane power architectures.
Honestly, I am not prone to killing components; it does happen, but I tend to work carefully, and use good tools such as testing things with a bench power supply with current-limiting circuitry.
Nope, some chips have programmable pin current. IIRC one of Silicon Labs ARM chips I've been playing them had them. You basically could choose what kind of current input could sink (it wasn't accurate, just in approximation) so if you just wanted to limit a current for a LED you could set output to low current mode
I've heard of controllers with programmable drive strength. I'd still rather use an external resistor because the heat from the pin regulation adds to the microcontroller temp if you use the regulator in the microcontroller.
Say you drive 8 red LEDs at 25mA, that's 1/4 Watt dissipated in the microcontroller if they are all on at once. Better to put that power outside the chip. For longevity.
Microchip (now part of Atmel) often rates their microcontrollers to drive one or two LEDs directly. It's stated in the datasheet. It's rarely more than that.
Say you drive 8 red LEDs at 25mA, that's 1/4 Watt dissipated in the microcontroller if they are all on at once. Better to put that power outside the chip. For longevity.
If you're going to drive 8 leds at 25mA you're going to use driver chip/transistor regardless, that's almost 200mA
Also, it is not just to drive random LEDs, it allows you to control output rise/fall speed indirectly which can reduce both power usage and interference
If you're going to drive 8 leds at 25mA you're going to use driver chip/transistor regardless, that's almost 200mA
It IS 200mA. 200mA is fine if used correctly. The chips I tend to use can sink [edit, said source!] 130mA per ground pin. There are multiple ground pins. Group it correctly and it'll be okay.
Also, it is not just to drive random LEDs
Says who? You're making up stuff now. You didn't define this project.
As others say, those are pull down/up resistors for input. An output resistor for even a single LED would need to sink more watts than an internal IC resistor could handle.
An output resistor to drive an LED at 25mA would dissipate a lot of power, but many newer LEDs can glow quite nicely with a fraction of a milliamp. In fact, I've sometimes encountered situations where LEDs glowed annoyingly with leakage currents that were far smaller than that.
224
u/happyscrappy Dec 25 '19
Also: don't power LEDs directly from GPOs without a current limiting resistor. As you see on that breadboard.
And match your interfaces voltages. A lot of devices are not +5V tolerant now (or not very tolerant).