Raspberry Pi Zero W Wireless Projects

4.2 (6 reviews total)
By Vasilis Tzivaras
  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies

About this book

The Raspberry Pi has always been the go–to, lightweight ARM-based computer. The recent launch of the Pi Zero W has not disappointed its audience with its $10 release. "W" here stands for Wireless, denoting that the Raspberry Pi is solely focused on the recent trends for wireless tools and the relevant use cases. This is where our book—Raspberry Pi Zero W Wireless Projects—comes into its own.

Each chapter will help you design and build a few DIY projects using the Raspberry Pi Zero W board. First, you will learn how to create a wireless decentralized chat service (client-client) using the Raspberry Pi's features?. Then you will make a simple two-wheel mobile robot and control it via your Android device over your local Wi-Fi network. Further, you will use the board to design a home bot that can be connected to plenty of devices in your home. The next two projects build a simple web streaming security layer using a web camera and portable speakers that will adjust the playlist according to your mood. You will also build a home server to host files and websites using the board. Towards the end, you will create free Alexa voice recognition software and an FPV Pi Camera, which can be used to monitor a system, watch a movie, spy on something, remotely control a drone, and more.

By the end of this book, you will have developed the skills required to build exciting and complex projects with Raspberry Pi Zero W.

Publication date:
August 2017
Publisher
Packt
Pages
240
ISBN
9781788290524

 

Chapter 1. Introduction to Raspberry Pi Zero W

Raspberry Pi Zero W is a new product from the Raspberry Pi Zero family. In early 2017, the Raspberry Pi community announced a new board with a wireless extension. It offers wireless functionality and now anyone can develop their own project without cables or other components. Comparing the new board with Raspberry Pi 3 Model B, we can easily see that it is much smaller, with many possibilities for the Internet of Things. However, what is a Raspberry Pi Zero W, and why do you need it? Let's go through the rest of the family and introduce the new board. In this chapter, we will cover the following topics:

  • An overview of the Raspberry Pi family
  • An introduction to the new Raspberry Pi Zero W
  • Distributions
  • Distributors
  • Common issues
 

The Raspberry Pi family


As mentioned previously, Raspberry Pi Zero W is a new member of the Raspberry Pi family of boards. Throughout the years, Raspberry Pi has been evolving and has become more user-friendly with endless possibilities. Let's have a look at the rest of the family, so we can understand how the Pi Zero board is different.

Right now, the heavy board is named Raspberry Pi 3 Model B. It is the best solution for projects such as face recognition, video tracking, gaming, or anything else that is demanding:

A Raspberry Pi 3 model

This is the third generation of Raspberry Pi boards after Raspberry Pi 2 and has the following specifications:

  • A 1.2 GHz 64-bit quad core ARMv8 CPU
  • 802.11 n wireless LAN
  • Bluetooth 4.1
  • Bluetooth Low Energy (BLE)

Like Pi 2, it also has:

  • 1 GB RAM
  • 4 USB ports
  • 40 GPIO pins
  • Full HDMI port
  • Ethernet port
  • Combined 3.5 mm audio jack and composite video
  • Camera interface (CSI)
  • Display interface (DSI)
  • MicroSD card slot (now push-pull rather than push-push)
  • VideoCore IV 3D graphics core

The next board is Raspberry Pi Zero, in which Zero W is based, a small, low-cost power board able to do many things:

A Raspberry Pi Zero board

The specifications of this board are as follows:

  • 1 GHz, single-core CPU
  • 512 MB RAM
  • Mini HDMI port
  • Micro-USB OTG port
  • Micro-USB power
  • HAT-compatible 40-pin header
  • Composite video and reset headers
  • CSI camera connector (v1.3 only)

At this point, we should not forget to mention that apart from the boards mentioned previously, there are several other modules and components such as Sense Hat or Raspberry Pi Touch Display available that will work well for advanced projects.

The 7″ touchscreen monitor of Raspberry Pi gives users the ability to create all-in-one, integrated projects such as tablets, infotainment systems, and embedded projects:

The Raspberry Pi Touch display

The Sense HAT is an add-on board for Raspberry Pi made especially for the Astro Pi mission. The Sense HAT has an 8×8 RGB LED matrix, a five-button joystick and includes the following sensors:

  • Gyroscope
  • Accelerometer
  • Magnetometer
  • Temperature
  • Barometric pressure
  • Humidity

A Sense HAT borad

Stay tuned for new boards and modules at the official website https://www.raspberrypi.org.

 

Raspberry Pi Zero W


Raspberry Pi Zero W is a small device that can be connected to either an external monitor or TV and of course, to the internet. The operating system varies, as there are many distributions on the official page and almost every distribution is based on Linux systems:

