Week 2 Labs: Digital Input and Output with an Arduino, and Analog In with an Arduino

I started with the digital input and output lab. Before I wired anything up, I wanted to understand how the circuit worked. My first question was: Why did the push-button’s output need to be split, with one end going to the Arduino and the other to ground (via a resistor)? Why not send it directly to the Arduino and skip ground altogether?

I did a bit more reading, and figured out that it’s a “pull-down” resistor. If the button isn’t being pushed (i.e. it’s disconnected from the power source), the voltage read by the Arduino should be low. The connection to ground “pulls” the signal down to a predictable low value. The resistor prevents a short circuit. This lead me to my next question: why isn’t the connection to the input pin a short-circuit? There’s no resistor there.

I learned that when configured as inputs, Arduino’s digital pins can receive a signal in a high-impedance state that permits very little current. Therefore, no resistor is needed to protect it against short-circuits.

Feeling satisfied, I set up the circuit. I didn’t run into any problems, and it worked! See video:

I moved on to the analog input lab. After setting up the circuit, I had a problem with the potentiometer. Even when left alone, its output oscillated rapidly. This caused the light to flicker, and turning the potentiometer only made it flicker…differently. But, when I swapped it out for one of the larger potentiometers in our kit, it worked! See video:

    Leave a Reply

    Your email address will not be published. Required fields are marked *