Getting Started With IoT

Image by netl is licensed under CC by 2.0

Getting Started with IoT

One emerging area that bears learning about is the Internet of Things (IoT). Imagine if you had a small electronic sensor that could measure the moisture in the soil of a houseplant and would automatically turn on a watering valve when it needed watering. Or, you place electro-magnetic frequency (EMF) sensors in different places in your home and when a ghost is sensed, a message is sent to your cell phone. Or you have a motion sensor send a message to your phone alerting you to someone in your house and you can click a button to turn on all the lights in the house. That’s the IoT. You have sensors, motors, switches, lights, etc. sending information or receiving commands to small computer boards. The boards can be programmed to take action when information is received and can connect to your local network and send information across the Internet. A fun area most of us are familiar with are wearables. Wearable technology tracks and collects information about your current health state and it can be accessed in your cell phone or smartwatch. With this information, you know how well you slept, how active you were, and how fast your heart was beating. This segment of IT is projected to be a major growth area over the next ten years. If you have experience in programming and integrating IoT devices, there should be plenty of jobs available. With my device and sensors, I will walk you through my experiences. Hopefully, you can use it to get started growing skills yourself.  

My first task was to select a processor board and kit to get started with. I didn’t research this too much, I only looked at what was available through Amazon. The three I looked at were the Intel Edison, Raspberry Pi, and Arduino. The first I looked at were the Intel Edison kits. The Intel boards looked good but were a bit expensive and there were not too many kits and not that many books. They may be worth it, but not for me just starting out. The Raspberry Pi was cheaper, but I did not find a lot of kits or books for it either. The last I looked at was the Arduino. There were a number of books and kits, and the cost was very reasonable. In the end I decided to go Arduino.  

I purchased a kit with 3 items: an Arduino UNO R3 board module, a wall adapter power supply, and the SunFounder Project Super Starter Kit for Arduino. My total cost was just under $65 (USD). Through a mistake on my part, I also ordered the SunFounder Mega 2560 R3 Project Super Starter kit for $66. Both kits looked to be about the same. After looking at both kits, either would have worked. The kits also come with a project book to complete a number of projects using the items in the starter kits. I also looked through a number of books and after a quick scan of a half dozen, I found I really liked Programming Arduino Next Steps: Going Further with Sketches, by Simon Monk. This book is well written and provided me the information I needed in the order I needed it. Simon also has a site (http://www.simonmonk.org) with all of the code he uses in the book. The other very useful site I visited is http://arduino.cc. From this site, I was able to download the integrated development environment (IDE) for Arduino.   

Arduino_IDE.png

With that, I was ready for Lesson #1. The Arduino board has a computer (processor and a bit of memory), and connectors for sensors and actuators. The sensor connectors receive input and actuators send output. For instance, you can connect a temperature sensors and program the board so that when a certain temperature is reached, an output is activated that will run a fan. The programming language is based on C++ and the number of commands available will fit on a single printed page. The programs (called sketches) can be divided into three parts, structure, variable, and functions. I connected the Arduino UNO to my PC using a USB cable. The USB power was enough to power the board. I wrote a short sketch to blink the built-in LED on and off.    

This was easy enough to write and helped me to understand how the IDE works. This, along with a number of example sketches, come with the IDE. My approach was to use the example code to load on the board and see what it did. Then, I wrote the sketch from scratch so I could become familiar with the IDE and how it worked. Also, by writing the code I was able to make a few mistakes I had to correct. Just writing each command out helped to reinforce the command structure and gave me practice with writing the code.  

For Lesson 2, I plan to connect two input devices and an output device. I’ll use on input to turn on the output device and the other input to turn off the output device. I’ll also use variables and a loop in there somewhere. If you follow this path, I’d love to hear how and what you do! 


Andy Ruth 
SEI Mentor 
Apprenticeship Program  
ar@sustainableevolution.com