Advanced Home Automation Using Raspberry Pi: Building Custom Hardware, Voice Assistants, and Wireless Nodes (Technology in Action)
معرفی کتاب «Advanced Home Automation Using Raspberry Pi: Building Custom Hardware, Voice Assistants, and Wireless Nodes (Technology in Action)» نوشتهٔ Collins، John، Bentley Layton، David Brakke و Rishabh Jain، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2021. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Build a versatile home automation system from scratch. There are many ways of controlling home appliances with your smartphones, voice, gestures, etc. This book dives into the many options for for communicating with appliances wirelessly and we’ll discuss and implement the leading protocols in the field. In first few chapters, you will develop a basic understanding of the Raspberry Pi and how one can control it wirelessly from anywhere in the world. Then you’ll get to know about the local server for your home automation projects and control the Raspberry Pi GPIOs using smartphone and web apps. Every appliance will be able to talk to each other, as well, with the help of mesh networking, which you’ll learn to implement. The user interface is also an important aspect of handling all the appliances, so you’ll create your own user dashboard using OpenHAB. From there, you can monitor all the appliances and sensor data in one environment. Next, implement your own custom voice assistant to control your appliances and perform basic tasks like playing music, checking weather, etc. You’ll also integrate a smart door bell into your system using image processing so that you can restrict an unknown person’s entry. Finally, we’ll combine all the knowledge that we have learned to make a fully versatile home automation project controlled using voice, gestures, and image processing. Throughout this whole project, Raspberry Pi will be your master server or node and other devices will be connected wirelessly using wi-fi/Bluetooth modules. Create a smart home with fully custom interfaces to do exactly what you need! What You'll Learn Create a user interface using openHAB Implement the MQTT protocol Install Alexa and Google Home API to control appliances wirelessly Who This Book Is For Enthusiasts with a working knowledge of the Raspberry Pi, electronic engineering, and Python programming. This book will also interest hobbyists and students from Computer Science or related disciplines. Table of Contents 5 About the Author 10 About the Technical Reviewer 11 Acknowledgments 12 Introduction 13 Chapter 1: Introduction to Raspberry Pi 14 Raspberry Pi 15 Inside the Raspberry Pi Board 16 Hardware Requirements 17 A Power Supply 17 A microSD Card 17 Mouse, Keyboard, and HDMI Cable 17 Software Requirements 18 How to Install the OS in an SD card 20 First Time Boot 22 Using raspi-config 24 Headless Setup for the Pi 28 Accessing the Remote Desktop 30 Summary 34 Chapter 2: Controlling Raspberry Pi GPIO 36 Raspberry Pi GPIO 37 Raspberry Pi Pin Numbering 37 GPIO Programming 40 Importing a Python Module 41 Pin Scheme Declaration 41 Pin Mode Declaration 42 Outputs 42 Inputs 43 Delays 43 Python Program: Blinking an LED 44 PWM: LED Dimming 49 GPIO Input: Button 50 Using Interrupts 53 Analog Input 55 Automating Scripts and Tasks 60 Summary 61 Chapter 3: Getting Started with Web Automation 63 Web-Based Home Automation 64 Hardware Requirements 64 Software Requirements 66 What Is Flask? 66 Installing Flask 67 Creating a Simple Web Server 68 Creating a Home Automation Web Server 70 Understanding IoT Protocols 77 MQTT (Message Queue Telemetry Transport) 77 Subscribe and Publish 78 Messages 79 Topics 79 MQTT Broker 79 XMPP (Extensible Messaging and Presence Protocol) 80 DDS (Data Distribution Service) 81 Installing Mosquitto MQTT Broker 82 Testing Mosquitto Broker 82 Controlling GPIOs Using MQTT 84 Summary 88 Chapter 4: Mesh Networking Using ESP and RPi 89 What Is Mesh Networking? 90 How Does a Mesh Network Work? 91 Types of Mesh Networks 91 Mesh Networking Using ESP Modules 92 About ESP Dev Modules 93 Installing and Setup Arduino IDE 95 Problem Statement 100 ESP-MESH 100 Hardware Requirements and Connection Diagram 102 Coding and Testing 103 Communication Between ESP-MESH and Raspberry Pi 110 MQTT Communication Between ESP and Raspberry Pi 112 Coding and Testing 114 Cloud-Based MQTT Setup 122 Blynk: An IoT Platform 124 Local Blynk Server Setup on Raspberry Pi 126 Blynk App Setup 128 Coding and Testing 130 Summary 134 Chapter 5: Designing Smart Controller Circuits 136 Component Selection 137 Designing the Printed Circuit Board (PCB) 139 Schematic Design 140 Layout Design 142 Gerber Generation 144 Enclosure Design 146 Relay Module 147 Power Supply 151 5V SMPS Circuit Design 155 WiFi-Enabled Smart Switch/Plug 159 AC Fan and Bulb Dimmer Circuit 162 Zero-Crossing Detection Method 163 All-in-One Smart Switch 166 Energy Monitoring Circuit 167 Electric/Capacitive Switch Connections 169 Sensor Connections 170 Summary 171 Chapter 6: Getting Started with Home Assistant 173 Home Automation Platforms 174 Installing Home Assistant 176 Setting Up Home Assistant 179 Installing Add-Ons 182 Configuration.yaml 186 Controlling Raspberry Pi GPIO Using Home Assistant 189 Creating Automation in Home Assistant 191 Controlling a Smart Switchboard Using Home Assistant 195 ESPHome 196 Creating an ESP Node 197 YAML File for Smart Switchboard 198 Flashing Binary File in the ESP Module 202 ESPHome Automation 206 ESP32-CAM Integration with Home Assistant 207 ESPHome and ESP32-CAM 208 Arduino IDE and ESP32-CAM 210 Editing the Dashboard 213 Home Assistant and MQTT Device Interfacing 215 Summary 219 Chapter 7: Getting Started with Voice Assistant 221 What Is a Voice Assistant? 222 How Does a Voice Assistant Work? 223 Controlling the Raspberry Pi Using an Amazon Echo Speaker 224 Controlling a Smart Switchboard Using an Amazon Echo Speaker 233 Raspberry Pi Google Assistant and Alexa 235 AlexaPi Setup and Installation 236 Amazon Alexa and Home Assistant Integration 240 Creating Custom Assistants with Platypush 243 Troubleshooting the Audio 247 Voice Automation 248 Controlling the Assistant Programmatically 250 Installing Offline Voice Assistants 253 Setting Up and Installing the Almond Add-on 254 Jasper: A Custom Offline Voice Assistant 258 Choosing an STT and TTS Engine 259 Speech to Text Engines 259 Text to Speech Engines 261 Configuring Jasper 262 Using Jasper 263 Creating Jasper Modules 265 Controlling the ESP Module Using a Jasper MQTT Module 268 Summary 275 Chapter 8: Getting Started with OpenCV 277 Computer Vision 278 OpenCV 279 Installing OpenCV 280 OpenCV Basics 283 Opening and Displaying an Image 283 Capturing and Reading a Video File 284 Image Transformations 287 Color Spaces 288 Door Locking Using Face Recognition 289 Gathering Data 290 Training the Recognizer 293 Using Face Recognition 295 Using Gesture Recognition Sensors 300 Summary 303 Conclusion 304 Index 307 Build a versatile home automation system from scratch. There are many ways of controlling home appliances with your smartphones, voice, gestures, etc. This book dives into the many options for for communicating with appliances wirelessly and we'll discuss and implement the leading protocols in the field. In first few chapters, you will develop a basic understanding of the Raspberry Pi and how one can control it wirelessly from anywhere in the world. Then you'll get to know about the local server for your home automation projects and control the Raspberry Pi GPIOs using smartphone and web apps. Every appliance will be able to talk to each other, as well, with the help of mesh networking, which you'll learn to implement. The user interface is also an important aspect of handling all the appliances, so you'll create your own user dashboard using OpenHAB. From there, you can monitor all the appliances and sensor data in one environment. Next, implement your own custom voice assistant to control your appliances and perform basic tasks like playing music, checking weather, etc. You'll also integrate a smart door bell into your system using image processing so that you can restrict an unknown person's entry. Finally, we'll combine all the knowledge that we have learned to make a fully versatile home automation project controlled using voice, gestures, and image processing. Throughout this whole project, Raspberry Pi will be your master server or node and other devices will be connected wirelessly using wi-fi/Bluetooth modules. Create a smart home with fully custom interfaces to do exactly what you need! You will: Create a user interface using openHAB Implement the MQTT protocol Install Alexa and Google Home API to control appliances wirelessly
دانلود کتاب Advanced Home Automation Using Raspberry Pi: Building Custom Hardware, Voice Assistants, and Wireless Nodes (Technology in Action)