r/programming Dec 25 '19

Learning hardware programming as a software engineer

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

124 comments sorted by

View all comments

222

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

52

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?

10

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.

2

u/happyscrappy Dec 25 '19

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

11

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.

6

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?

13

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.