Reader small image

You're reading from  Raspberry Pi Pico DIY Workshop

Product typeBook
Published inMay 2022
PublisherPackt
ISBN-139781801814812
Edition1st Edition
Right arrow
Authors (2):
Sai Yamanoor
Sai Yamanoor
author image
Sai Yamanoor

Sai Yamanoor is an embedded systems engineer working for a private startup school in the San Francisco Bay Area, where he builds devices that help students achieve their full potential. He completed his undergraduate work in mechatronics engineering from Sri Krishna College of Engineering and Technology, Coimbatore, India and his graduate studies in mechanical engineering at Carnegie Mellon University, Pittsburgh PA. His interests, deeply rooted in DIY and open software and hardware cultures, include developing gadgets and apps that improve the quality of life, Internet of Things, crowdfunding, education, and new technologies. In his spare time, he plays with various devices and architectures, such as the Raspberry Pi, Arduino, Galileo, Android devices and others. Sai has earlier published a book titled Raspberry Pi Mechatronics Projects.
Read more about Sai Yamanoor

Srihari Yamanoor
Srihari Yamanoor
author image
Srihari Yamanoor

Srihari Yamanoor is a mechanical engineer, working on medical devices, sustainability, and robotics in the San Francisco Bay Area. He completed his undergraduate studies in mechanical engineering from PSG College of Technology, Coimbatore, India and graduate studies in mechanical engineering at Stanford University. He is certified in SolidWorks, simulation, sustainable design, PDM as well as in quality and reliability engineering and auditing. His has a wide range of interests, from DIY, crowdfunding, AI, travelling, photography to gardening and ecology.
Read more about Srihari Yamanoor

View More author details
Right arrow

Chapter 8: Building Wireless Nodes

In this chapter, we are going to discuss building wireless nodes using a Raspberry Pi Pico. So far, we have discussed publishing sensor data using a Wi-Fi module. What if we want to install a project at a location where we don't have access to a Wi-Fi network? In this chapter, we will discuss alternatives for such a scenario.

In this chapter, we are going to cover the following topics:

  • Installing the requisite libraries
  • Interfacing a Bluetooth Low Energy module
  • Interfacing a Sigfox module
  • Interfacing a LoRa module

    Cellular Modules

    We will discuss interfacing cellular modules in Chapter 11, Let's Build a Product!, where we will discuss building a product using a Raspberry Pi Pico and interfacing a cellular module.

Technical requirements

The following hardware is recommended for this chapter. We recommend purchasing components according to the type of wireless radio you want to use in your project:

The code samples for this chapter are available here: https://github.com/PacktPublishing/Raspberry-Pi-Pico-DIY-Workshop/tree/main/chapter_08.

Code in Action videos for this chapter can be viewed at https://bit.ly/3Fgslvi.

CircuitPython Installation

We are assuming that you have installed CircuitPython on your...

Installing requisite libraries

In this section, we will install the requisite libraries needed for the examples discussed in this chapter involving the Bluetooth, LoRa, and the Sigfox modules. The libraries are all part of the Adafruit CircuitPython bundle. The latest bundle can be downloaded as a ZIP file from https://circuitpython.org/libraries. We used the bundle version meant for CircuitPython 6.x.x.

After downloading the ZIP file, extract the contents so that we can copy the libraries we need for the project.

Adafruit Bluefruit LE SPI Friend

We will refer to the Adafruit Bluefruit LE SPI Friend (shown in the following photo) as the Bluetooth module for the rest of this chapter:

Figure 8.1 – Adafruit Bluefruit LE SPI Friend

The Bluetooth module has the adafruit_bus_device and adafruit_bluefruitspi dependencies. From the library bundle, copy over the adafruit_bus_device folder and the adafruit_bluefruitspi.mpy binary to the lib folder of...

Interfacing a Bluetooth Low Energy module

In this section, we will discuss interfacing the Adafruit Bluefruit LE SPI Friend (hereby referred to as the Bluetooth module) to the Raspberry Pi Pico.

