Digital Input/Output, or “Is that a burning smell?”


After successfully constructing unobstructed pathways for happy little electrons in the previous lab, Katy, Erin, Jojo and I undertook to complete the Digital I/O lab.

I actually started doing this lab a few hours earlier without realizing it. I was so excited to play around with the Arduino that I took it out of its packaging, downloaded the IDE, and introduced it to my laptop. Here they are, befriending one another:

The moment when the little blinky lights come on is so… deeply gratifying. Maybe this is just me.

When I started the lab in earnest, there were more ingredients to gather:

The entire group got a little stuck on selecting which resistor to use. We vaguely recalled hearing in class that the little colored bands don’t matter, but further investigation revealed that they in fact do. They indicate the resistance (Ohms), so in order to find the 10K Ohm one, we referenced various web sources to decode the colored bands.  (10K = red red brown gold)

Next, I used the IDE to upload the blinking LED code to Arduino. I typed in the code from the book, and despite having some experience with the cantankerousness of programming, I accidentally switched the ,’s with .’s.Typos are always just around the corner with this sort of thing. After the code compiled and uploaded, the LED started to blink on and off at 1-second intervals.

Here is a (yet again oddly immensely gratifying) video of the blinking LED in action:

Arduino Blinking LED from Tina Ye on Vimeo.

That was easy enough. Next, I used the diagram on page 43 of Getting Started with Arduino to hook up the switch, wires, resistors, and Arduino as follows:

At this point, I began to get the distinct feeling that the Arduino mini-book was leaving a lot of important information out. After all, we were making a circuit based off of a hand-rendered drawing and hardly any accompanying text. I realized later that it would have been a good idea to read the other Physical Computing book first, because it would have at least explained the component parts and what their functions were. (For example, only later did I find out that resistors get hot when they are… well, resisting, and that you shouldn’t touch them.) And I still don’t know what all the little pins and their labels mean. But I hope we will find out later, because that burning smell wasn’t so good.

For the next program, I was falling behind a bit so I just copied it from the website and pasted it into the IDE. Compile, upload, and voila!

Arduino Button & LED Light from Tina Ye on Vimeo.

The next 2 programs (which changed the behavior of the button to toggling the LED light on/off) demonstrated the concept of “bouncing,” or little static blips of electricity that can confuse Arduino into thinking there is a connection when in fact the metal plates of the button (or switch) haven’t fully made contact yet. The first program did not include a delay in the code, which allowed bouncing to affect the program’s ability to detect full contact. The second program was much better in that a tiny imperceptible delay allowed the button to count as “pressed” only after being fully pressed. Here is a video of the refined program with delay:

Arduino LED Light Toggle from Tina Ye on Vimeo.

The final part of this lab was to create a custom switch from found objects. Katy gave me a burst of inspiration by bringing a pushpin to the table. So my final switch idea consists of a pushpin and a metal “bulletin board.” My metal bulletin board ended up being a piece of aluminum foil. I also reloaded the first button program into the Arduino, so that the LED would light up when the button was “pressed,” rather than toggling back and forth.

To create the switch, essentially I had to solder two wires to the metal parts of both foil and pushpin. This was easier said than done.

When soldering the foil to the wire, I learned that thin aluminum foil does NOT hold enough heat to bond with the flux. I kept getting blobs of flux on the wire only. After folding the aluminum foil over and over until it resembled a thick pillow, I finally managed to get the flux to flow onto the foil. However, the delicate foil proceeded to tear right where the wire was connected! I gave up, and used a piece of tape to hold the tear closed. I used the multimeter to perform a continuity test on the end of the wire and the foil, and thankfully the tape was enough to create a “join.” There was a loud beep, indicating full contact.

I thought soldering wire to the relatively thick metal head of the pushpin would be a lot easier, but no such luck. Apparently flux only works well when the 2 elements being heated are more or less equally hot, and the metal part of the pin also did not hold heat as well as the wire. However after persistent trying, I managed to get the two to bond.

Thank God for those helping hands. Here are the 2 finished “halves” of the switch:

… which I plugged into the breadboard, replacing the 2 prongs of the button before it.

And, as expected, pushing the pushpin into the metal “pillow” of foil creates a connection for electrons to flow, and the LED lights up!