Monday, July 20, 2015

Teaching Arduino to a 14-Year Old

Teaching enthusiastic students is my greatest joy. I just spent four days teaching a very bright young man, my nephew Ethan Read, Arduino programming.

Ethan had a basic understanding of electricity, and had done some very simple programming with the Lego Mindstorms system.  The Lego system teaches the basics. It is less fun because  it is less real than the Arduino and true electronics.

We began by making LEDs blink.  It's simple. Ridiculous, almost. But it charms us because we can do something basic to being a human being: we can build a working machine. Ethan immediately began changing the speed of the blinking lights, which of course if the first principle of programming: debugging by being able to change the program.

The Arduino Experimenter's Kit (ARDX) is a great teaching tool for this, or anyone.  It includes LEDs, a small servo, a small motor, and lots of nice sensors.

Ethan and I worked on two projects.  I had brought my Gluss Pusher invention, and in fact made excellent progress on it, perhaps because, as Richard Feynman elegantly argued, teaching and research always go hand in hand, and the best way to quit thinking is to quit teaching.

However, Ethan and his father wanted to do something practical around their ranchette. I had brought Hall sensors to work on the Gluss Pusher. Ethan and I quickly redeployed these, along with some powerful rare earth magnets, to make something that could sense when the bathroom door was open and turn on a blue LED.

As I have mentioned before, if you plan to do anything real with an Arduino you are going to have to deal with packaging and power management.  In our case, packaging meant mounting the sensor on the end of the wire so that we could put it at the corner of the bathroom door and mount the Arduino on the towel hook.  And this required soldering.

Like many things in life, it helps to have someone show you how it is done, but Ethan needed only one demonstration before he was ready to complete the rest of our soldering, which included soldering a pull-up transistor directly to one leg of the Hall sensor.

It worked.  Uncle Rob could now pee in the middle of the night with less chance of a mishap.

However, we decided that more valuable for the the homestead would be an audio alarm on the freezer door.  A freezer door had been left open previously, at some considerable cost.

We took a trip to Radio Shack, which does an excellent job stocking Arduinos and Arduino-comaptible electronics.  I found there a Relay Shield, and we bought a siren---a very, very loud siren that runs on 12 Volt power that we could switch with a relay that come with the ARDX.  By combining two programs and circuits from the ARDX, we were able to control power to the siren.


The freezer had a steel door, so by taping the sensor in place and sticking magnets onto the door, we had it working. Once the door opens, a horrifyingly loud siren will sound 30 seconds later.

We had to explain to Ethan that although we are proud of this project, it is not a patent-worthy invention, and we are not the first persons to build such an alarm.


Nonetheless, this was a very satisfying project.  We built something that is actually useful and deployed it in a (probably) reliable way. Doing this simple project opens a door to building almost anything we can imagine. I wish every child that has the engineering inclination could have this experience.