Changes between Version 1 and Version 2 of ControlSystems/Electrical/Training/FallTraining/ProjectThree


Ignore:
Timestamp:
Jan 9, 2021, 3:31:40 PM (4 years ago)
Author:
Ryan Nguyen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/Electrical/Training/FallTraining/ProjectThree

    v1 v2  
    99a. This project can be done on both TinkerCAD and with the real Arduino kit.\\
    1010
     11[[Image()]]
    1112
    1213b. Let's start with a resistor that is between 370 and 500 ohms. You can use a resistor chart online (or from the previous projects) to find the ohms of real life resistors. In TinkerCAD, you can just type in the numbers with the correct units.\\
     
    3536a. Alternatively, you can use code to power the LED whenever the push button is pressed, and this way will also teach you about pull down resistors.\\
    3637
    37 
     38[[Image()]]
    3839               
    3940b. We’re going to start off with a resistor, that is around 370-500 ohms of resistance. Again, use a resistor chart if you are using a real resistor. If you are using TinkerCAD, just type in the number with the correct units.\\
     
    8889}\\
    8990
    90 Explanation of how it works
    91 The pushbutton when left open, will leave the terminal pins that are connected to GND, and the digital pin, connected to each other. So, there is only one path between the digital pin and the GND.
    92 The 5v is left alone on the other side of the push button, so no current is flowing through.
    93 This makes the digital pin not have any power going to it, so it has a “Low” state, telling the Arduino that the digital pin receives no power. We can use this information in our code to know when to turn on the LED or not.
    94 Now, when the pushbutton is pressed, it allows the 5v to flow, but to which terminal does the electricity flow to?
    95 Electricity takes the path of least resistance, and since the path that connects to the digital pin is only a wire, it has no resistance (theoretically), so the electricity flows to the digital pin, making it have a “high” state. On the other hand, the path with the resistor has a lot of resistance in comparison to the path without a resistor, so no electricity flows through there.
    96 Code can be used to turn on the LED connected to digital pin 13 when power comes into digital pin 2 when the push button is pressed.
    97 The resistor serves as a barrier, herding the electrons away from the GND pin, and into the digital pin, so that we know when the push button was pressed.
    98 You might be asking, why can’t we just put the digital pin on 1 side of the push button, and the 5v on the other, and when the push button is pressed, the digital pin gets power?
    99 If we were to do that, the digital pin will turn on and off randomly even when the push button is left alone. The reason why is because there are a lot of waves of energy happening in the environment, like radio waves, infrared waves, etc, which can enter the push button and give power to the digital pin. We solve this by connecting the wire from the digital pin to GND, and add a resistor connected to GND so that when the push button is pressed, the 5v won’t just travel to GND and totally ignore the digital pin.
     91
     92== Explanation of how it works\\
     93
     94a. The pushbutton when left open, will leave the terminal pins that are connected to GND, and the digital pin, connected to each other. So, there is only one path between the digital pin and the GND.\\
     95
     96b. The 5v is left alone on the other side of the push button, so no current is flowing through.\\
     97
     98c. This makes the digital pin not have any power going to it, so it has a “Low” state, telling the Arduino that the digital pin receives no power. We can use this information in our code to know when to turn on the LED or not.\\
     99
     100d. Now, when the pushbutton is pressed, it allows the 5v to flow, but to which terminal does the electricity flow to?\\
     101
     102e. Electricity takes the path of least resistance, and since the path that connects to the digital pin is only a wire, it has no resistance (theoretically), so the electricity flows to the digital pin, making it have a “high” state. On the other hand, the path with the resistor has a lot of resistance in comparison to the path without a resistor, so no electricity flows through there.\\
     103
     104f. Code can be used to turn on the LED connected to digital pin 13 when power comes into digital pin 2 when the push button is pressed.\\
     105
     106g. The resistor serves as a barrier, herding the electrons away from the GND pin, and into the digital pin, so that we know when the push button was pressed.\\
     107
     108h. You might be asking, why can’t we just put the digital pin on 1 side of the push button, and the 5v on the other, and when the push button is pressed, the digital pin gets power?\\
     109
     110i. If we were to do that, the digital pin will turn on and off randomly even when the push button is left alone. The reason why is because there are a lot of waves of energy happening in the environment, like radio waves, infrared waves, etc, which can enter the push button and give power to the digital pin. We solve this by connecting the wire from the digital pin to GND, and add a resistor connected to GND so that when the push button is pressed, the 5v won’t just travel to GND and totally ignore the digital pin.