Book Image

Wearable-Tech Projects with the Raspberry Pi Zero

By : Jon Witts
Book Image

Wearable-Tech Projects with the Raspberry Pi Zero

By: Jon Witts

Overview of this book

With 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!
Table of Contents (10 chapters)

Reading our heart rate

Now that we have connected all of our hardware, we should first check whether we can see all of our devices on the I2C bus. Switch on your Pi Zero, and connect to over SSH. Once you are logged in, run the following command to check the devices detected on the I2C bus – i2cdetect -y 1. You should see the same as this:

This is telling us that we can see five different devices on our I2C bus:

  • 0x49: Enviro pHAT - ADS1015
  • 0x29: Enviro pHAT - TCS3472
  • 0x1d: Enviro pHAT - LSM303D
  • 0x77: Enviro pHAT - BMP280
  • 0x74: Scroll pHAT HD

If you cannot see these five devices on your I2C bus, then you need to go back and check whether your wiring matches the diagram and that your solder joints are all good.

We now need to install some pieces of software to interface with our hardware. Let's start with the software for the Enviro pHAT, type the following command...