Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Collection of Raspberry Pi Projects
Collection of Raspberry Pi Projects
Collection of Raspberry Pi Projects
Ebook201 pages42 minutes

Collection of Raspberry Pi Projects

Rating: 5 out of 5 stars

5/5

()

Read preview

About this ebook

This book is a collection of my best publications on projects made with the Rapberry Pi board, and which I describe below: 1) ALARM SYSTEM: Develop an alarm system to detect the movement of someone through the use of a PIR motion sensor and the Raspberry Pi Zero W board. When this happens, an alert notice will appear on the Twitter account; 2) GAS LEAK ALARM: Develop a system for the detection of fires or gas leaks with the Raspberry Pi Zero W board and the MQ2 gas sensor. This system can send the captured data to the remote server of ThingSpeak. When a gas increase is detected beyond a limit, then a message is sent to the Twitter account; 3) WEATHER STATION: Develop a Weather Station with a Raspberry Pi Zero W board, and monitor all the sensors with ThingSpeak and Twitter. The sensors used are DHT11 (humidity and temperature sensor) and BMP085 (barometric pressure and temperature sensor). Also, you can use new versions of this sensors without any problem; 4) DIGITAL IMAGE PROCESSING: Make use of digital image processing with OpenCV on a Raspberry Pi 3. To achieve this goal, start from the software installation to make your own object classifiers and finally make an example to manipulate an object by means of an image in movement. This has many applications, ranging from recognizing people or objects, to creating your own video surveillance system; and 5) ANIMATIONS WITH PYTHON AND PYGAME: The main goal of this project is to develop virtual animations of a human, animals and objects that are moved on a stage or image background. We will use Python and Pygame, these software tools are used to program games.
LanguageEnglish
PublisherLulu.com
Release dateOct 1, 2020
ISBN9781716542350
Collection of Raspberry Pi Projects

Read more from Guillermo Perez Guillen

Related to Collection of Raspberry Pi Projects

Related ebooks

Robotics For You

View More

Related articles

Reviews for Collection of Raspberry Pi Projects

Rating: 5 out of 5 stars
5/5

1 rating1 review

What did you think?

Tap to rate

Review must be at least 10 words

  • Rating: 5 out of 5 stars
    5/5
    If you have contacted Arian TV repair center for the first time for repair and replacement, the services provided are free of charge. After the repair or replacement of the part, if the TV breaks down again, it is included in Arian's warranty and the cost of re-repair is not charged, and only in some rare cases, the cost of going back and forth is charged.
    https://www.arianrepairs.ir/تعمیرات/تعمیرات-تلویزیون/تعمیر-تلویزیون-ال-جی.html

Book preview

Collection of Raspberry Pi Projects - Guillermo Perez Guillen

Collection of Raspberry Pi

Projects

Guillermo Perez Guillen

Copyright © 2020 Guillermo Perez Guillen

Ciudad de México, México

All rights reserved. No part of this book may be reproduced or used in any manner without the prior written permission of the copyright owner, except for the use of brief quotations in a book review.

To request permissions, contact the publisher at guillengap@email.com ISBN (ePub): 978-1-71654-235-0

Summary:

This book is a collection of my best publications on projects made with the Rapberry Pi board, and which I describe below:

Alarm System: Develop an alarm system to detect the movement of someone through the use of a PIR motion sensor and the Raspberry Pi Zero W board. When this happens, an alert notice will appear on the Twitter account.

Gas Leak Alarm: Develop a system for the detection of fires or gas leaks with the Raspberry Pi Zero W board and the MQ2 gas sensor. This system can send the captured data to the remote server of ThingSpeak. When a gas increase is detected beyond a limit, then a message is sent to the Twitter account.

Weather Station: Develop a Weather Station with a Raspberry Pi Zero W board, and monitor all the sensors with ThingSpeak and Twitter. The sensors used are DHT11 (humidity and temperature sensor) and BMP085 (barometric pressure and temperature sensor). Also, you can use new versions of this sensors without any problem.

