At the core of this post is a review of a new book, Learn Robotics with Raspberry Pi: Build and Code Your Own Moving, Sensing, Thinking Robots. I recommend it as a great above-basic level introduction to building a standard robot, learning a bit about the Linux operating system, learning to program in Python, and learning some basic electronics. However, I want to frame this review in a bit more context which I think will chase some readers away from this book while at the same time making others drool. But don’t drool on the electronics.
The Raspberry Pi
The Raspberry Pi model 3 is a small computer. At its core, it is similar to the computer inside a modern smart phone. It has a Quad Core 1.2 GHx Boradcam 64 bit CPU, 1GB of non-upgradable RAM, Ethernet, Wireless, Bluetooth, and HDMI output. It has a special connector for a camera, a special connector for a small touchscreen display, a micro SD port which serves as the operating system’s “hard drive” including storage of your data. You plug it into a 2.5 amp Micro USB cabled power brick.
The other models, which are mainly 2 and 1 (I oversimplify) lack some of these features, are not quite as powerful, but any one of them can be used in the same manner if you add some upgrade hardware to them.
The Raspberry Pi also has 4 USB 2 ports.
It costs $35. All you need to do is to add a power brick, an SD card, an HDMI monitor of some sort, maybe a case, a keyboard, a mouse, and perhaps a few other accessories, and pretty soon you nave a reasonably powerful $35 computer for a mere $200!
Or, you can leave off much of that stuff, hook it temporarily to a monitor, keyboard, and mouse (optional, I suppose) and set it up for SSH, then turn it back into a headless (and keyboardless, mouseless) server, communicating with it via wireless from your desktop or laptop.
Then, you take the thing and build stuff with it. Think of the Raspberry Pi, potentially, as a controller you might use for any device that requires controlling, but a very very smart one. Not yet mentioned is one of the key features of the Raspberry Pi: The GPIO header. This is the General Purpose Input Output array of 40 pins that are controlled by the computer, for both output and input, and power supply, to any of a very large range of sensors, actuators, and other devices.
I’ll stop right here and mention the Raspberry Pi Sense HAT. A “hat” or “shield” is a circuit board designed to stick right on top of another circuit board (in this case, the Rapsberry Pi) to give it a bunch of added functionality all at once. Often, a hat or shield has pass through pins for all or most of the GPIO pins, so you still have the same device you had before, but with a bunch of stuff added. The standard sense hat for this device has environmental sensors such as temperature, humidity, atmospheric pressure, and orientation. But I digress.
Anyway, a robot requires a “brain” that may or may not be hooked up via, say, Bluetooth, to a hand held remote of some sort, and also, to the motors that control the wheels (or anything else on the motor that moves), lights, sensors, all that. The most efficient way to build a robot probably uses a more basic controller than a Raspberry Pi, and indeed, most robots use a controller that is built with the specifications of an Arduino Uno, which costs typically less than $20 (and cheap Chinese knockoffs much cheaper, but they don’t all work quite like they are supposed to).
The difference between a dedicated basic controller and a fancier full on computer like a Raspberry Pi is like the difference between teaching your pet to do a trick and teaching your child to do a trick. The latter has way more overhead, but you can do fancier tricks and you can also teach the child to bring you a beer. On the other hand, the pet will just do the trick, while your kid will probably, eventually, give you lip and you’ll have to be nice to it or it will stop working right.
A Veritable Robot Army
Today, there is a veritable robot army out there, of robot kits you can build that are based on Raspberry Pi. I myself have built a version of SunFounder Smart Video Car and it is a great robot. The Adeept PiCar-A Wireless is very cool looking, and is a bit cheaper. Do not, however, that most, probably all, ready to build Raspberry Pi based robot kits do NOT come with the actual Raspberry Pi.
The Basic Robot
It might be helpful to know what the basic robot typically consists of.
Robots have two drive wheels, each powered by a separate tightly programmed specialized motor. There is a third wheel or some other roundy object to keep the robot balanced (usually) so the vehicle turns by moving the two drive wheels at different speeds. This works great on small robot scales. Robots typically have lights or sound making devices that are fun for the kids to program. Most robots have this sensor out front that looks like a set of eyes, but it is really a distance sensor, so you can program the robot to almost but not quite run into things, stopping at the last second. Many robots have a separate sensor facing down, out front, that allows the robot to follow lines or edges, if the lines or edges are just right and the programming is well done, and the sensor is set at just the right height (and thus, when they are installed, they should always be adjustable for height!).
And, of course, a basic robot has some kind of controlling device, such as a bit of software on a smart phone, a simple remote control, or, in the case of the robot you build with the book I’m about to tell you about, a Wii remote.
Learning Robotics with a Raspberry Pi
Learn Robotics with Raspberry Pi: Build and Code Your Own Moving, Sensing, Thinking Robots is written by The Raspberry Pi Guy, aka Matt Timmons-Brown. Matt is an old teenager (probably still, maybe he’s 20) and runs a Youtube Channel called “The Raspberry Pi Guy.”
In this book, the reader is given an introduction to the Raspberry Pi, and some basic electronics. Then, you start building the robot, adding more and more capabilities, until you have the basic robot described above, but then going to the next level so it will have the power of vision and a modest bit of artificial intelligence. The book includes five helpful appendixes revealing additional powers of the Raspberry Pi, and basic information about things like resistors and how to solder.
One of the coolest things is using the Wii remote to control the robot. If you don’t have a Wii, you can get a remote on line, new, like this one from Nintendo or much cheaper used, at your local Goodwill, or on eBay.
Most of the chapters require that you get or have some sort of equipment or parts to put this thing together. The total cost, though, is not much and everything is readily available. You just have to plan it out a little, checking a chapter ahead for what you might need. And then, go step by step and you will learn a lot about robots, electronics, and the Raspberry Pi. I strongly recommend this experience.
Linux and beyond
When you are done building this, and you want to have some fun with the Raspberry Pi itself, then it may be time for you to play around with Mathematica, Minecraft, Python or other programming, or just use LibreOffice and the other software you can run to write your next novel, run a printer server, build an entertainment center, or who knows what else?
The Pi is a real computer that runs the very powerful and versitile Linux operating system (though it can run other OSs as well). If you haven’t messed around with Linux, now is your chance! And, the software mentioned above, Minecraft, and Wolfram’s Mathematica, comes free and in special more or less kid friendly form, on the Pi.
In any event, if you really want to play around with the Pi, you may want to get a kit that lets you access more of its functions, such as the CanaKit Raspberry Pi 3 Ultimate Starter Kit – 32 GB Edition or the CanaKit Raspberry Pi 3 Kit with Clear Case and 2.5A Power Supply, depending on what parts you want.
See also: A Beginner’s Guide to Circuits and How to learn Python programming