Chapter 10 - Going Further

“Prepare for what is difficult when it is easy”

–Lao Tzu

Internet of Things (IoT) - Connect the Raspberry Pi to the World!

The Internet of Things (IoT) is the idea of connecting any device with an on/off switch to another device, or network of devices, in order to increase its utility. Many believe, myself included, IoT will have a transforming effect on educational technology. An increasing number of students will be engaged in learning outside of the classroom while remaining connected. Not only will students use IoT devices, they will be making them! The Raspberry Pi is a great platform to start building simple IoT systems with your students.

Fridge Monitor

This is a great beginner IoT project using the Raspberry Pi and the If This Then That (IFTTT) website. Using a simple light sensor, or photoresistor, the Raspberry Pi is programmed to monitor the light level of the refrigerator. When the open is opened (the light level is high), an email, text, tweet or Facebook message will be sent (using IFTTT) to your phone telling you the time the fridge door was opened. Brilliant and simple to make!

Learn how –> Raspberry Pi Fridge Monitor

Make Your Own Amazon Echo

The Amazon Echo is a hands-free speaker you control with your voice. Echo connects to the Alexa Voice Service to play music, provide information, news, sports scores, weather, and more. It is similar to Apple’s Siri, Google’s Now, or Microsoft’s Cortana technology. The retail version of the Amazon Echo costs $179. You and your students can turn your Raspberry Pi into your own personal assistant using the Amazon Echo Alexa voice service. This is a fun project but there are MANY steps. Be patient, take your time, and learn lots along the way!

Tutorial from: The Raspberry Pi Guy

You will need the following:
  • A Raspberry Pi (B+,A+,Pi 2,Pi 3,Pi Zero) connected to the internet - Note: You MUST have an internet connection for this project.
  • An SD Card with the Raspbian operating system
  • An External Speaker with 3.5mm Jack
  • A USB Microphone Note: Make sure the mic is “plug-and-play” for Linux. I used this one.
  • The Raspberry Pi SenseHat
Installation
  1. Open the Terminal application
  2. Find your Raspberry Pi IP address via the ifconfig terminal command
  3. Download the code with the command: git clone https://github.com/the-raspberry-pi-guy/Artificial-Intelligence-Pi
  4. Change into the new directory: cd Artificial-Intelligence-Pi
  5. In a web browser on a separate computer, go to developer.amazon.com and login with an existing Amazon account or create a new one
  6. Fill in basic information, accept the Terms and Conditions, and answer “No” to the two questions about monetization.
  7. Click “Alexa” at the top, then choose “Alexa Voice Service”
  8. Click “Register a Product Type” and choose “Device”
  9. Fill in “Device Type ID” and “Display Name” with “RaspberryPiAI” for both. Click “Next”.
  10. Click “Select Security Profile”, then click “Create a new profile”
  11. Fill in “Security Profile Name” and “Security Profile Description” with “RaspberryPiAI” for both. Click “Next”.
  12. Click “Web Settings”, then Click “Edit”
  13. In the “Allowed Origins” field, type “http://localhost:5000”, Click “Add Another”, type “http://your-ip-address:5000” (Note: your-ip-address should be the ip address you found when typing the ifconfig command from Step 1)
  14. In the “Allowed Return URLs” field, “http://localhost:5000/code”, Click “Add Another”, type “http://your-ip-address:5000/code” (Note: your-ip-address should be the ip address you found when typing the ifconfig command from Step 1)
  15. Click “Next”
  16. More info!: Under “Category” choose “Other”, under “Description” type “RaspberryPiAI”, for “..expected timeline for commericalization”, choose TBD, and for “…number of devices” type “1”
  17. Click “Next”
  18. You should now see your registered “RaspberryPiAI” device listed. Click “Edit” under Actions and on the left click “Security Profile”. You will need to copy/paste these settings next.
  19. On the Raspberry Pi make sure the microphone and speaker are connected and you are at the terminal.
  20. Run the setup script: sudo ./setup.sh
  21. Use the settings from Step 17 to complete the setup process.
Finally!

Run Alexa Voice service: sudo python main.py

Watch this excellent video - link here - to get a step-by-step video tutorial of the process.

Node-RED - IoT Made Easy

Node-RED is a tool for wiring together hardware devices, APIs and online services in new and interesting ways. Node-Red in its simplest form is an open source visual editor for wiring the internet of things produced by IBM. What does this mean? Basically, it allows you to have more time making stuff “talk” to each other rather than worrying about all of the interfacing code you would otherwise have to write.

Node-RED comes pre-installed on Raspbian.

Learn more - Node-RED

Thingbox

The ThingBox is a set of software already installed and configured for IoT projects on the Raspberry Pi. The ThingBox allows anyone to graphically create new unlimited applications interacting with connected objects from a simple web-browser.

Learn more - The Thingbox Project

Google Coder - A simple way to make “web stuff” on Raspberry Pi

Coder is a free piece of software that turns a Raspberry Pi into a simple platform that educators can use to teach the basics of building for the web. New coders can craft small projects in HTML, CSS, and Javascript, right from the web browser. Coder requires a fresh (or be willing to erase our current) SD card. Basically, you have to download their version of the Raspberry Pi operating system. They have customized it to run a web server and changed many settings to make it MUCH easier to setup your Raspberry Pi as a web development device.

Learn more - googlecreativelab.github.io/coder/

PiNet - Centralized user accounts and file storage for the classroom

PiNet is a simple, free and easy-to-use system for schools that allows teachers to manage their Raspberry Pis more easily. The students user accounts are stored on the central PiNet server. This means they can log in on any Raspberry Pi in the classroom and you do not have to figure out which SD card belongs to which student. Additionally, PiNet has easy to setup shared folders for sharing resources with students along with automated backups of student work to an external drive.

Learn more - PiNet.org.uk

Resources to Explore

Websites:

Books:

Free Guides:

Education Newsletter

Sign up to the Raspberry Pi Foundation Education email newsletter for updates on future professional development, new resources, and competition announcements:

Education Newsletter

Closing Thoughts

I hope you have found this book useful. The Raspberry Pi community is full of many helpful people willing to share their projects, ideas, tips, tutorials, etc. My hope is that I have contributed to this community in some small way. If you have success and find something that works for you and your students, please share it in the Raspberry Pi Foundation Education Forum. Join the Raspberry Pi community and become an active part of the maker community. I think you will find it to be a valuable part of your professional learning network.

Thank for you reading and keep making!

Michael C. Renne