top of page
  • Writer's pictureAlan Seder

Arduino Maker Challenge - The First Week

Updated: Dec 8, 2020

Welcome to my latest adventure as I begin a new Educational Technology course - EDTEC 568 - Makerspaces. Each week for the next seven weeks I will be documenting a Makerspaces' Build Challenge. The first weeks challenge is to build a simple circuit that includes an LED and a resistor. This circuit is to be controlled by my Arduino UNO microprocessor that will be programmed to cause the LED to blink on for one second, then off for one second, then repeat until powered down. This sounds simple but it will definitely be informative as I play with the project to get a feel for electrical circuits, Arduino UNO hardware, and creating and uploading programs via the Arduino IDE.


To begin, we will take a look at the code I typed into the Arduino IDE shown below.

Blinking LED Code

Although I typed this into the Arduino IDE, with the exceptions of a flourish or two, I did not create it. I use the code to set the integer variable LED to 13 for the pin on the Arduino UNO board I wish to activate. Then, in the setup section, I coded for Arduino UNO to activate pin 13 to receive power output. Then, in the loop section, I coded for Arduino UNO to power up pin 13, wait 1000 milliseconds, then poser down pin 13, then wait 1000 milliseconds, and then repeat the loop. This code was then compiled in the Arduino IDE and uploaded to the Arduino UNO where the program initialized and began running.


Next, below is an image of my Arduino Uno and the breadboard with blinking LED circuit I built.


Note the black wire connects the ground on the Arduino UNO to the negative bus on the breadboard and the red wire connects the output from pin 13 to the positive bus on the breadboard. The 220-ohm resistor connects the positive bus to the LED and the yellow jumper connects the other side of the LED to the negative bus, completing a series circuit when power is output to pin 13. The circuit diagram for for this is shown below.


The following video shows the blinking LED project in action and describes the workings of the circuit and the code uploaded from the Arduino IDE.


Not to bore you with more videos, but if you would like to view the circuit play and code play I performed with this setup, you can find the videos at my YouTube Channel.


In thinking about where my head was when I started this project, all I could think was, "How can I get this done quickly?". Not that I did not like the idea of dusting off the Arduino Starter Kit that I bought three years ago, but more like, "How does a full time science teacher navigating the quadrupled level of work to do the basic job in the COVID Era find time to play?". Well once I got started, I realized my mind needed play now more than ever. If you watch my "play" videos, you will see that I tried to put myself in a naive frame of mind and verbalize what would be surprising or even frustrating if it was the first time I did something like this. Then, I progressed to there really is some interesting things about the nuances and formality of coding that that are both curious and, in the long run, good to know. I suspect next time there will be less self recriminations about the time escaping me, and more let's get to play and enjoy the moment.


Upon reflection, yes I picked up some unknown or vaguely remembered aspects of building circuits and coding; but, more importantly, I got back in touch with what it feels like to take time to play. I also got to feel what it is like to have something not work and have to troubleshoot and debug. Although how I could end up with the one-in-so-many-millions of LED's that are defective during my Extension Challenge, I have no idea. (By the way, my Extension Challenge is apparently a great way to test for defective LED's.) Sure, I have lots of ideas about the traps my students will fall into when doing Arduino projects; but, I won't help them avoid these traps. (As I tell my students each year, I remember many problems I solved in high school, but only the one's I could not figure out at first.) Most importantly I learned that, if a tired and, let's face it, somewhat jaded old man like me can grin while he shows his wife his completed Extension Challenge, then imagine the feeling a high school student making his first successful build will have.


For my Extension Challenge, I created twelve LED circuits operated through pins 2 through 13 respectively as shown in the image below.



I coded two programs to operate the LED's in a chaser mode. One program is what I refer to as "brute-force" and the other as "more-elegant". Both perform identically, as you can see in the following video.


To see what I mean by "brute-force and "more-elegant" the code for both programs is below.


"More-Elegant" Code

"Brute-Force" Code

Of course, now that I have twelve LED circuits wired to a breadboard, there are considerable degrees of freedom to code programs with all kinds of LED pattern effects! Imagine what will be blinking on the mantle during the Holidays after my granddaughter and I get some programing time together!





.



92 views0 comments

Comments


Post: Blog2_Post
bottom of page