Raspberry Pi Zero W

With Raspberry Pi Zero W, you have the ability to do almost everything from automation to gaming! It is a small computer that allows you to easily program with the help of GPIO pins and some other components such as a camera. Its possibilities are endless! In the next chapter, you will go through some awesome projects with this new board. Since almost all input and output on the Raspberry Pi Zero W board goes through GPIO pins, it is important to keep in mind a pinout diagram. The following is a pinout diagram of the Raspberry Pi Zero W board, which can be handy when soldering buttons or other types of sensors onto your Raspberry Pi board:

 

Specifications


If you have bought a Raspberry Pi 3 Model B, you will be familiar with the Cypress CYW43438 wireless chip. It provides 802.11 n wireless LAN and Bluetooth 4.0 connectivity. The new Raspberry Pi Zero W is equipped with this wireless chip as well. The following are the specifications of the new board:

  • Dimensions: 65 mm × 30 mm × 5 mm
  • SoC: Broadcom BCM 2835 chip
    • ARM11 at 1 GHz, single-core CPU
    • 512 ΜΒ RAM
  • Storage: MicroSD card
  • Video and Audio: 1080p HD video and stereo audio via mini HDMI connector
  • Power: 5V supplied via micro-USB connector
  • Wireless: 2.4GHz 802.11 n wireless LAN
  • Bluetooth: Bluetooth classic 4.0 and Bluetooth Low Energy (BLE)
  • Output: Micro-USB
  • GPIO: 40-pin GPIO, unpopulated

In the following image, we can see the new Raspberry Pi Zero W equipped with the previously mentioned specifications:

Raspberry Pi Zero W

Notice that all components are at the top of the board, so you can easily choose your case without any problems and keep it safe. As far as the antenna is concerned, it is formed by etching away copper on each layer of the PCB. It may not be visible, as it is in other similar boards, but it works great and offers quite a lot of functionalities:

Raspberry Pi Zero W Capacitors

Also, the product is limited to only one piece per buyer and costs $10. You can buy a full kit with a MicroSD card, a case, and some extra components for about $45, or choose the full kit with a camera that contains a small camera component for $55.

 

Camera support


Image processing projects, such as video tracking or face recognition, require a camera. In the next image, you can see the official camera support for Raspberry Pi Zero W. The camera can be easily mounted at the side of the board using a cable, similar to the Raspberry Pi 3 Model B board.

The official camera support for Raspberry Pi Zero W 

Depending on your distribution, you may need to enable the camera through the command line. More information on the usage of this module will be mentioned in the project chapters.

 

Accessories


While building projects with the new board, there are some other gadgets that you might find useful to work with. The following is a list of some crucial components. Notice that if you buy a Raspberry Pi Zero W kit, it includes some of them. So, be careful and don't double upon them.

  • An OTG cable
  • PowerHub
  • A GPIO header
  • A MicroSD card and card adapter
  • An HDMI to mini HDMI cable
  • An HDMI to VGA cable

An OTG cable

First of all, an OTG cable is always useful. You can use this cable to power your Raspberry Pi from a power bank or any other power source.

An OTG cable

PowerHub

The second most important component is the PowerHub. A PowerHub is a device powered by a USB or external power source and produces four or more USB ports:

PowerHub

A GPIO header

Next, you might find the GPIO header module handy. Since Raspberry Pi Zero W comes without soldered pins, it is useful to connect GPIO pins over and breadboard:

A GPIO header

MicroSD card and card adapter

You might also need a MicroSD card adapter as not every computer has a MicroSD card slot for reading and writing data. It costs quite a few dollars but will save you time.

A MicroSD card and card adapter

An HDMI to mini HDMI cable

Unfortunately, the new Raspberry Pi Zero W does not have a normal HDMI port. It is a bit smaller, and you need the HDMI to mini HDMI cable to expand the port to a normal HDMI. Then, you are free to connect the port with any HDMI-compatible device. So, the next cable is necessary:

An HDMI to mini HDMI cable

An HDMI to VGA cable

Since many monitors are not HDMI compatible, the HDMI to VGA cable allows you to connect the HDMI to mini HDMI cable with an external monitor or TV. When you need to view something on the monitor and it does not support HDMI, this cable is required:

An HDMI to VGA cable

RCA jacks

Lastly, some TVs still use RCA jacks. With this module, you can connect the Pi board to the RCA jack on your TV by simply connecting the two wires, + (signal) and - (ground), of the module.

An RCA jack

 

A Raspberry Pi Zero W case


