Editing LED

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 8: Line 8:
 
A LED typically requires a resistor that is in series with the LED to restrict the current that is flowing through the LED.
 
A LED typically requires a resistor that is in series with the LED to restrict the current that is flowing through the LED.
  
For sketching we can just use the following values (see [[#Background]] for more details):
+
For an LED we are interested in the following parameters:
 +
* the forward voltage (typically about 2V)
 +
* the forward current (typically about 20mA = 0,02A)
 +
 
 +
We use the equations R=U/I and U=U1+U2 to calculate the resistor required.
 +
 
 +
[[Led04.JPG]]
 +
 
 +
For sketching a shortcut we can also just use the following values:
 
* 100 Ohm for a controller with 3.3V (our ESP32/ESP8266)
 
* 100 Ohm for a controller with 3.3V (our ESP32/ESP8266)
 
* 150 Ohm, 200 Ohm or 330 Ohm for a controller with 5V
 
* 150 Ohm, 200 Ohm or 330 Ohm for a controller with 5V
Line 14: Line 22:
 
= How to connect it electrically =
 
= How to connect it electrically =
 
This is how to connect an LED to a power supply. It does not matter where the resistor goes. But if the direction of the LED is wrong, it will not light up.
 
This is how to connect an LED to a power supply. It does not matter where the resistor goes. But if the direction of the LED is wrong, it will not light up.
 +
[[File:Led00.JPG|300px]]
  
[[File:Led00.PNG|300px]]
+
LED will be on if Pin is 3.3V (or ON or High)
 
 
 
 
LED will be on if Pin26 is 3.3V (or ON or High)
 
  
 
[[File:Led02.PNG|300px]]
 
[[File:Led02.PNG|300px]]
  
  
LED will be on if Pin26 is 0V (or OFF or Low)
+
LED will be on if Pin is 0V (or OFF or Low)
  
 
[[File:Led03.PNG|300px]]
 
[[File:Led03.PNG|300px]]
Line 54: Line 60:
 
       sleep(0.5)
 
       sleep(0.5)
 
</syntaxhighlight>
 
</syntaxhighlight>
 
The setup to try the program:
 
 
[[File:Exampleled.PNG|303px]]  [[File:Exampleled1.JPG|200px]]
 
  
 
= Related Tutorial Videos =
 
= Related Tutorial Videos =
 
<youtube>0KGgYsEZcZM</youtube>
 
<youtube>0KGgYsEZcZM</youtube>
 
= Background =
 
For an LED we are interested in the following parameters:
 
* the forward voltage (typically about 2V)
 
* the forward current (typically about 20mA = 0,02A)
 
 
We use the equations R=U/I and U=U1+U2 to calculate the resistor required.
 
 
[[File:Led04.JPG|500px]]
 

Please note that all contributions to Sketching with Hardware at LMU Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see My wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)