Raspberry Pi, Python, and Internet of Things (IoT) Project
- 2.5 hours on-demand video
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- The basic principles of installing and manipulating Raspberry Pi
- Understand Python programs and run Raspberry Pi
- Complete our autonomous driving car and home monitoring projects.
- NO requirement!. It is for beginners who are new to Raspberry Pi and Python.
'Autonomous vehicles that avoid obstacles by itself',
'A home monitoring system that moves around in the house'.
The popularity of the Internet of Things (IoT) has increased the number of these products and services.
Raspberry Pie is a device that makes it easy and simple to make an IoT project.
Here you can use a good programming language called Python to complete the project we want.
In this Course, you will learn the basics of raspberry pie and Python
We will practice creating a simple but essential autonomous vehicle and a remote home monitoring project.
- If you want to understand the basic principles of the program
- If you want to use Raspberry Pi
- If you want to learn Python programs
- Those who want to make practical use examples of Internet of Things(IoT)
- If you want to base yourself on becoming a programmer
I have been on vacation by the sea. The calm waves are dazzling under the sunshine. Now I can finally get away from the busy routine and have my own rest ... . Oh, my God. Suddenly I'm worried about locking the gas valve in my house. Did you turn off the air conditioner in the living room? Was the window in the room closed? All of a sudden, I worry about my home. Do you have this experience? Do not worry about it from now on. In this lesson, we will create an autonomous drive vehicle using the board called Raspberry Pi and the Python programming language, and then create remotely controlled vehicles to monitor the video in real time as it travels.
What is a low-cost computer that sold out in just one hour as soon as it first launched in March 2012, followed by two million units sold in November 2013 and more than five million units in February 2015? It is the Raspberry Pi that we will use in this course.
We installed the Linux operating system of Raspberry Pi, turned on the power, and came to the initial screen. However, when I look around, I see that there is a big monitor next to a small board, and the keyboard and mouse are somehow cumbersome.
In this chapter, you will learn how to use the remote terminal feature to connect to Raspberry Pi from another computer over the network. Then you can use our raspberry pi without the peripherals like monitor, keyboard, and mouse with only the power connected to the board.
Now take a look at Raspbian, the operating system of Raspberry Pi. Linux is an open source operating system that inherits the proven Unix concept with its long history. Therefore, Raspbian, Debian, Ubuntu and various types of an operating system are based on Linux.
Let's take a look at the screen that connects to remote desktop using VNC.
On one side of the raspberry pi, the pins lined up side by side. This pin is called GPIO (General Purpose Input / Output) and is useful for connecting various peripheral electronic devices. One or two peripherals can be connected to a USB port, but it is much more convenient to use a GPIO to programmatically control input and output by connecting directly to various electronic circuits. As boards such as Raspberry or Arduino are used widely, various manufacturers around the world provide expansion boards, sensors or electronic components that are compatible with GPIOs and are being used and used in various projects.
In a previous section, I explained that Raspbian, the operating system of Raspberry Pie, is basically Linux based. Therefore, we can use various programming languages such as Python, Java, C, C ++ which are available in Linux. Among them, we will use the language Python. What is Python?
In this chapter, you will learn important concepts that control the flow of Python programs.
There are two ways to control the program flow. The first is to judge the condition and the second is to repeat. Let's take a look at the key points about the condition and loop that control the program flow. First, let's look at the conditional statements that determine the condition. I have sentences that are used to describe conditional statements in any programming language. For those who have studied English grammar, this is a famous sentence I have heard once.
If I were a bird, I could fly to you.
In this chapter, you will learn one key concept of the Python program. I said one of the concepts of Python, but in fact, it is a common core concept of a common program. What we are going to learn today is a library of functions and functions. What is a function? When I explain the function I think Aladdin's magic lamp. When Aladdin calls and orders ‘INPUT’ to Genie in the lamp, he brings ‘OUTPUT’ we don’t know how.
So far we have learned a programming language called Python. And I understood about raspberry pie, especially GPIO (General Purpose Input / Output). In this chapter, we'll use a Python program to do some simple exercises to control the LEDs connected to the GPIO ports. It's simple, but it's a great way to know how your Python program can control the GPIO, and how you can use PWM to control the strength of your signal.
So far I've learned about Raspberry Pi and Python. Finally, It is time to start the project we have planned. The first project to be created is an autonomous vehicle. If you look up the dictionary, we define autonomous vehicles as cars that can automatically run without human driving. The autonomous car recognizes the surrounding environment with various sensors such as radar, GPS, camera, ultrasonic sensor, and avoids obstacles and moves to the destination. That's right. We will use raspberry pi boards, motors, ultrasonic sensors, and Python programs to create a car that will drive itself away from obstacles.
From now on, I will construct the circuit of the autonomous vehicle, the first project. We will connect two motors and ultrasonic distance sensors to the raspberry pi, and if the obstacle is in front, we will make a car that moves by itself. However, it is not possible to control the direction and the strength of a DC (Direct Current) motor by connecting it directly to a raspberry pi. It is the motor drive circuit that makes this possible.
Now that the circuit is completed, let's create one Python program. First, let's make a program to measure the distance using ultrasonic sensor HC-SR04 module. I will explain the program step by step. If you want to get the completed sample file, you can visit our website (www.creapple.com), which is a training portal operated by me, and download the data after registration.
In this chapter, we will create a motor control program that is the core of an automobile. L293D IC Chip Controlling Two Motors Having already studied the configuration of the motor drive circuit, you can implement the program logic to control the motor according to the circuit configuration. Again, start the program and import the GPIO and time library.
So far, we have built a circuit for an autonomous vehicle, a program to measure distances with an ultrasonic sensor to avoid obstacles, and a program to control a car motor. So now I will collect all of these and complete my autonomous vehicle project.
I will make a car frame first. We will use the 2 Wheel Drive Robotics Car Chassis Kit, which makes it simple to create a prototype of the Internet automobile. The kit consists of two DC motors that roll two wheels on the left and right, and several accessories such as the front wheels and body.
Until now, we have accomplished our first challenge, the autonomous drive car. Now we want to remotely control the car and real-time home monitoring with the camera in front of the car. Is not it interesting just to listen? When you travel or work in an office, it is possible to monitor your home from time to time using our Raspberry Pi and Python programs. The project will be completed in four steps, We will go over this course step by step.
So far we have adjusted our cars with raspberry pie. I have programmed Raspberry Pie to work alone, but I would like to be able to remotely control Raspberry Pie using a mobile phone or computer. How fun is it to use a wireless network to remotely control a raspberry pie with a mobile phone? There will also be the ability to monitor video from a remote location using a camera with CCTV. In order to enable this fun feature, Raspberry Pie must have a web server that can be accessed and communicated at any time from a remote location.
Now we know how to control RaspberryPie's GPIO over a wireless network using a great web server called Flask. Then you can apply this technology a little and use your mobile phone or computer to remotely control the raspberry pie car. In this chapter, we will create the desired Raspberry Pi car remote control program by combining the car control program previously used and the program for controlling the GPIO with the flask.
In this chapter, you will install a camera in Raspberry Pi to create a function to view real-time video from a remote location while your car is moving. It's raspberry pie with a remote control car. So first we need to connect the camera and we will use Picamera, which is officially supported by Raspberry Pie. Picamera connects the cable to the camera port in the middle of the Raspberry Pad. Before that, you need to enable the camera in 'Raspberry Pi Configuration' of raspbian.
You are now in the process of completing the project. Now the only remaining task is to monitor the camera's video in real-time by adjusting the raspberry pie car at a remote location out of range of wireless routers. It is a great function, but in fact, the function of the program has already been made by us and we just need to change the settings of the wireless router.