In the physical world, were surrounded by all kinds of electronic objects: clock radios, toasters, mobile phones, music players, childrens toys, and more. It can take a lot of work and a significant amount of knowledge to make a useful electronic gadgetit can take almost as much knowledge to make those gadgets talk to each other in useful ways. But that doesnt have to be the case. Electronic devices can beand often arebuilt up from simple modules. As long as you understand the interfaces, you can make anything from them. Think of it as object-oriented hardware . Understanding the ways in which things talk to each other is central to making this work, regardless of whether the object is a toaster, an email program on your laptop, or a networked database. All of these objects can be connected if you can figure out how they communicate. This book is a guide to some of the tools for making those connections.
Who This Book Is For
This book is written for people who want to make things talk to other things. Maybe youre a science teacher who wants to show your students how to monitor weather conditions at several locations around your school district simultaneously, or a sculptor who wants to make a whole room of choreographed mechanical sculptures. You might be an industrial designer who needs to be able to build quick mockups of new products, modeling both their forms and their functions. Maybe youre a cat owner, and youd like to be able to play with your cat while youre away from home. This book is a primer for people with little technical training and a lot of interest. This book is for people who want to get projects done.
The main tools in this book are personal computers, web servers, and microcontrollers, the tiny computers inside everyday appliances. Over the past decade, microcontrollers and their programming tools have gone from being arcane items to common, easy-to-use tools. Elementary school students are using the tools that baffled graduate students only a decade ago. During that time, my colleagues and I have taught people from diverse backgrounds (few of them computer programmers) how to use these tools to increase the range of physical actions that computers can respond to, sense, and interpret.
In recent years, theres been a rising interest among people using microcontrollers to make their devices not only sense and control the physical world, but also talk to other things about what theyre sensing and controlling. If youve built something with a Basic Stamp or a Lego Mindstorms kit, and want to make that thing communicate with things you or others have built, this book is for you. It is also useful for software programmers familiar with networking and web services who want an introduction to embedded network programming.
If youre the type of person who likes to get down to the very core of a technology, you may not find what youre looking for in this book. There arent detailed code samples for Bluetooth or TCP/IP stacks, nor are there circuit diagrams for Ethernet controller chips. The components used here strike a balance between simplicity, flexibility, and cost. They use object-oriented hardware, requiring relatively little wiring or code. Theyre designed to get you to the end goal of making things talk to each other as quickly as possible.
What You Need to Know
In order to get the most from this book, you should have a basic knowledge of electronics and programming microcontrollers, some familiarity with the Internet, and access to both.
Many people whose programming experience begins with microcontrollers can do wonderful things with some sensors and a couple of servomotors, but they may not have done much to enable communication between the microcontroller and other programs on a personal computer. Similarly, many experienced network and multimedia programmers have never experimented with hardware of any sort, including microcontrollers. If youre either of these people, this book is for you. Because the audience of this book is diverse, you may find some of the introductory material a bit simple, depending on your background. If so, feel free to skip past the stuff you know to get to the meatier parts.
If youve never used a microcontroller, youll need a little background before starting this book. I recommend you read my previous book, Physical Computing: Sensing and Controlling the Physical World with Computers (Thomson), co-authored with Dan OSullivan, which introduces the fundamentals of electronics, microcontrollers, and physical interaction design.
You should also have a basic understanding of computer programming before reading much further. If youve never done any programming, check out the Processing programming environment at www.processing.org. Processing is a simple language designed to teach nonprogrammers how to program, yet its powerful enough to do a number of advanced tasks. It will be used throughout this book whenever graphic interface programming is needed.