Book description
Over 80 practical and interesting recipes that explore the plethora of functionalities and opportunities available with Raspberry Pi Zero
About This Book
Deep dive into the components of the small yet powerful Raspberry Pi Zero
Get into grips with integrating various hardware, programming, and networking concepts with the so-called “cheapest computer”
Explore the functionalities of this $5 chip through practical recipes
Who This Book Is For
This book is for programmers and hobbyists who are eager to dive deep into the Raspberry Pi Zero. If you have basic or zero knowledge of the Raspberry Pi Zero, or if you looking for examples of ways to utilize the Raspberry Pi’s GPIO interface, then this book is ideal for you. Basic knowledge of Python will be beneficial, and experience with circuitry and electronics will be needed for the later chapters in the book.
What You Will Learn
Set up your Raspberry Pi Zero with the operating system, networking, and different interfaces
Get a hands-on introduction to Linux, Python, and shell scripts with the Raspberry Pi Zero
Become a master at driving GPIOs and controlling relays, motors, transistors, buzzers, audio, read switches, and interrupts with the Raspberry Pi Zero
Control GPIOs using the web interface and Node.js
Connect displays, LED matrixes, analog sensors, and digital sensors
Hack the Ethernet on the Raspberry Pi Zero
Make your Raspberry Pi Zero an IoT-based sensor node and remotely monitor your data
In Detail
The Raspberry Pi Zero, one of the most inexpensive, fully-functional computers available, is a powerful and revolutionary product developed by the Raspberry Pi Foundation. The Raspberry Pi Zero opens up a new world for the makers out there. This book will give you expertise with the Raspberry Pi Zero, providing all the necessary recipes that will get you up and running.
In this book, you will learn how to prepare your own circuits rather than buying the expensive add–ons available in the market. We start by showing you how to set up and manage the Pi Zero and then move on to configuring the hardware, running it with Linux, and programming it with Python scripts. Later, we integrate the Raspberry Pi Zero with sensors, motors, and other hardware. You will also get hands-on with interesting projects in media centers, IoT, and more.
Style and approach
This recipe-based book will ensure you gain an intermediate-level knowledge of the Raspberry Pi Zero. This book contains comprehensive illustrations with specific schematics for each circuit diagram.
Publisher resources
Table of contents
-
Raspberry Pi Zero Cookbook
- Raspberry Pi Zero Cookbook
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Preface
-
1. Kick-Start Your Raspberry Pi Zero
- Introduction
- Understanding the standard connectors and test points
- Reviewing power supply requirements
- Choosing an operating system to install
- Writing to an SD card with NOOBS
- Using Windows to write a Raspbian image to an SD card
- Using OS X to validate a Raspbian image and write it to an SD card
- Using Ubuntu 16.04 to validate a Raspbian image and write it to an SD card
- Identifying RCA solder points for analog video connections
- Adding a USB extension over a USB OTG connector
- Connecting to displays and changing the configuration settings
- Logging in to the RPZ desktop for the first time, creating users, and rebooting
-
2. Setting Up Physical and Wireless Connections
- Introduction
- Controlling the RPZ from the UART GPIO port using the console cable
- Adding Wi-Fi dongle over USB OTG
- Hacking RPZ hardware to add up permanent Wi-Fi dongle
- Setting Up dynamic and static IP address for RPZ
- Pinging from another computer over same network
- SSHing your RPZ from your desktop computer
- Sharing a screen on your desktop computer
- Copying different files to and from your home network
- Adding USB functions to Raspbian Jessie
- Using a virtual serial adapter on USB OTG
- Programming over a virtual Ethernet modem on USB OTG
- Making your RPZ a USB mass storage device
-
3. Programming with Linux
- Navigating a filesystem and viewing and searching the contents of a directory
- Creating a new file, editing it in an editor, and changing ownership
- Renaming and copying/moving the file/folder into a new directory
- Installing and uninstalling a program
- Downloading a file from the Internet and deleting a file
- Changing to root and using superpowers
- Extracting a zipped file and zipping it back
- Searching executed code from the terminal's history
- Changing RPZ configuration settings from the command line
- Checking running processes and killing a process running in the background
- Creating our first shell program and automating a process
- Syncing with NTC servers to update the current time
- Running a background process in Linux
- Setting a file to run automatically on startup
- Using crontab to run a script automatically at predefined intervals
-
4. Programming with Python
- Introduction
- Choosing between Python 2 and 3
- Installing important Python packages
- Creating our first Python program and running loops
- Playing with strings
- Plotting graphs using Python
- Sending an e-mail from a Python Script
- Creating a program to log and append data to a CSV file
- Using a Python script to upload data online to a Google spreadsheet interface
- Adding help and parameters to your Python Program
-
5. Getting Your Hands Dirty Using the GPIO Header
- Introduction
- Pin configurations and precautions for using the GPIO pins
- Using the GPIOs with the WiringPi library
- Connecting an LED with RPZ and controlling it using C, Python, and a shell
- Basics of the UART port and getting data from the desktop on the serial port using Minicom
- Writing a Python/C program to get UART data in your code
- Basics of I2C and checking the I2C devices present on a port
- Basics of SPI and setting up an SPI module
- Converting a 5V signal into a 3.3V signal and slew rates
- Running RPZ on a battery
- Controlling GPIOs using a web interface
- Making RPZ a radio transmitter and sharing music
- Using a Node.js library to control the GPIOs
- Interfacing the ESP8266 WiFi module with RPZ
-
6. Controlling the LEDs and Displays
- Introduction
- Setting up brightness using PWM
- Monitoring Twitter/e-mails to blink an LED
- Connecting a seven-segment number display module to the RPZ
- Connecting an LED matrix display to the RPZ
- Connecting an RGB LED and generating different colors
- Interfacing the 16x2 LCD display with RPZ
- Connecting the 74HC595N shift register to control many LEDs
-
7. Controlling the Hardware
- Introduction
- Integrating voltage translators with the RPZ
- Controlling a stepper motor using a RPZ and motor drivers
- Connecting a DC motor and controlling its speed and direction
- Controlling high power AC load using relays
- Controlling high power DC load using MOSFETs
- Controlling a buzzer with an RPZ
- Monitoring the physical health of the RPZ hardware
- Interfacing the PiFace with the RPZ
-
8. Taking Digital Inputs to the Raspberry Pi Zero
- Introduction
- Interfacing push switches
- Interfacing toggle switches and setting debouncing
- Avoiding the floating states of the input line
- Interfacing a keypad with the RPZ
- Interfacing RTC to get accurate time
- Setting up Interrupts on a toggle switch through GPIO
- Interfacing RFID tags with the RPZ
- Interfacing a GPS module with the RPZ
-
9. Interfacing Sensors with the Raspberry Pi Zero
- Interfacing any resistive sensor on GPIO
- Interfacing an LDO with the RPZ
- Interfacing an ultrasonic sensor with the RPZ
- Interfacing an analog-to-digital convertor to interface any analog sensor with the RPZ
- Interfacing an infrared receiver to read remote controls and control a TV with the RPZ
- Interfacing a motion sensor
- Interfacing a temperature humidity sensor using bit-banging
- Interfacing a gyroscope and accelerometer with the RPZ
- Pulling it all together with the Pi Sense Hat
- 10. Cooking up Projects to Amaze the World!
Product information
- Title: Raspberry Pi Zero Cookbook
- Author(s):
- Release date: March 2017
- Publisher(s): Packt Publishing
- ISBN: 9781786463852
You might also like
book
Developing IoT Projects with ESP32
Master the technique of using ESP32 as an edge device in any IoT application where wireless …
video
Complete Git Guide: Understand and Master Git and GitHub
Complete with practical activities, this comprehensive Git and GitHub guide will help you understand how Git …
video
Statistics and Mathematics for Data Science and Data Analytics
If you aim for a career in data science or data analytics, this course will equip …
video
Microsoft Power BI - The Complete Masterclass [2023 EDITION]
Microsoft Power BI is an interactive data visualization software primarily focusing on business intelligence, part of …