In case you are not familiar with Bluetooth Low Energy technology, it is a low-power wireless network technology meant for wireless sensors and other peripherals that can run off a coin cell. You can learn more about Bluetooth Low Energy (BLE) from this tutorial: https://bit.ly/3BkLPNu.

The breakout board used in this section comes with a Raytac MDBT40 BLE module, which is FCC and CE certified. In case you are not familiar with FCC and CE certification, they are mandatory certifications of approval for use in the United States and Europe respectively. The module is designed around the Nordic nRF51822 chipset. The folks at Adafruit implemented firmware that enables you to interface a Bluetooth module as a peripheral in your project. For more information, including the datasheet of the...

Interfacing a Sigfox module

In this section, we will discuss interfacing a Sigfox module with the Raspberry Pi Pico. Before we get started, let's take a quick look at Sigfox.

What is Sigfox?

Sigfox is a type of Low-Power Wide Area Network (LPWAN) that is operated by a French company of the same name. Sigfox radios have a range of about 10–30 km, and the network operator restricts the total number of transmissions to 140 messages per day with each message restricted to 12 bytes. This type of network is suitable for battery-powered wireless nodes deployed at scale. Sigfox typically operates in unlicensed ISM radio bands ISM refers to Industrial, Scientific and Medical bands. As the acronym suggests, it is meant to be used in those applications without a license. In the US, it is typically 915 MHz. You can learn more about Sigfox here: https://build.sigfox.com/sigfox.

Sigfox's future

At the time of writing this chapter, Sigfox filed for bankruptcy protection...

Interfacing a LoRa module

In this section, we are going to interface two LoRa modules with the Raspberry Pi Pico. This will enable us to establish communications between two wireless nodes.

What is LoRa?

Before we get started with our example, let's get started with a brief introduction to LoRa. LoRa stands for Long Range Radio and is a wireless protocol meant for long-range and low-power communications. It was developed by an organization called Semtech. While LoRa and Sigfox (discussed in the previous section) are similar, the main difference is that the former lets you set up your own network, while the latter is operated by an individual operator that requires a license to connect to their network. The following table highlights the difference between LoRa and Sigfox radios:

Table 8.1 – The differences between LoRa and Sigfox

There is a nonprofit organization called the LoRa Alliance that has developed a standard for interoperability between...

Summary

In this chapter, we got started by interfacing a Bluetooth module with a Raspberry Pi Pico. Then, we discussed publishing sensor data via Bluetooth using a mobile device. We also interfaced a Sigfox module with the Pico. Finally, we built two LoRa nodes using the Pico.

In the next chapter, we will discuss building a robot using the Pico.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Raspberry Pi Pico DIY Workshop
Published in: May 2022Publisher: PacktISBN-13: 9781801814812
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Sai Yamanoor

Sai Yamanoor is an embedded systems engineer working for a private startup school in the San Francisco Bay Area, where he builds devices that help students achieve their full potential. He completed his undergraduate work in mechatronics engineering from Sri Krishna College of Engineering and Technology, Coimbatore, India and his graduate studies in mechanical engineering at Carnegie Mellon University, Pittsburgh PA. His interests, deeply rooted in DIY and open software and hardware cultures, include developing gadgets and apps that improve the quality of life, Internet of Things, crowdfunding, education, and new technologies. In his spare time, he plays with various devices and architectures, such as the Raspberry Pi, Arduino, Galileo, Android devices and others. Sai has earlier published a book titled Raspberry Pi Mechatronics Projects.
Read more about Sai Yamanoor

author image
Srihari Yamanoor

Srihari Yamanoor is a mechanical engineer, working on medical devices, sustainability, and robotics in the San Francisco Bay Area. He completed his undergraduate studies in mechanical engineering from PSG College of Technology, Coimbatore, India and graduate studies in mechanical engineering at Stanford University. He is certified in SolidWorks, simulation, sustainable design, PDM as well as in quality and reliability engineering and auditing. His has a wide range of interests, from DIY, crowdfunding, AI, travelling, photography to gardening and ecology.
Read more about Srihari Yamanoor