I really mean no offense, but for the love of electrons, please stop saying things like: "Amps are measured in amperes". Current is measured in Amperes. It is like being a cook and instead of saying you need one cup of water, you ask for one cup of one cup. You would not do that. Ergo, your title should read Voltage, Current, Resistance and LEDs.
First, don't buy electronics from Amazon (or anything from Amazon really) buy from a reputable source like Digikey or Mouser.
Second, please don't try to explain electricity if you don't know what you're talking about. There are enough misconceptions about electricity (see amasci links above) without adding more noise and half-baked understanding.
Mouser, Digikey are great but, wow, the cost of shipping and time to get parts delivered is painful. For the hobbyist that just wants a shift register to play with their Arduino they're a tough sell.
Maybe SparkFun or Adafruit are better recommendations?
The disdain for casual hobbyists you show here implies that you are probably not the target audience for the article, which is targeted even lower than hobbyists: people who need an early introduction. Professionals have very different needs than hobbyists and therefore need different materials and suppliers.
Eh true. And it's not disdain, those companies are great for what they do. The guy above just implied they sucked, which isn't the case. They're great for their target market
I actually disagree with you completely. (And I'm a professional, this is my day job.) For breadboarding I buy from Adafruit and Sparkfun, since they have good selections of breakout boards, MSOP to DIP adapters, etc. DK and Mouser have plenty of that, and some really nice stuff (like TI's adapter "EVMs")... but for prototyping on a breadboard, I start with the other guys.
(Then usually tack them on to a Digi-Key or Mouser order, because if it doesn't require something weird, I probably didn't need to prototype it.)
For people like me who can't remember all 100k acronyms: "GIGO" is "Garbage In, Garbage Out".
I agree with the sentiment though - a lot of stuff on Amazon are not exactly what is written on the tin, and so when you read official spec of a component you may get stuff that's way off - noisy opamps, that sort of thing.
Most of the stuff I buy is just $RANDOMNAME_MADEUP_BYIMPORTER that was produced to hit the lowest cost point on amazon, and which will work fine in nearly every case I subject it to. For example, my BOJACK 50 values 1350 Pcs Resistor Kit. Do you want me to go measure a sampling of those and compare it to the equivalent kit (or pages of components) from DigiKey?
Not sure about the counterfit, the PSU I just got is from ARESGAME which appears to be a California company, and from every detail of the product, it appears to be legitimate. I just popped it in my main desktop computer (cyberpunk 2077 was crashing/windows rebooting when I hit 400W). I fully expect this device to work as expected for the next 10 years I will operate this machine. Same for the $1K Dell monitor I just bought. This thing was obviously made for dell and sold by dell with top grade components.
A small fraction of the stuff with $RANDOMNAME I've bought on amazon has been total and complete crap, but once should probably be suspicious any time something is sold for 1/10th its ostensible manufacturing cost.
Professional here: I hate Amazon and die a little inside every time I hear about people buying electronic parts from them.
So I am not trying to push an agenda when I say that they're fine for generic parts. You are probably not going to cry if your 0.25W resistor smokes itself at 0.2W instead of 0.3W like the name-brand part. Your random 1N4007 is probably still a 1N4007; it's not like they're hard to make. I wouldn't use it on a 999V line, but I probably wouldn't do that with a genuine 1N4007 either.
Where Amazon starts to get dodgy is when you are dealing with delicate parts: precision amplifiers, precision resistors... really, precision anything... or anything where you will need more of that exact thing in the future. You'll get something when you order from Amazon or AliExpress. It might even be the right something. But good luck getting it again later!
OK. This is a reasonable answer; Amazon is good for 95% of the market and you shouldn't attempt to use it to fulfill the remaining 5%. That's correct: I use digikey or mouser to order precision and power resistors (for the 5% of the time I need either of those instead of a generic cheapie). I use mcmaster for some parts that amazon doesn't stock (or what they stock looks dodgy).
But over the years "what is precision" has changed. For example, I can buy micrometer stage on Amazon for $100 that is as accurate as the $10000 stage from 10 years ago.
Also, I think most electronics parts are engineered with 3X so I wouyld expect my 0.25W resistor from amazon to smoke itself at 0.75W and the one from digikey at 1W.
I see - the author stood behind you and forced you to not only click on the article, but this hacker news thread and also forced you to comment too. Yes, that is horrible!
I'd add the MIT 6.002 Circuits and Electronics course available on Youtube. It's been immensely helpful for me starting experiments with Raspberry PI GPIO.
Why the hate on Amazon? I can understand why you may want to discourage shopping from Amazon in general but is there a reason why they are particularly bad for electronics?
As a hobbyist (with an EEE background) I seldom have an order that is large enough to make the mouser/digikey shipping costs palatable. If I need something quick (forgot a particular component) then Amazon often works great, although the 'free' shipping means everything is going to be at least $10.
If you area business then Mouser etc are the place to go, but you'll also have a business account with friendlier credit and shipping terms.
For hobbyists it is really difficult to beat Aliexpress. Long shipping times but you can order a whole slew of components and stock up on things you might want to try out in the future. Yes you have to pick through potential counterfeits and you may get the odd broken board/component but I'm not sure that is very different from mouser, digikey, spark fun etc?
I definitely think there's a significantly higher quality guarantee with Mouser, Digikey, SparkFun, etc. than there is with Amazon/ AliExpress. But hey, like you said for hobbyist use it might just be good enough and the cost savings can't be beat.
As a beginner though, you might bang your head for hours over a non-functional circuit just because a cheapo component isn't doing what it should. Once you gain confidence it can be a bonus challenge to write a driver for some poorly documented knockoff component :p
That's a good point. You definitely have to dig a little deeper on Aliexpress, my experience has been that AliExpress components/boards generally work fine but you have to dig for things like data sheets unless its a very standard part - which may be an extra friction point for a beginner.
I tried to read your links above. The first spends over 80% of the article telling everyone how stupid they are and then presents 5 different definitions of "electricity" and then ANOTHER rant about how they are all wrong and finally a list of other articles about various related concepts. If I were a trained EE I would be turned off by the unnecessary ranting. As a grade school level hobbyist I have learned nothing that will help me connect some batteries and LEDs in a useful way.
Same thing for Digikey and Mouser. I've tried to use them to buy a educational kit, set of parts for screwing around with on my desk. Can't figure it out. Here is what i get looking for "kits" at digikey (https://www.digikey.com/en/products/filter/miscellaneous/657).
Amazon has sadly replaced Radio Shack in this space. I have half a dozen FUN kits on my shelf I ordered there from a coin cell battery "toothbrush" robot up to one with bluetooth, USB, ultrasonic, "AI" cameras and all the other fun bit. I even have a SMD solder practice board that cost me 5 dollars and after stressing like mad that I needed to buy some special solder, flux, iron etc I decided I'd give me old butane powered iron and the "High-tech Silver-bearing" solid I got 20 years ago from RS a try and use my cellphone as a microscope. Works fine. 49 of 50 0603 resistors tested fine on the first try.
It's tempting for folks with lots of experience and understanding to look down on beginners or fear they will miss some deep understanding if they learn the wrong metaphors or tools early on. Its fine, my daughter at age 5 thought variables where 'bags' that could hold numbers or letters (some of them only worked with one thing or the other). It doesn't describe the memory model of a modern computer correctly at all but it works well enough that she can write some games for herself a few years later. If she continues to have an interest she can go read "data sheets".
I do this professionally, and his description is exactly how we do it, except I have a $400 Fluke meter. A bit of testing and basic arithmetic, some searching on Amazon, and I have some LEDs and resistors next day. Because 64 volt electronics are hard to come by.
Fun fact: When you accelerate an electron across a potential of 4.5 volts, and then stop it suddenly, you get a photon with 4.5 electron volts of energy. That’s why different colors have different voltage drops.
So a blue LED has about a 4.5 volt voltage drop, and a red LED has about a 2.2 volt drop. And a blue photon has about 4.5 electron volts of energy, at a wavelength of around 350nm, and a red photon has about 2.2 electron volts, at a wavelength of about 600nm.
Expanding on that a bit, generally, the shorter the wavelength the higher the voltage drop. So UV leds have the the highest, followed by violet, blue, green, yellow, orange, red, then infrared. Then white being a special case since it's typically 3 leds (r/g/b) and not one.
> Fun fact: When you accelerate an electron across a potential of 4.5 volts, and then stop it suddenly, you get a photon with 4.5 electron volts of energy. That’s why different colors have different voltage drops.
This explanation does violence to conservation of momentum, since \hbar / \lambda is miniscule for the photon compared to the electron. The correct explanation involves recombination with a hole across the bandgap, which is how momentum is conserved in the interaction, and the motion of the electron is not involved other than transport for electrons to find holes for recombining.
It might be a good idea to talk about PWM in the article, since so many devices drive LEDs with PWM. With PWM, you typically run higher current than the 20ma mentioned in the article...just not continuously.
a lot of electronics tutorials start with resistors and capacitors and have you build RC circuits and measure their decay, but I found that a diode-first class makes a lot more sense.
Once I discovered constant current controllers, I started to have real fun with LEDs. Sure, you can use a resistor to drop voltage but that's just spewing heat. Switched Constant current controllers are much more elegant not very hot at all and have excellent control over intensity.
These days I typically run LEDs at half their rated current; they are still plenty bright and run FAR cooler than max current.
Any linear driver will have equal efficiency to any other, and PWM just changes the overall on-time, not the efficiency during that time. So a simple resistor, if you can live with its variability in the application, can be used just as effectively as a fancy trimmed current source. They're even relatively similar in difficulty to PWM a single output, though current sources will usually win for multiple equal outputs.
> I typically run LEDs at half their rated current
Half? I start at 500uA these days, or 1/10th to 1/40th of "rating", and have been known to go down as low as 50uA, with a series resistance of 100k! Modern LEDs, especially the 0402 white ones, are amazing.
I'm sorry, I should have pointed out that I work with LEDs that are about 1000-1000000 stronger than you, so power dissipation from a linear regulator is significant.
One thing to note that LEDs do not really have constant voltage drop across them, i.e. they very much are not ideal diodes. Typically LED datasheets have two curves that are of interest: current vs voltage curve (IV curve, typically roughly exponential) and light output vs current curve.
Fixed voltage drop on an LED is too much of a simplification for this application. A better mental model is to imagine a piecewise linear approximation of current–voltage characteristic aka I–V curve.
I-V curve of a resistor is a straight line that goes through (0,0) point, with slope inversely proportional to resistance. The curve for LED has a bend somewhere between 1.5V and 2V, where its slope changes from low to high.
And yet it is exactly how many hobbyists approach the topic, and quite successfully. Not that he does hint at these curves when he talks about how running it at lower current will make it less bright.
My problem with the way the topic is being presented here is not just that the mental model is too simple, but that it is so much simplified that it becomes internally inconsistent.
Resistance is voltage over current, here's LED, it does not have resistance. Or maybe it has more than one resistance, depending on voltage.
Battery is a voltage source, wait, no it's not, it has internal resistance.
This article's explanation of a rectifier is incorrect. Most rectifiers used in real products are full bridge rectifiers which use both the positive and negative part of A/C.
47 comments
[ 3.3 ms ] story [ 48.4 ms ] threadBefore I rant off, let me link to a good resource for learning about electricity: http://amasci.com/miscon/whatis.html -or- http://amasci.com/miscon/elect.html
First, don't buy electronics from Amazon (or anything from Amazon really) buy from a reputable source like Digikey or Mouser.
Second, please don't try to explain electricity if you don't know what you're talking about. There are enough misconceptions about electricity (see amasci links above) without adding more noise and half-baked understanding.
Maybe SparkFun or Adafruit are better recommendations?
(Then usually tack them on to a Digi-Key or Mouser order, because if it doesn't require something weird, I probably didn't need to prototype it.)
http://www.compatt.com/Tutorials/NEETS/NEETS.html
Maybe that doesn't matter to some people, but it guarantees GIGO.
I agree with the sentiment though - a lot of stuff on Amazon are not exactly what is written on the tin, and so when you read official spec of a component you may get stuff that's way off - noisy opamps, that sort of thing.
Not sure about the counterfit, the PSU I just got is from ARESGAME which appears to be a California company, and from every detail of the product, it appears to be legitimate. I just popped it in my main desktop computer (cyberpunk 2077 was crashing/windows rebooting when I hit 400W). I fully expect this device to work as expected for the next 10 years I will operate this machine. Same for the $1K Dell monitor I just bought. This thing was obviously made for dell and sold by dell with top grade components.
A small fraction of the stuff with $RANDOMNAME I've bought on amazon has been total and complete crap, but once should probably be suspicious any time something is sold for 1/10th its ostensible manufacturing cost.
So I am not trying to push an agenda when I say that they're fine for generic parts. You are probably not going to cry if your 0.25W resistor smokes itself at 0.2W instead of 0.3W like the name-brand part. Your random 1N4007 is probably still a 1N4007; it's not like they're hard to make. I wouldn't use it on a 999V line, but I probably wouldn't do that with a genuine 1N4007 either.
Where Amazon starts to get dodgy is when you are dealing with delicate parts: precision amplifiers, precision resistors... really, precision anything... or anything where you will need more of that exact thing in the future. You'll get something when you order from Amazon or AliExpress. It might even be the right something. But good luck getting it again later!
But over the years "what is precision" has changed. For example, I can buy micrometer stage on Amazon for $100 that is as accurate as the $10000 stage from 10 years ago.
Also, I think most electronics parts are engineered with 3X so I wouyld expect my 0.25W resistor from amazon to smoke itself at 0.75W and the one from digikey at 1W.
Once you fix the mistakes, what's wrong with leaving it up?
As a hobbyist (with an EEE background) I seldom have an order that is large enough to make the mouser/digikey shipping costs palatable. If I need something quick (forgot a particular component) then Amazon often works great, although the 'free' shipping means everything is going to be at least $10. If you area business then Mouser etc are the place to go, but you'll also have a business account with friendlier credit and shipping terms.
For hobbyists it is really difficult to beat Aliexpress. Long shipping times but you can order a whole slew of components and stock up on things you might want to try out in the future. Yes you have to pick through potential counterfeits and you may get the odd broken board/component but I'm not sure that is very different from mouser, digikey, spark fun etc?
As a beginner though, you might bang your head for hours over a non-functional circuit just because a cheapo component isn't doing what it should. Once you gain confidence it can be a bonus challenge to write a driver for some poorly documented knockoff component :p
Same thing for Digikey and Mouser. I've tried to use them to buy a educational kit, set of parts for screwing around with on my desk. Can't figure it out. Here is what i get looking for "kits" at digikey (https://www.digikey.com/en/products/filter/miscellaneous/657).
Amazon has sadly replaced Radio Shack in this space. I have half a dozen FUN kits on my shelf I ordered there from a coin cell battery "toothbrush" robot up to one with bluetooth, USB, ultrasonic, "AI" cameras and all the other fun bit. I even have a SMD solder practice board that cost me 5 dollars and after stressing like mad that I needed to buy some special solder, flux, iron etc I decided I'd give me old butane powered iron and the "High-tech Silver-bearing" solid I got 20 years ago from RS a try and use my cellphone as a microscope. Works fine. 49 of 50 0603 resistors tested fine on the first try.
It's tempting for folks with lots of experience and understanding to look down on beginners or fear they will miss some deep understanding if they learn the wrong metaphors or tools early on. Its fine, my daughter at age 5 thought variables where 'bags' that could hold numbers or letters (some of them only worked with one thing or the other). It doesn't describe the memory model of a modern computer correctly at all but it works well enough that she can write some games for herself a few years later. If she continues to have an interest she can go read "data sheets".
So a blue LED has about a 4.5 volt voltage drop, and a red LED has about a 2.2 volt drop. And a blue photon has about 4.5 electron volts of energy, at a wavelength of around 350nm, and a red photon has about 2.2 electron volts, at a wavelength of about 600nm.
(I had just assumed it was a characteristic of the physical materials needed to obtain the various colors.)
This explanation does violence to conservation of momentum, since \hbar / \lambda is miniscule for the photon compared to the electron. The correct explanation involves recombination with a hole across the bandgap, which is how momentum is conserved in the interaction, and the motion of the electron is not involved other than transport for electrons to find holes for recombining.
Once I discovered constant current controllers, I started to have real fun with LEDs. Sure, you can use a resistor to drop voltage but that's just spewing heat. Switched Constant current controllers are much more elegant not very hot at all and have excellent control over intensity.
These days I typically run LEDs at half their rated current; they are still plenty bright and run FAR cooler than max current.
Any linear driver will have equal efficiency to any other, and PWM just changes the overall on-time, not the efficiency during that time. So a simple resistor, if you can live with its variability in the application, can be used just as effectively as a fancy trimmed current source. They're even relatively similar in difficulty to PWM a single output, though current sources will usually win for multiple equal outputs.
> I typically run LEDs at half their rated current
Half? I start at 500uA these days, or 1/10th to 1/40th of "rating", and have been known to go down as low as 50uA, with a series resistance of 100k! Modern LEDs, especially the 0402 white ones, are amazing.
For example here's what I work with: https://www.amazon.com/MARSWALLED-Daylight-DC36V-38V-Spotlig... and https://www.amazon.com/MEAN-WELL-HLG-150H-36A-Single-Switchi...
I-V curve of a resistor is a straight line that goes through (0,0) point, with slope inversely proportional to resistance. The curve for LED has a bend somewhere between 1.5V and 2V, where its slope changes from low to high.
Resistance is voltage over current, here's LED, it does not have resistance. Or maybe it has more than one resistance, depending on voltage.
Battery is a voltage source, wait, no it's not, it has internal resistance.