Mẫu: 03/ĐT-KLTN/B VIETNAM NATIONAL UNIVERSITY, HANOI INTERNATIONAL SCHOOL GRADUATION PROJECT PROJECT NAME Robot car avoids obstacles using RASPBERRY PI Student’s name BUI XUAN HOA Hanoi - Year 2021. 1 VIETNAM NATIONAL UNIVERSITY, HANOI INTERNATIONAL SCHOOL GRADUATION PROJECT PROJECT NAME Robot car avoids obstacles using RASPBERRY PI SUPERVISOR: Nguyen Thanh Tung. (Academic title, academic degree, full name) STUDENT: Bui Xuan Hoa. MAJOR: Information computer engineer.
2 LETTER OF DECLARATION I hereby declare that the Graduation Project Robot car avoids obstacles using raspberry pi is the results of my own research and has never been published in any work of others. During the implementation process of this project, I have seriously taken research ethics; all findings of this projects are results of my own research and surveys; all references in this project are clearly cited according to regulations. I take full responsibity for the fidelity of the number and data and other contents of my graduation project. Hanoi, (day) 31 (month) 12 (year) 2021 Student (Signature and Full name) Hòa Bùi Xuân Hòa 3 ACKNOWLEDGEMENT Today with the development of science and technology, the variety of digital electronic components, automatic control devices.
Old technologies are gradually being replaced by modern ones. Advanced technology devices with programmable control systems of microcontrollers, microprocessors, PLCs. and remote control devices are being widely applied in practice. In the current popular research, the application of science and technology has made important contributions, especially in the field of electronics.
Today a smarter product means that it has to have new innovations that are superior to previous generations, so it cannot be without the application of technology to work. From identification to control, technology can solve many practical problems such as picking objects, avoiding obstacles, tracking routes, controlling devices, etc. The topic includes the following main topics: Chapter 1: Overview of the Raspberry Pi embedded computer system. Applications raspberry pi.
Experimenting with building a robot car using Raspberry Pi With my own efforts to learn and learn, and with the dedicated help of the teachers of the Faculty of Informatics - Computer Engineering, especially the dedicated attention and guidance of the teachers. Directly instructing, especially supervisor Nguyen Thanh Tung Although I have tried a lot, but due to limited knowledge and time, it is inevitable that I will make mistakes. I look forward to receiving the contributions and guidance of teachers and friends. Once again I would like to express my gratitude and respect to my teachers throughout my career and to everyone who has helped me during my graduation thesis.
4 Contents LETTER OF DECLARATION. 4 TABLE OF NOTATIONS AND ABBREVIATIONS. 9 CHAPTER1: OVERVIEW OF RASPBERRY PI EMBEDDED COMPUTER SYSTEM .1: General introduction to Raspberry Pi .1: Concept of Raspberry Pi .2: Applications of Raspberry Pi .3: Advantages of Raspberry Pi .2: Hardware Structure Raspberry Pi .2: Raspberry Pi block diagram.3: Operating systems on Raspberry Pi .4: Display images via Raspberry Pi.1: Basic theory of image display: .2: How to perform : .5: Application of raspberry pi in image processing.1: Some theoretical foundations of image processing .6: Why choose Raspberry for project?. 18 CHAPTER 2: OBJECT DETECTION USES SSD MODEL .2: Why use SSDs for Raspberry pi? .4: SSD Algorithm - SINGLE SHOT DETECTOR in Object Detection .7: Stage 1: SSD model using VGG16 base network to extract feature map .8: Stage 2: Using convolution predictors for object detection.1: Multi-scale feature maps for detection .2: Default Bbx: Anchor Box can be understood as stacked bbx.
It helps to detect objects: .3: Bbx covers more audience types:. CONSTRUCTION ROBOT VEHICLES APPLY RASPBERRY PI .1: Design system block diagram .2: Working principle of each block: .2: Central processing unit .3: Working principle of the system.1: Control the car by blynk app.2: Arm control by blynk app. 57 6 List Of Figure Figure 1: Raspberry Pi 4 Embedded Computer Model NO .11 Figure 2: Construction of Raspberry Pi 3 Model RED .13 Figure 3: Raspberry Pi Pinout Foot Diagram.14 Figure 4: Image from webcam .16 Figure 5: Image processing .17 Figure 6: General diagram of an image processing system .17 Figure 7: Simulate SSD algorithm .20 Figure 8: Model Architecture .21 Figure 9: Image of the location of bounding boxes .25 Figure 10: Distance simulation .29 Figure 11: Rely on SSD algorithm and coordinates for object detection .33 Figure 12: After detecting the object .33 Figure 13: Object detection using convolution predictor .34 Figure 14: Image scale feature .35 Figure 15: Difference between horizontal and vertical bbx .36 Figure 16:Using feature maps to scale different scales .37 Figure 17: Block diagram image .38 Figure 18: Blynk Overview .39 Figure 19: Arduino IDE interface .41 Figure 20: Appblynk controls the robot .42 Figure 21: Image of ESP 8266 .43 Figure 22: Part diagram of car controlled by esp8266 .44 Figure 23: Image of Raspberry Pi 4 .45 Figure 24: Image of GPIO pins of Raspberry Pi 4 .46 Figure 25: Image of a robotic arm attached to a vehicle .46 Figure 26:Image of Arduino Esp8266 .47 7 Figure 27: Image of Servo motor .48 Figure 28: Control car motor .49 Figure 29: Raspberry Pi Power Backup Battery .50 Figure 30: Battery for car power .51 Figure 32: Result of object recognition.53 Figure 33: Finished results after assembly and programming .54 Figure 34: Result after completion of assembly .55 8 TABLE OF NOTATIONS AND ABBREVIATIONS Abbreviation Meaning CPU Central Processing Unit GPU Graphics Processing Unit RAM Random Access Memory DSI Display Serial Interface CSI Camera Serial Interface GPIO General Purpose Input and Output API Application Programming Interface UART Universal Asynchronous Receiver /Transmitte ARM Advanced RISC Machines SSD Single Shot Detector IoU Intersection of Union Yolo You only live once IoT Internet of Things FCC Flexible Flat Cable 9 CHAPTER1: OVERVIEW OF RASPBERRY PI EMBEDDED COMPUTER SYSTEM 1.1: General introduction to Raspberry Pi 1.1: Concept of Raspberry Pi Raspberry Pi is a word for single-board computers (also known as embedded computers) the size of a credit card, developed in the UK by the Raspberry Pi Foundation with the original purpose of promoting the Teaching basic computer science in schools and developing countries. The manufacturer has integrated everything necessary in it to use as a computer.
The Pi's board has CPU, GPU, RAM, microSD card slot, Wi-Fi, Bluetooth and 4 USB 2. When using Pi, just install the operating system, attach the mouse, keyboard and monitor to start using. The Raspberry Pi was originally based on Broadcom's BCM2835 system-on- chip (SoC), consisting of a 700 MHz ARM1176JZF-S processor, VideoCore IV GPU, and was initially shipped with 256 MB of RAM, later shipped upgrade (models B and B+) up to 512 MB. This board also has a Secure Digital (SD) socket (models A and B) or a MicroSD (models A+ and B+) used as a boot device and persistent storage.
In 2014, the Raspberry Pi Foundation released the Compute Module, packing a BCM2835 with 512 MB of RAM and an eMMC flash chip into a module for use as part of an embedded system. This organization provides Debian and Arch Linux ARM for users to download. Tools are available for Python as the primary programming language, with support for BBC BASIC (via RISC OS image or Brandy Basic clone for Linux), C, C++, Java, Perl and Ruby. 10 Figure 1: Raspberry Pi 4 Embedded Computer Model NO 1.2: Applications of Raspberry Pi Raspberry Pi is a mini computer with a full range of microprocessors and microcontrollers to perform most functions such as: - HD movie player like Android Box, full KODI support.
- Handheld game consoles, consoles, arcade games. Play like the old tape machine, emulating many systems. - Plug in the Torrent downloader 24/24. - Use as a personal VPN.
- Turn a normal hard drive into a network hard drive (NAS). - Making security cameras, remote monitoring. - Display weather, display intranet information. - Music player, book reader.
- Make a portable Terminal machine with screen, keyboard, backup battery to use anytime, anywhere, detect Wi-Fi pass. 11 - Make a Smart Home control device, control all electronic devices in the house. - Remote control robot, wireless printer, Airplay.3: Advantages of Raspberry Pi - Cheap price: from only 5 USD, you can buy a Pi (shortened version Raspberry Pi Zero). The Pi 3 version is the most powerful currently, with full Wi-Fi, Bluetooth, the highest configuration.
- Simple, easy to use, save space: use for simple office tasks, type Word, Excel or create PowerPoint, surf the web. - Self-taught programming with Pi's simple apps, children can also learn. - Consumes very little electricity: For example, downloading Torrent, instead of plugging in a computer with a capacity of hundreds of Watts continuously 24/24, just use a Pi with a capacity of less than 5W. - Highly portable: can be put in a pocket to take anywhere, suitable for portable music player, ebook reader, Wi-Fi pass detector, handheld game console.2: Hardware Structure Raspberry Pi 1.1: Specifications - Broadcom BCM2837 chipset running at 1.
- 64-bit quad-core ARM Cortex-A53 - Wireless LAN 802.1 (Classic & Low Energy) - Dual-core Videocore IV® multimedia coprocessor - 1 GB LPDDR2 memory - Supports all latest ARM GNU/Linux distributions and Windows 10 IoT - MicroUSB connector for 2.5 A power supply - 1 x 10/100 Ethernet port - 1 x HDMI video/audio connector 12 - 1 x RCA video/audio connector - 4 USB 2.0 ports - 40 GPIO pins - Antenna chip - DSI display connector - MicroSD card slot - Dimensions: 85 x 56 x 17 mm 1.2: Raspberry Pi block diagram Raspberry Pi 3 Model B has all the components like a regular computer. Figure 2: Construction of Raspberry Pi 3 Model RED - CPU: The “heart” of the circuit board. Raspberry Pi 2 uses Broadcom's BCM2836 processor. This is a SoC (system on chip) type.
- CPU: 900 MHz, 4 cores, ARM Cortex-A7 architecture. Because it uses ARM Cortex-A7, Raspberry Pi 2 can run Ubuntu core and Windows 10 core smoothly. 13 - SD RAM: 1 GB - GPU: Broadcom VideoCore IV @ 250 MHz Figure 3: Raspberry Pi Pinout Foot Diagram - Micro SD card slot: It can be noticed that there will be no hard drive on the Raspberry Pi and an SD memory card instead. All data will be stored on this memory card.
At least 4GB class 4 (4MB/s) card is required for Raspberry Pi (8GB class 10 card is recommended). - USB ports: Raspberry Pi 2 has 4 USB 2. Enough for you to plug in the necessary peripherals such as mouse, keyboard and wifi usb. - Ethernet port: The Model 2 has a standard RJ45 Ethernet port.
- HDMI port: Used to transmit digital Video and Audio signals. Up to 14 video standards are supported, and HDMI signals can be easily converted to other standards such as DVI, RCA, or SCART. - Audio-Video Output: This output is a standard 3.5mm jack, supporting users without HDMI-enabled monitors. The sound and picture output from this port is slightly lower quality than from the HDMI port.
Micro USB power supply port: One of the first things that may be noticed is that the Raspberry Pi does not have a power button. Micro USB is selected as the power supply port. Power supply for Raspberry Pi is 5v voltage (required) and current 14 should be greater than 1A. Power supply exceeding 5v will easily burn the circuit board.
- DSI port (Display Serial Interface): This port is used to connect to LCD or OLED display. - CSI (Camera Serial Interface) port: This port is used to connect to the Raspberry Pi's own camera module. This module captures quality images up to 1080p. - GPIO (General Purpose Input and Output): Like the pins of the microcontroller, these IOs of the Raspberry Pi are also used to output signals to leds, devices.
or read input signals from push buttons and switches, sensors… There are also IOs that integrate UART, I2C and SPI data transmission standards.