Digital Image Processing: Make use of digital image processing with OpenCV on a Raspberry Pi 3. To achieve this goal, start from the software installation to make your own object classifiers and finally make an example to manipulate an object by means of an image in movement. This has many applications, ranging from recognizing people or objects, to creating your own video surveillance system.

Animations With Python And Pygame: The main goal of this project is to develop virtual animations of a human, animals and objects that are moved on a stage or image background. We will use Python and Pygame, these software tools are used to program games.

INDEX

Chapter 1. Introduction

• 1.1 Programming with the Raspberry Pi.

• 1.2 Internet of Things

• 1.3 Digital Image Processing.

Chapter 2. Alarm System

• 2.1 Introduction

• 2.2 Hardware

• 2.3 Software

• 2.4 Procedure for Creating the Application with ThingSpeak

• 2.5 Test

• 2.6 Download code

• 2.7 Conclusion

Chapter 3. Gas Leak Alarm

• 3.1 Introduction

• 3.2 Hardware

• 3.3 Software

• 3.4 Procedure for Creating the Application with ThingSpeak

• 3.5 Test

• 3.6 Download code

• 3.7 Conclusion

Chapter 4. Weather Station

• 4.1 Introduction

• 4.2 Hardware

• 4.3 Software

• 4.4 Procedure for Creating the Application with ThingSpeak

• 4.5 Test

• 4.6 Download code

• 3.7 Conclusion

Chapter 5. Digital Image Processing

• 5.1 Introduction

• 5.2 OpenCV Installation

• 5.3 Make the Classifiers

• 5.4 Test with Images

• 5.5 Test with Videos

• 5.6 Moving a Robot Arm

• 5.7 Download codes

• 5.8 Conclusion

Chapter 6. Animations With Python And Pygame

• 6.1 Introduction

• 6.2 UFO Animated

• 6.3 Dogs Animated

• 6.4 Man Animated

• 6.5 Download code

• 6.6 Conclusion

DATASHEET

1. INTRODUCTION

1.1 Programming with the Raspberry Pi

Then I show you a brief compilation of programming with Python in case you have any doubts and if you consider that it isn’t necessary then you can go to the next chapter.

A. Elements of Language

As in most high-level programming languages, in Python it is composed of a series of elements that feed its structure. Among them, we can find the following: Variables

A variable is a space to store modifiable data, in the memory of a computer. In Python, a variable is defined with the syntax:

name_of_the_variable = value_of_the_variable

Each variable has a name and a value, which defines at the same time, the data type of the variable. There is a type of variable, called constant, which is used to define fixed values, which do not need to be modified.

Variables: Use descriptive and lowercase names. For compound names, separate the words by underscores. Before and after the sign =, there must be only one blank space.

my_variable = 13

Constants: Use descriptive and uppercase names separating words by underscores.

MY_CONSTANT = 23

To print a value on the screen, in Python, the word print is used: my_variable = 34

print my_variable

The above will print the value of the variable my variable on the screen.

Type of data

A variable or constant can contain values of various types. Among them: Text string (string):

my_chain = Hello World!

Whole number:

age = 34

Octal integer:

age = 033

Hexadecimal integer number:

age = 0x12

Real number:

price = 745.89

Boolean (true / False):

one = True

two = False

There are also other types of more complex data, which we will see later.

Arithmetic Operators

Among the arithmetic operators that Python uses, we can find the following: Sum +

a = 11 + 6

a is 17

Subtraction -

a = 16 - 6

a is 10

Denial -

a = -9

a is -9

Multiplication *

a = 8 * 10

a is 80

Exponent **

a = 2 ** 2

a is 4

Division /

a = 14.4 / 2

a is 7.2

Integer division //

a = 14.5 / 2

a is 7.0

Module%

a = 26% 4

a is 2

Always place a blank, before and after an operator

Comments

A file can not only contain source code. You can also include comments or notes that as programmers, we indicate in the code to understand it better. The comments can be of

Enjoying the preview?
Page 1 of 1