Wearable-Tech Projects with the Raspberry Pi Zero
eBook - ePub

Wearable-Tech Projects with the Raspberry Pi Zero

  1. 184 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Wearable-Tech Projects with the Raspberry Pi Zero

About this book

Leverage the cheapest and smallest computer to build exciting wearable-tech projects.About This Book• A practical and imaginative guide that exposes you to amazing wearable-tech projects• Create our own heart-rate monitor device and cool projects such as a Tweet-activated LED T-shirt• A practical guide packed with real-world, useful wearable-tech projectsWho This Book Is ForEveryone.While some prior knowledge of Python programming and use of the terminal on the Raspberry Pi would be advantageous, they are by no means necessary. Each chapter clearly sets the steps to be taken on your wearable-tech adventure. The first chapter assumes no prior knowledge to get your Pi Zero and you, up and running. The complexity of the electronic devices used, progress incrementally as you work through the chapters; there are clear steps to follow and pictures to help you at every turn along the way.What You Will Learn• Make use of your Raspberry Pi Zero to create wearable-tech projects• Interface with electronic devices and use Python to control them; incorporate these into real-world, practical, wearable-tech projects• Add LED devices to clothing and connect them to your Pi Zero• Change how LEDs react based upon your movement or messages sent through Twitter• Create a pedometer and heart rate monitor• Create your own GPS trackerIn DetailWith Wearable-Tech Projects with the Raspberry Pi Zero, you will begin with learning how to install the required software for your upcoming projects. You will also learn how to control electronic devices with the GPIOZero Python library. Next, you will be creating some stylish wearable-tech projects such as a motion-reactive LED cap and a Tweet-activated LED T-shirt.Toward the end of the book, you will be creating some useful health and fitness wearable-tech projects; these will help you monitor your heart rate, track your movements with GPS, and count your footsteps with your own pedometer.By the end of the book, you will have created a range of wearable-tech projects and learned enough about your Raspberry Pi Zero that you should be able to adapt these projects further or come up with your own creations!Style and approachThis book showcases interesting and cool projects that use the Raspberry Pi Zero in wearable-tech. This book is for readers who are looking to progress to the next level of integrating hardware into their projects. Upon completion of each project, you will have a functional device that can be worn either to enhance your style or to provide you with practical data.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

A Tweet-Activated LED T-Shirt

In this project, we will use the skills that we learned in Chapter 3, Sewable LEDs in Clothing, and take them a little bit further. We are going to create our own personally designed t-shirt using sewable LEDs again but by combining them into our own personal design. We will use a slightly different technique so that the conductive thread is completely hidden, and finally, we will write a Python program that listens to Twitter-awaiting commands to activate our t-shirt!
If you are using the same Pi Zero for this project as you did for the previous project, desolder the four cables, which lead from the Pi Zero to Blinkt; but leave your off-switch and LED in place, as you may need to detach these from the case first. To deactivate the software running automatically, connect to your Pi Zero over SSH and issue the following command:
 sudo systemctl disable wearableHat.service 
Once the command completes, you can shut down your Pi Zero by pressing your off-switch button for three seconds. Now, let's look at what we are going to cover in this chapter.

What we will cover

In this chapter, we will cover the following topics:
  • What we will need to complete this project
  • Creating our t-shirt design
  • Adding our LEDs to our item of clothing
  • Testing our LEDs
  • Writing our main Python program
  • Connecting our Pi Zero to the internet
  • Making our program run automatically
  • Finalizing the garment modifications
Let's jump straight in and look at what parts we will need to complete this project.

The bill of parts

We will make use of the following things in this project:
  • A Pi Zero W
  • An official Pi Zero case
  • A portable battery pack
  • Inkjet iron-on transfer paper (A3/A4—two sheets)
  • The item of clothing to be modified, for example, a top or t-shirt
  • Four red sewable LEDs
  • Four green sewable LEDs
  • Four blue sewable LEDs
  • Conductive threads
  • Some fabric, the same color as the clothing
  • Thread of the same color as the clothing
  • A sewing needle
  • Pins
  • 15 small metal poppers
  • Some black, blue, red, and yellow colored cable
  • A mobile phone
  • Solders and soldering iron
  • Clear nail varnish

Creating our personal t-shirt design