Since Raspberry Pi Zero W will be used for various projects, it's good practice to spend some more dollars and buy a case or buy a full kit that comes with the official case, as shown in the next image. The official case is quite protective and exposes only the necessary parts, letting you fully control your board. All the work is done at Kinneir Dufort and T-Zero. The available options are as follows:

  • A blank one
  • One with an aperture to let you access GPIOs
  • One with an aperture and a mounting point for a camera

We can see a Raspberry Pi Zero W case in the following image:

A Raspberry Pi Zero W case

The official case set also includes:

  • A short camera adapter, flexi
  • A set of rubber feet to make sure that your new Zero W board will not slide off any desk
 

Distributions


The official site https://www.raspberrypi.org/downloads/ contains several distributions for downloading. The two basic operating systems that we will analyze later are Raspbian and NOOBS. You can see what the desktop environment looks like in the next image. Both Raspbian and NOOBS allow you to choose from two versions. There is a full version of the operating system and a lite one. Obviously, the lite version does not contain everything that you might use, so if you intend to use your Raspberry with a desktop environment, choose and download the full version.

On the other hand, if you intend to just SSH and do some basic stuff, pick the lite one. It's really up to you, and of course, you can easily download anything you like and rewrite your microSD card.

The NOOBS distribution

Download NOOBS from https://www.raspberrypi.org/downloads/noobs/. The NOOBS distribution is for new users who do not possess much knowledge about Linux systems and Raspberry Pi boards. As the official page says, it is really, "New Out Of Box Software." There are also preinstalled NOOBS SD cards that you can purchase from many retailers, such as Pimoroni, Adafruit, and The Pi Hut, and of course, you can download NOOBS and write your own microSD card. If you are having trouble with a specific distribution, take a look at the following links:

The NOOBS operating system contains Raspbian, and it provides various other operating systems available to download.

The Raspbian distribution

Download Raspbian from the official page https://www.raspberrypi.org/downloads/raspbian/. Raspbian is the officially supported operating system. It can be installed through NOOBS or by downloading the image file from the following link and going through the guide on the official website. 

Image file can be downloaded from: https://www.raspberrypi.org/documentation/installation/installing-images/README.md 

It has plenty of preinstalled software such as Python, Scratch, Sonic Pi, Java, and Mathematica.

Furthermore, more distributions, such as Ubuntu MATE, Windows 10 IoT Core, or Weather Station are meant to be installed for more specific projects such as IoT or weather stations. To conclude, the right distribution to install actually depends on your project and your expertise in Linux systems administration.

Raspberry Pi Zero W needs a MicroSD card for hosting any operating system. You will be able to write Raspbian, Noobs, Ubuntu MATE, or any other operating system you like. So, all you need to do is simply write your operating system to this MicroSD card. First of all, you have to download the image file from https://www.raspberrypi.org/downloads/, which usually comes as a .zip file. Once downloaded, unzip the zip file; the full image is about 4.5 gigabytes. Depending on your operating system, you can use different programs as follows:

  • 7-Zip for Windows
  • The Unarchiver for Mac
  • Unzip for Linux

Now, we are ready to write the image to the MicroSD card. You can easily write the .img file to the MicroSD card by following one of these guides, according to your system.

For Linux users, the dd tool is recommended. Before connecting your MicroSD card with your adapter to your computer, run the following command:

df -h

Now, connect your card and run the same command again. You will see some new records. For example, if the new device is called /dev/sdd1, keep in your mind that the card is /dev/sdd (without the 1).

The next step is to use the dd command and copy the .img file to the MicroSD card. We can do this using the following command:

