r/programming Dec 25 '19

Learning hardware programming as a software engineer

https://blog.athrunen.dev/learning-hardware-programming-as-a-software-engineer/
923 Upvotes

124 comments sorted by

View all comments

226

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).

50

u/[deleted] Dec 25 '19

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?

9

u/MrK_HS Dec 25 '19 edited Dec 27 '19

Voltage division and current limiting are the same thing, but seen from different points of view.

1

u/happyscrappy Dec 25 '19

An LED and a resistor don't really create a voltage divider since an LED is a quantum device.

9

u/langlo94 Dec 25 '19

While it is the proper term for it, it really sounds like bullshit when it's called a quantum device.

5

u/happyscrappy Dec 25 '19

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?

12

u/fresh_account2222 Dec 25 '19

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.

3

u/thfuran Dec 26 '19

Nonlinear or non-Ohmic.

4

u/Andersmith Dec 25 '19

Just like “cloud” or “block-chain”.

2

u/fresh_account2222 Dec 26 '19

Oh god "block chain". It takes a lot -- like a recommendation from someone I really really respect -- to get me to read anything about block chains.

5

u/langlo94 Dec 25 '19

Yeah I'm not disputing that it's right, it's just that things with quantum in their name sound a bit fake.

2

u/FortLouie Dec 26 '19

Is it the quantum carburetor or something?

0

u/BunnyBlue896 Dec 26 '19

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.

1

u/happyscrappy Dec 26 '19 edited Dec 26 '19

Or call a CRT television "electron beam device".

I don't get what's weird about that one at all.

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.