Almost 10 years have passed since I picked up my first Arduino board. At the time, I was an interaction design student at Malmö University. At the front of the classroom that day, there was a bearded Spaniard talking, rather claiming, that he could teach us all about electronics and how to do programming for microprocessors, all in 1 week. Of course, since I knew nothing about electronics and never thought I would learn anything about it, I did not believe him.
The Spaniard had a completely new approach to teaching, which I had never encountered before. He wanted to teach us, not by books and lectures, but by doing things. One of my classmates pointed out that most of us did not know anything about electronics, so how are we supposed to do anything with it? The Spaniard replied that it does not matter, you can do things without knowing what you are doing, and by doing them, you will learn.
After 15 minutes, we all had connected a small lamp to our Arduino boards, and we had managed to program the lamp so that it would turn itself on and off. What baffled me was not only what we had achieved in such little time, but also that parts of what was going on actually made sense. We were learning by doing.
The bearded Spaniard was actually David Cuartielles, who together with Massimo Banzi, just 1 year before, invented the Arduino board. Soon after they invented it, Tome Igoe and David Mellis joined the team, and as they say, the rest is history. But I still remember that day, as if it was yesterday, when I looked down at my blinking light and something sparked inside me. I wanted to learn and do more. Then David gave me the second valuable lesson, that the best way to learn more is to share your knowledge with others, and he put me in a position where I was able to do so. Again I was skeptical, since I had no knowledge to speak of, but again the lesson followed, even if you only know a little, it is enough to help those that know nothing yet.
Soon after, I found out about a field called wearable computing. The idea was to design and apply a technology to the human body in different ways, and it all sounded as wonderfully crazy as the idea that you could learn electronics and programming without any prior knowledge of how to do so. With inspiration from Arduino and its team members, I leaped headfirst into the field. In this new field, I found new inspiration in the works of Steve Mann and Leah Buechley. Mann, now a professor at the University of Toronto, developed his own wearable computer in the 80s and had mostly done so on his own. Buechley, also a professor at MIT, had taken the Arduino board and developed a new prototyping platform, which is specialized for a wearable context. Both seemed to have done this against all the odds. Again, I was inspired, and started to develop my own wearable devices, teaching others how to do the same. Eventually, I collected enough know-how on things that I started to write them down. When I started to share my writing, I found out how truly amazing the Arduino community is a world-wide group of people that share a love for making things with electronics.
It's safe to say that if it had not been for all these people, I probably would never have written any of my books, so I would like to extend my thanks to all. I would also like to thank you for picking up this book. You might be a novice or an expert, but I do hope it will not matter. This book is based on the idea that anyone can learn anything by the simple principle of actually "doing." If you are already an expert, then you know there is always something to learn from "doing" things in a new way.
So, I hope you will gain some new knowledge and inspiration from the projects we created in this book, and I wish you all the best in your creating endeavors.
Do check out "Soldering with David Cuartielles" on my YouTube channel at https://www.youtube.com/watch?v=Mg01HFjsn6k.
Chapter 1, First Look and Blinking Lights, covers the basic steps of installing the development environment and how to get started with coding. We also take a look at how to create our first circuit and control an LED.
Chapter 2, Working with Sensors, teaches about interfacing with sensors and extracting data from them. The chapter also introduces digital and analog sensors ranging from simple to complex sensors.
Chapter 3, Bike Gloves, introduces the reader to the first project of the book, where the goal is to create a pair of bike gloves. In this chapter, we introduce the use of LEDs and how to control them, as well as how to use sensors for some simple gesture recognition.
Chapter 4, LED Glasses, teaches you to create a pair of programmable LED glasses. These glasses will be covered by LEDs in the front, which will be programmable to display different patterns and shapes. The reader will also be introduced to the construction of a pair of sunglasses.
Chapter 5, Where in the World Am I?, focuses on the making of a wrist-worn GPS tracking device. The information will be displayed on a small LCD screen. This chapter also includes instructions and tips on how to create a casing containing the components so that the device can be worn on the wrist.
Chapter 6, Hands-on with NFC, deals with NFC technology and servomotors and how they can be combined into a smart door lock. This chapter also includes how to design around NFC tags and make wearable jewelry that will work as a key for the lock.
Chapter 7, Hands-on BLE, deals with low-powered Bluetooth technology and how it can be implemented into wearable projects. This chapter introduces the Blend Micro board and how it can be used to create projects that connect to your mobile phone.
Chapter 8, On the Wi-fly, introduces you to the Wi-Fi Particle Core board and its web IDE. This chapter also talks about how to connect to online services.
Chapter 9, Time to Get Smart, focuses on the creation of a smart watch, which connects to the Internet and uses online services to create custom notifications to be displayed on a small OLED screen.
The online chapter (Chapter 10), Interactive Name Tag, expands upon Chapter 7, Hands-on BLE, which deals with small screens, and shows you how to interact with them over Bluetooth in order to make an interactive name tag. This chapter is available at https://www.packtpub.com/sites/default/files/downloads/ArduinoWearableProjects_OnlineChapter.pdf.
Download and install the preconfigured Arduino IDE from Adafruit: https://learn.adafruit.com/getting-started-with-flora/download-software.
The Particle Build Web IDE, sign up for a free account on: https://build.particle.io/login.
Free account on IFTTT: https://ifttt.com/.
Here's a list of the boards you'll work on:
Adafruit Trinket—Mini Microcontroller—5V Logic
Adafruit Pro Trinket—5V 16 MHz
FLORA—Wearable electronic platform: Arduino-compatible
Spark Core with Chip Antenna Rev 1.0
Redbear Blend Micro BLE board
Here's a list of all the components and tools you need:
Soldering iron
GA1A12S202 Log-scale Analog Light Sensor
Long Flex/Bend sensor
LDRs
Adafruit TSL2561 Digital Luminosity/Lux/Light Sensor Breakout
Breadboarding wire bundle
Flora Wearable Ultimate GPS Module
Monochrome 128 x 32 I2C OLED graphic display
Adafruit LED Sequins
3.56 MHz RFID/NFC tags
Adafruit PN532 NFC/RFID Controller Shield for Arduino + Extras
Lithium Ion Polymer Battery—3.7V 1200 mAh
SHARP Memory Display Breakout—1.3" 96 x 96 Silver Monochrome
Small Alligator Clip Test Lead
Lithium Ion Polymer Battery—3.7V 500mAh
Monochrome 1.3" 128x64 OLED graphic display
Adafruit Micro Lipo w/MicroUSB Jack—USB LiIon/LiPoly charger (V1)
Full-sized breadboard
OLED Breakout Board—16-bit Color 0.96" w/microSD holder
Half-sized breadboard
USB cable—6" A/MiniB
FLORA 9-DOF Accelerometer/Gyroscope/Magnetometer—LSM9DS0 (V1.0)
Lithium Ion Polymer Battery—3.7V 150mAh
Hook-up Wire Spool Set—22AWG Solid Core—6 x 25 ft
Flush diagonal cutters
Helping Third Hand Magnifier W/Magnifying Glass Tool
For readers familiar with the Arduino prototyping platform with some prior experienced with ordinary hardware tools.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include
directive."
A block of code is set as follows:
//Variable to store the pin int ldrSensor = 10; void setup(){ //Start the serial communication Serial.begin(9600); } void loop(){ //Save the data from the sensor into storeData int storeData=analogRead(ldrSensor); //Re-map storeData to a new range of values int mapValue=map(storeData,130,430,0,2000); //Print the re-mapped value Serial.println(mapValue); //Give the computer some time to print delay(200) }
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button moves you to the next screen."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>
, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/ArduinoWearableProjects_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>
, and we will do our best to address the problem.