dd if=<path to your image> of=</dev/***>

Where if is the input file (image file or distribution) and of is the output file (MicroSD card). Again, be careful here, and only use /dev/sdd or whatever yours is without any numbers. If you are having trouble with this, use the full manual by referring to the link https://www.raspberrypi.org/documentation/installation/installing-images/linux.md. A good tool that can help you out for this job is GParted. If it is not installed on your system, you can easily install it with the following command:

sudo apt-get install gparted

Then, run sudo gparted to start the tool. It handles partitions very easily, and you can format, delete, or find information about all your mounted partitions.

More information about dd can be found at https://www.raspberrypi.org/documentation/installation/installing-images/linux.md.

There are several other ways to write an image file to a microSD card. So, if you face any problems when following the preceding guides, feel free to use any other guide available on the internet. Now, assuming that everything is okay and the image is ready, you can gently plug in the MicroSD card to your Raspberry Pi Zero W board.

Remember, you can always confirm that your download was successful with the sha1 code. In Linux systems, you can use sha1sum followed by the file name (the image) and print the sha1 code. This should and must be the same as it is at the end of the official page, where you downloaded the image.

 

Distributors


As previously mentioned, unfortunately the Raspberry Pi Zero W board is limited to one board per user. The following is a list of the official distributors mentioned on the official Raspberry Pi website. So, depending on your location, refer to the shop accordingly.

You can either buy the Raspberry Pi Zero W board on its own or a kit containing some extra stuff. Assuming that Raspberry Pi Zero comes with a mini HDMI and needs a microSD card, you might want to buy the full kit, depending on your hardware. Also, almost everywhere, there is a kit containing the camera module. Depending again on your future projects, you might need the camera kit.

As a result, it's good advice to decide exactly what you want to do and what you plan to do with your Raspberry Pi Zero W first, and then order the board with or without extras. The following is a list of all the shops worldwide from where you can order the Raspberry Pi Zero W. In some of them, it may be out of stock, so if you plan to use a new board, since you are reading this book, buy it as soon as possible!

 

Common Issues 


Sometimes, working with Raspberry Pi boards can lead to issues. We have all faced some of them and hope never to face them again. The Pi Zero is so minimal that it can be tough to say whether it is working or not. Since there is no LED on the board, sometimes a quick check to see whether it is working properly or if something has gone wrong is handy.

Debugging steps

With the following steps, you will probably find its status:

  1. Take your board, with nothing in any slot or socket. Remove even the microSD card!
  2. Take a normal micro-USB to USB-ADATA sync cable and connect one side to your computer and the other side to the Pi's USB (not the PWR_IN).
  3. If Zero is alive:
  • On Windows, the PC will make a ding sound to inform the presence of new hardware, and you will see BCM2708 Boot in Device Manager.
    • On Linux, with a ID 0a5c:2763 Broadcom Corp message from dmesg, try running dmesg in a terminal before you plug in the USB. After this, you will find a new record there.

The following is an example of the output:

[226314.048026] usb 4-2: new full-speed USB device number 82 using uhci_hcd [226314.213273] usb 4-2: New USB device found, idVendor=0a5c, idProduct=2763 [226314.213280] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [226314.213284] usb 4-2: Product: BCM2708 Boot
[226314.213] usb 4-2: Manufacturer: Broadcom

If you see any of the preceding options, so far so good, you know that Zero's not dead.

MicroSD card issue

Remember, if you boot your Raspberry and nothing is working, you may have burned your microSD card wrong. This means that your card may not contain any boot partition as it should, and it is not able to boot the first files. This problem occurs when the distribution is burned to /dev/sdd1 and not /dev/sdd, as it should be. This is a common mistake, and there will be no errors on your monitor. It will just not work!

Case protection

Raspberry Pi boards are electronics, and we never place electronics on metallic surfaces or near magnetic objects. It will affect the booting operation of the Raspberry, and it will probably not work. So, a tip, spend some extra money on a Raspberry Pi case and protect your board from anything like that. There are many problems and issues when hanging your Raspberry Pi using tacks. It may be silly, but there are many who do that.

 

Summary


Raspberry Pi Zero W is a new, promising board allowing anyone to connect their devices to the internet and use their skills to develop projects, including software and hardware. This board is a new toy for any engineer interested in IoT, security, automation, and more! We went through an introduction to the new Raspberry Pi Zero board and the rest of its family, along with a brief analysis of some extra components that you should buy as well. In the next chapter, we will go through IoT and networking, so you can understand how to connect the Raspberry Pi Zero to your network, configure it, and start creating projects.

About the Author

  • Vasilis Tzivaras

    Vasilis Tzivaras is a Computer Science Engineer who lives in Greece. He is the author of the Building a Quadcopter with Arduino book and is also the chair of the IEEE University of Ioannina Student Branch. He is currently working on projects relevant to robotics, home automation, and smart security systems. He is also an enthusiast about Internet of Things (IoT) technology and drones.

    Browse publications by this author

Latest Reviews

(6 reviews total)
Goede voorbeelden. Geen domme zaken. Voorbeelden te downoaden.
As above, ebook not received and they will not acknowledge my emails. There is no phone number to talk directly to the company.
Great Books Help me always

Recommended For You

Hands-On Internet of Things with MQTT

Develop a variety of projects and connect them to microcontrollers and web servers using the lightweight messaging protocol MQTT

By Tim Pulver
Internet of Things with Raspberry Pi 3

Unleash the power of the Raspberry Pi 3 board to create interesting IoT projects

By Maneesh Rao
Internet of Things Projects with ESP32

Create and program Internet of Things projects using the Espressif ESP32.

By Agus Kurniawan
Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

A recipe-based guide to programming your Raspberry Pi 3 using Python

By Tim Cox and 1 more