Teaching Arduino (or any Coding) Without a Full CS Course

Editor's note: We're excited to bring you this series of guest posts from Shane Diller. Read on to learn more about Shane and how he uses electronics in schools.

Hey guys! I hope you enjoyed my last post, and got some good creativity and inspiration going!

This post is dedicated to sharing some of the resources I’ve developed for tackling coding in my classroom and at my school. If you’ve read either of my last two posts, you know that I prefer not to call it teaching, and instead think of myself as a project manager. These resources will very much reflect that. If you’re looking for a step-by-step worksheet or daily curriculum with times written out, you will only find disappointment this way. What you will find are some great resources to help you bring coding to your classroom. I’ll explain the big picture a bit more so that the resources make sense.

The Reasoning

In my course, I’m teaching students how to be entrepreneurial in spirit and learn both hard and soft skills to make their ideas a reality. Obviously I structure my course in such a way that students learn, then apply, then reflect, but I differentiate it in a way so that each student has a path. Think of it like a game; I’ll use World of Warcraft as a reference (only because everybody has heard of it, I’m not a fanboy, promise).

World of Warcraft

In World of Warcraft, each person gets access to a bunch of different skills and abilities to suit their style of play. It has many names but I call it a skill tree. In order to get the best ones, you have to start at the top and invest your time in learning basic ones (seems a lot like life, huh?). The choice of which skills to pursue, and how much you want to invest into them, is yours.

skills building in WOW

In most classrooms, we do something a little more like this – no choice, you must learn all content for the topic and demonstrate mastery of it.

Now, let me add a big ol’ disclaimer here (I can already hear a math teacher about to go full algebraic on me): Differentiation fits some classes better than others. I’m talking about differentiation just in teaching coding, for now. In my course, they can choose to learn Arduino, or choose to learn Web Development, or choose to learn Java, but the key is they decide what to learn based on what they think will serve them the best in developing prototypes for products. And, they might not go through the Arduino section in a very linear fashion. They don’t need to know how to use switch cases if they aren’t going to use them.

Would I love to teach a full, in-depth course about just Arduino? Absolutely. The turbo nerd in me constantly tries to pull my attention towards how fun and easy that would be. Forty hours of Arduino programming and they’d be a wiz at it. It would save me hours of grading. But what would they learn? What would they retain? Would they be turned off from it forever? I’ll draw your attention back to my first post where I said that, as coding educators, we are in the business of sales. Instead, I dedicate about five hours (or five class periods) to teaching the basics of Arduino. You may want to budget for eight. Yes, that means you may need to give up a unit or part of one. Or, alternatively, see below and just teach them what they need to make a project for your unit.

The Curriculum

Traditionally I use videos where I lead the students through three Arduino sketches and slowly decrease the amount of specific detail that I give them. I can share the videos if people are interested (let me know in the comments), but for now, look for the Google Slides below, including the key takeaways and level of support I give.

Sketch 00: Circuits and Downloading Arduino

I call this Sketch 00 because it doesn't require any coding, but downloading the Arduino IDE and understanding circuits are crucial for the rest of the steps. Key learnings:

  • Arduino is just a tool; the more you learn, the cooler the things you can build.
  • LEDs are great! And have a polarity, so be careful.
  • Basic circuit concepts (the key is connecting all things together)
  • Breadboards are what we use for prototyping, but are not final builds.

 

Sketch 01: Common Arduino Commands and Blinking an LED

Sketch 01 is where we start getting in to actual coding by learning to blink an LED. Key learnings:

  • Review: What is an LED? How does a breadboard work?
  • Setting up a circuit: Give students very specific places to plug wires and components in on the breadboard (i.e. “long leg of the LED to column E, row 15 and short leg to column E, row 14”).
  • Arduino has two main regions for the “business” - setup and loop.
  • Curly brackets contain all your code; be careful with these.
  • Semicolons are how you tell the computer you’re “done.”
  • All of the commands in there will be used over and over and over.

 

Sketch 02 - Spaceship Interface and Variables

Sketch 02 shows students how to create a light show that is triggered by pushing a button. Key learnings:

  • Review: LED polarity, digitalWrite, delay, pinMode, void setup and loop
  • How a button works and how it adds amazing opportunity
  • Why we use variables in code
  • Conditional logic - the true bread and butter of code

 

Sketch 02, Part B (Optional Extra Credit)

Sketch 02 - Part B is an optional section that students can complete for extra credit. In it, they are challenged to create a light loop inspired by a Battlestar Galactica character, the Cylon. Key takeaways:

  • Review: LED polarity, digitalWrite, if/else statements, variable declaration
  • Using loops to reduce coding
  • Making really cool LED effects and sequence uses for loops

 

Sketch 03 - Temperature Sensor and Serial Monitor

In Sketch 03, we start looking at how individual components work by learning about temperature sensors and serial monitors. Key takeaways:

  • Review: LED polarity, digitalWrite, if/else statements, variable declaration
  • Temperature sensor - why polarity is very important
  • analogRead and how it actually reads a voltage
  • Using the serial monitor to debug and check code

 

The Breakdown

Okay, you may be a bit confused right now. This part is optional if you feel comfortable with what you see in the slides, but I’ll give you some pointers and common pitfalls.

the troubleshooting slides (this example is from Sketch 01):

troubleshooting slides

Note: The troubleshooting parts are optional. They take time, but they also reinforce core concepts. Feel free to offer these as extra credit, especially if you know you have some students who may struggle with coding and any projects or homework. Notice that I also provide the correct code for students on this slide. I’ll explain more about that below.

Next come the challenges:

These challenges correspond to a rubric and push students to use what they learned.

First, notice that I ask students to upload the code that I provide them. Please ready your tomatoes, because I don’t teach blank-page coding (having to write it all yourself). I know that I’ve lost half of you now. It’s like I have the Infinity Gauntlet and snapped my fingers.

Shanos

Get it?! It’s Shanos

These posts and resources are about teaching Arduino on a time constraint. We all obviously learn better with blank-page coding, but that also requires a lot more time. Instead, I’m asking anybody I teach to learn how to read and analyze code to find what they’re looking for. Don’t make this homework if you are teaching all these sketches in person to the whole class. Students will end up at very different levels and throw off your guided learning.

Here is the rubric that I mentioned above. Notice that you are checking off students as they complete challenges. That means you can walk the room and offer some advice. I’d love to talk more about coding “technique,” but that will have to wait for later posts.

In the next post, I will share the next series of Arduino Sketch slides. If you need the slides in PowerPoint or pdf form, please feel free to reach out over Twitter (@rellidenahs) or find my email on my blog: tinkerthis.blog

Shane Diller is a biomedical engineer turned educator, all around turbo nerd and innovation geek. Shane is the Lead Technologist for the Bryan Innovation Lab at The Steward School in Richmond, VA. His favorite piece of hardware is the classic Arduino Uno due to the low price point and sheer variability. His favorite projects include any that can demonstrate high-level engineering concepts in an artistic and approachable way. He’s passionate about wearables, web development, human-centered design, prosthetics, mentoring and inspiring others, and sticky notes. Oh, and pictures of pugs in costumes.

Subscribe to SparkFun Education Blog

Recent Posts

Submit Your Idea