We are going to use an inkjet iron on transfer paper to get our custom design from our computer onto our t-shirt. I will show the design that I have used, but by all means, use your own design here!
You will need to create your image for your t-shirt design in an image editing package. You could use Photoshop if you have access to a copy, but I am going to use GIMP (GNU Image Manipulation Program) for my design. There really is not much to worry about here apart from a few points to bear in mind:
  • Your final image will need to be reversed. This is especially true if you have any writing in it.
  • Think about how you will need to join your LEDs up. We are going to wire up 12 individual LEDs to our Pi Zero and the connections from each cannot cross at any point.
  • Your design should fit onto a sheet of A3/A4 paper so that it can be printed onto the transfer sheet.
You can see my final design here. I have included the hashtags that we will configure our project to react to on the design so that people know what to Tweet in order to activate the LEDs. I have four separate hashtags defined. One to activate each set of colors, and a final one, which will activate all colors. As you can see, this design has been reversed so that the text for the hashtags will print the correct way around when transferred onto the garment:
I have then created a second design from this first design, which is a fainter version of the design with some additional markers on it to allow us to see, where the LEDs should be attached and the proposed route that the conductive thread should take. You can see that this design also indicates where the poppers will be attached to connect our Pi to the garment:
Once you have printed your designs onto your two sheets of transfer paper, iron the full color design onto your garment ensuring you have placed it nicely and centrally on the garment. Now, take your fainter transfer and apply it to the piece of fabric that matches the color of your garment. We will stitch our LEDs to this piece of fabric as opposed to the garment itself. Ensure that you leave enough space around this piece of fabric so that you can hem it and stitch it into the inside of your garment, directly underneath your transferred design. Your piece of fabric also needs to be large enough so that you can fold it back underneath all of the stitching for the LEDs and poppers.

Adding our LEDs to our fabric

In the same way that we stitched the ground or negative connections of our LEDs together in Chapter 3, Sewable LEDs in Clothing, we are going to use a common ground connection for all of the negative connections of each color LED. Starting with the red LED furthest from the poppers, place your LED on it's marker on the piece of the fabric and stitch it to the fabric using a long length of conductive thread stitching through the negative connection of the LED. Continue with the same piece of conductive thread, and stitch a running stitch along the marker line on your fabric, and then use this to attach the negative connection of the next LED. Continue doing so for all the red LEDs, and finally, run your conductive thread to a female half of a popper, and stitch this to its marker on the fabric. Finish attaching the popper to the fabric by stitching the other three sides down with standard thread. Now, stitch each positive connection of your LEDs to the fabric and run a length of conductive thread to a male popper half on its marker on the fabric; again fasten the other three sides of the popper to the fabric with standard thread. You should now have your four red LEDs stitched to your piece of fabric terminating on five popper studs. Repeat the same process for your green and blue LEDs. To ensure that each LED has a sound connection to the conductive thread, place a small amount of clear nail varnish over each joint of the conductive thread. Here is a picture of my stitched LEDs over the transfer:
Before we can test our LEDs, we need to create our connection to Pi Zero. In the same way as we did in Chapter 3, Sewable LEDs in Clothing, we are going to use a piece of fabric, which will have the other halves of the poppers sewn onto, with a cable soldered to each popper, and at the other end of the cable, it will be soldered to the relevant pin on the Pi Zero. You may have noticed that we have not included a hidden pocket in this design to house the battery and the Pi Zero; this is because I am going to use cables long enough so that the Pi Zero and battery can be placed in the wearers pocket. If you would prefer to have a hidden pocket, then just follow the steps in Chapter 3, Sewable LEDs in Clothing.
Cut a length of cable for each popper ...

Table of contents

  1. Title Page
  2. Copyright
  3. Credits
  4. About the Author
  5. About the Reviewer
  6. www.PacktPub.com
  7. Customer Feedback
  8. Preface
  9. About the Raspberry Pi
  10. Scrolling LED Badge
  11. Sewable LEDs in Clothing
  12. A Motion-Reactive LED Cap
  13. A Tweet-Activated LED T-Shirt
  14. An LED Laptop Bag
  15. Creating Your Own Pedometer
  16. Creating Your Own Heart Rate Monitor
  17. Creating Your Own GPS Tracker

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Wearable-Tech Projects with the Raspberry Pi Zero by Jon Witts in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Networking. We have over one million books available in our catalogue for you to explore.