Getting Started with Python for the Internet of Things
上QQ阅读APP看书,第一时间看更新

What this book covers

Chapter 1, Getting Started with a Raspberry Pi 3 Computer, introduces the Raspberry Pi and explores the various ways in which it can be set up and used.

Chapter 2, Dividing Text Data and Building Text Classifiers, guides us to build a text classifier; it can classify text using the bag-of-words model.

Chapter 3, Using Python for Automation and Productivity, explains how to use graphical user interfaces to create your own applications and utilities.

Chapter 4, Predicting Sentiments in Words, explains how Naive Bayes classifiers and logistic regression classifiers are constructed to analyze the sentiment in words

Chapter 5, Detecting Edges and Contours in Images, describes in detail how images are loaded, displayed, and saved. It provides detailed implementations of erosion and dilation, image segmentation, histogram equalization, edge detection, detecting corners in images, and more.

Chapter 6, Building Face Detector and Face Recognition Applications, explains how human faces can be detected from webcams and recognized using images stored in a database.

Chapter 7, Using Python to Drive Hardware, establishes the fact that to experience the Raspberry Pi at its best, we really have to use it with our own electronics. This chapter discusses how to create circuits with LEDs and switches, and how to use them to indicate the status of a system and provide control. Finally, it shows us how to create our own game controller, light display, and a persistence-of-vision text display.

Chapter 8, Sensing and Displaying Real-World Data, explains how to use an analog-todigital converter to provide sensor readings to the Raspberry Pi. We discover how to store and graph the data in real time, as well as display it on an LCD text display. Next, we record the data in a SQL database and display it in our own web server. Finally, we transfer the data to the internet, which will allow us to view and share the captured data anywhere in the world.

Chapter 9, Building a Neural Network Module for Optical Character Recognition, introduces neural network implementation on Raspberry Pi 3. Optical characters are detected, displayed, and recognized using neural networks

Chapter 10, Arithmetic Operations, Loops, and Blinky Lights, walks through the arithmetic operations in Python and loops in Python. In the second half of the chapter, we will discuss the Raspberry Pi Zero’s GPIO interface and then learn to blink an LED using a GPIO pin.

Chapter 11, Conditional Statements, Functions, and Lists, discusses the types of conditional statements, variables, and logical operators in Python. We will also discuss functions in Python. Then, we will learn to write a function that is used to control DC motors using the Raspberry Pi Zero.

Chapter 12, Communication Interfaces, covers all the communication interfaces available on the Raspberry Pi Zero. This includes the I2C, UART, and the SPI interface. These communication interfaces are widely used to interface sensors. Hence, we will demonstrate the operation of each interface using a sensor as an example.

Chapter 13, Data Types and Object-Oriented Programming in Python, discusses object-oriented programming in Python and the advantages of object-oriented programming. We will discuss this using a practical example.

Chapter 14, File I/O and Python Utilities, discusses reading and writing to files. We discuss creating and updating config files. We will also discuss some utilities available in Python.

Chapter 15, Requests and Web Frameworks, discusses libraries and frameworks that enable retrieving data from the Web. We will discuss an example, fetching local weather information. We will also discuss running a web server on the Raspberry Pi Zero.

Chapter 16, Awesome Things You Could Develop Using Python, discusses libraries and frameworks that enable retrieving data from the web. We will discuss examples such as fetching the local weather information. We will also discuss running a web server on the Raspberry Pi Zero

Chapter 17, Robotics 101, will make you understand the basics of our hardware and Python. Using simple LEDs, we will start to make simple programs in Python.

Chapter 18, Using GPIOs as Input, will discuss how to connect various sensors, starting with interfacing a switch through an ultrasonic range finder and finally to a light sensor (LDR) using an analog-to-digital converter.

Chapter 19, Making a Gardener Robot, will use various sensors, such as a soil humidity sensor, and a temperature sensor to sense the climate, and using a solenoid valve controlled by a relay, we will be making a robot that waters the garden whenever required.

Chapter 20, Basics of Motors, will discuss the working of motor and how it can be driven by a motor driver, how a full H bridge motor driver works, and also how the speed control mechanism works in the motor driver. While doing all this, we will control a motor and make it move in a different direction at different speeds.

Chapter 21, Bluetooth-Controlled Robotic Car, will teach more about steering and controlling a robotic vehicle, and the concepts of a skid-steer mechanism will be implemented. You will also learn how to use the Bluetooth onboard our Raspberry Pi and connect it to your mobile phone. Finally, using an app, we will control our robotic vehicle using our mobile phone.

Chapter 22, Sensor Interface for Obstacle Avoidance, will provide an insight into  how we can use IR proximity sensors to determine distances. Also, we will make smart algorithms to sense distance on all sides and then move in the direction where the distance is greatest.

Chapter 23, Making Your Own Area Scanner, will teach you the basics of servo motors and how they can be controlled. Using servo motor, we will make an area scanner, in other words, a homemade LIDAR. Using this home-built sensor, we would make a self navigating car.

Chapter 24, Basic Switching, will control the equipment at your home with simple logic. Finally, we will make an alarm that will wake you up in the natural way by lights. This will have a smart automatic snooze.

Chapter 25, Recognizing Humans with Jarvis, will teach you how to control devices at your home with a room occupancy sensor that we will build at home using an IR proximity sensor. We will then make this occupancy sensor smart and ready to count the number of people in the room and only switch off the lights or other equipment once no one is left in the room.

Chapter 26, Making Jarvis IoT Enabled, will provide you with insights into the concepts of IoT and MQTT server through which we will be able to monitor our home based on events. Also, you will learn how to control the devices in our home while sitting anywhere in the world.

Chapter 27, Giving Voice to Jarvis, will teach you how the system can be made capable of synthesizing speech. Also, you will learn how you can make the system recognize our speech, and based on it, everything in the home can be controlled.

Chapter 28, Gesture Recognition, will make you identify the gestures made on the board using electric waves, and based on those gestures, the smart home will be controlled.

Chapter 29, Machine Learning, will make you understand the concepts of machine learning and especially the k-nearest algorithm. Using this algorithm, you will understand how data can be given to the system and predictions can be made based on it . Finally, you will execute a program to generate its own data by the inputs of the users over the course of time, and based on that data, it will start automatically controlling the home without any human intervention.

Chapter 30, Making a Robotic Arm, will help you make a robotic hand. You will understand how to set the physical limits of the servos for protection purposes, and we will then make a program in which you will control the robot will be controlled based on different frames. Finally, you will go ahead and understand how to control speed of motion of the robot.