background image

Summary of Contents for PiCar-Pro

Page 1: ......

Page 2: ...d service carriers providing complete tutorials and after sales technical support to help users enjoy learning and entertainment The main products include Arduino Raspberry Pi and various learning kit...

Page 3: ...68 Lesson 5 How to Control WS2812 LED 73 Lesson 6 Displaying Text on the OLED Screen 77 Lesson 7 How to Control DC Motor 82 Lesson 8 How to Control the Ultrasonic Module 86 Lesson 9 How to Assemble P...

Page 4: ...ning tutorials and sample codes are provided from algorithms to applications Multi form It can be transformed into different types of carts by different combinations such as robotic arm carts and ultr...

Page 5: ...ts and visual line tracking color recognition moving object detection Web remote control OLED display and lighting indicators PiCar Pro uses a decelerating DC motor as a power unit and its advantage i...

Page 6: ...ions PiCar Pro uses a decelerating DC motor as a power unit and its advantage is fast using large size wheels PiCar Pro has excellent off road performance and can be applied to complex terrain the pro...

Page 7: ...development of the Raspberry Pi was to improve the teaching level of the school s computer science and related disciplines and cultivate the youth s computer programming interest and ability Nowadays...

Page 8: ...ed distance of an ultrasonic sensor These functional characteristics of GPIO make the Raspberry Pi different from ordinary computer motherboards because it gives developers the freedom to operate manu...

Page 9: ...ss network cards When the number of USB ports is not enough we can also increase the number of USB ports through a USB hub 5 Audio port Audio interface 3 5mm headphone jack When HDMI connection is not...

Page 10: ...should be above 2GB In order to have a better experience it is recommended to equip your Raspberry Pi with a large capacity above 16G high speed Class10 or above SD card 9 Bluetooth port The Bluetoot...

Page 11: ...detail and develop various applications on it 2 Windows 10 IoT Core Windows 10 IoT Core is an operating system specifically created by Microsoft for the Internet of Things ecosystem Windows 10 IoT Cor...

Page 12: ...but people still have disputes about which version to use You can visit Python s official website www python org to understand more related content in the future we will mainly use Python 3 for devel...

Page 13: ...10 2 Introduction of GPIO pins 1 GPIO pin comparison table...

Page 14: ...ry Pi pins The WiringPi number is the pin number of the functional wiring such as TXD PWM0 etc the BCM number is the Broadcom pin number also known as GPIO the physical number is the number correspond...

Page 15: ...rapid communication with many devices The ID_EEPROM pin is also an I2C protocol which is used to communicate with HATs 4 SCLK MOSI and MISO pins SCLK MOSI and MISO pins form the SPI interface SPI is a...

Page 16: ...13 Raspberry Pi through a computer or directly to control the Arduino...

Page 17: ...nctions Our PiCar Pro products need to be used in conjunction with the Raspberry Pi Let s first get to know the Robot HAT driver board Vin The vin interface is an interface for external power supply S...

Page 18: ...ce IIC IIC interface It is also the interface of the OLED screen module MPU6050 The interface of MPU6050 sensor Port is divided into Port1 Port2 and Port3 interfaces which are commonly used to connect...

Page 19: ...o that when the USB cable is used to connect the Robot HAT the Robot HAT is powered by USB If your robot restarts automatically after it is turned on or after it is turned on normally it is disconnect...

Page 20: ...r arm according to the specified angle After the rocker arm is installed you can disconnect the servo from the Robot HAT When you need to install the rocker arm of the second servo connect the second...

Page 21: ...er to the computer 1 2 Downloading the Raspberry Pi system Raspbian Raspbian is the official operating system of the Raspberry Pi Foundation It is customized based on Debian GNU Linux and can run on a...

Page 22: ...nloads After logging in to the official website click on the location shown below 2 We need to find out the Raspberry Pi OS 32 bit with desktop and recommended software It contains a complete desktop...

Page 23: ...download the ZIP file and wait for the download to complete 4 Find the ZIP file you just downloaded double click to open it and extract it The uncompressed file format of the file is img Pay attention...

Page 24: ...countering dependent library updates may cause the installation of dependent libraries to fail so we provide a Raspbian mirror file pre installed with dependent libraries The disadvantage of this meth...

Page 25: ...aspberry Pi Imager 1 Visit the official website of Raspberry Pi to download through a browser https www raspberrypi org downloads For Windows system click Raspberry Pi Imager for Windows to download F...

Page 26: ...23 3 Then click Finish 4 The software interface after opening is as shown below...

Page 27: ...24 1 3 2 Burning Raspberry Pi system to SD card with Raspberry Pi Imager 1 Click CHOOSE OS on the opened Raspberry Pi Imager software interface...

Page 28: ...ustom and select a custom img file from your computer which is the img file of the Raspberry Pi system that we downloaded and decompressed before 3 Find the img file of the Raspberry Pi system that we...

Page 29: ...26 decompressed before Click Open 4 Select the img file and click Open 5 Then on the interface of Raspberry Pi Imager the img file of our selected Raspberry Pi system will appear...

Page 30: ...27 6 Click CHOOSE SD 7 Then select the SD card we need to burn...

Page 31: ...28 8 Click WRITE to write it to the SD card Wait for the burn to complete 9 After the burning is completed the following message will be prompted indicating that the burning is finished click CONTINUE...

Page 32: ...er At this time once the SD card is put into the Raspberry Pi to boot it may cause subsequent headless WIFI configuration failure 1 4 Starting the Raspberry Pi SSH service SSH is a protocol designed t...

Page 33: ...ve select New and select Text Document 3 Name the file ssh as shown below 4 Then delete the suffix txt We will get an ssh file without any extension As shown below 5 Copy this ssh file to the root dir...

Page 34: ...ess connection Next we also need to set up a WIFI wireless connection for the Raspberry Pi 1 Create a new file named wpa_supplicant conf in the root directory of the D driver of the computer 2 Click t...

Page 35: ...32 4 Write the following contents country US ctrl_interface DIR var run wpa_supplicant GROUP netdev update_config 1 network ssid WIFI psk PASSWORD key_mgmt WPA PSK priority 1...

Page 36: ...o the password of the WIFI you want to connect other parts do not need to do any modifications For example our company s WIFI name is Adeept WIFI password is 123456 and the modified wpa_supplicant con...

Page 37: ...ARD card slot on the Raspberry Pi development board and use the Type C data cable to supply power to the Raspberry Pi And then the Raspberry Pi will start up and run 1 6 Remotely logging in to the Ras...

Page 38: ...the Raspberry Pi IP address You need to prepare the following components 1 One Type C data cable used to supply power to the Raspberry Pi 2 One HDMI cable used to connect the monitor 3 One mouse used...

Page 39: ...hen the Raspberry Pi starts After entering the system interface we move the mouse cursor to the in the upper right corner then it will display the IP address of the Raspberry Pi 192 168 3 157 the IP a...

Page 40: ...t down hostname I 1 6 1 2 Obtaining an IP address with a mobile phone 1 You need to download an APP called Fing on your phone as shown below 2 After the download is complete your phone and Raspberry P...

Page 41: ...38 Click CONTINUE WITHOUT PERMISSION...

Page 42: ...y Pi 192 168 3 157 You need to write down this IP address 1 6 2 Remotely logging in to the Raspberry Pi system This course recommends two kinds of software for SSH login to Raspberry Pi In actual use...

Page 43: ...address of the Raspberry Pi into the Host Name and click Open If it prompts Network error Connection timed out it means you probably entered the wrong IP address When the connection is normal you wil...

Page 44: ...raspberry press Enter to confirm You should now have the Raspberry Pi prompt which will be the same as the prompt on the Raspberry Pi itself 1 6 2 2 MobaXterm MobaXterm is a terminal tool software th...

Page 45: ...ion of MobaXterm Home Edition current version 3 Find the downloaded file MobaXterm_Portable_v20 2 zip double click to open it unzip it to get a new file 4 Open the unzipped folder there is a file Moba...

Page 46: ...43 5 Double click to open MobaXterm_Personal_20 2 exe and then directly open the MobaXterm software The interface is as follows 6 Click Session in the upper left corner 7 Click SSH...

Page 47: ...the Raspberry Pi queried before 192 168 3 157 and click OK to confirm 9 Enter the Raspberry Pi default account pi then press the Enter key and then enter the Raspberry Pi default password raspberry P...

Page 48: ...stem 10 After successfully logging in to the Raspberry Pi system the following interface will appear 11 The red box in the figure below is the command window where you can control the Raspberry Pi by...

Page 49: ...Xterm software and open MobaXterm again to connect to the Raspberry Pi we can double click the IP address under User sessions on the left 192 168 3 157 enter the account name pi and you can directly c...

Page 50: ...want to continue connecting yes no 5 Enter yes press Enter pi 192 168 3 157 s password appears fill in the initial password raspberry of the Raspberry Pi pay attention to the case there will be no ch...

Page 51: ...fully downloading you will see a new folder adept_picarpro in the file resource list on the left This folder stores some very important program codes We will teach you how to use it in detail in the f...

Page 52: ...Press Enter to confirm The following operations are automatically completed by the script program Depending on the network environment this process may last for tens of minutes or several hours just...

Page 53: ...onents needed for this lesson Components Quantity Picture Raspberry Pi 1 Robot HAT 1 camera 1 Camera long cable black 1 2 2 Installing components and run web programs Only by successfully running the...

Page 54: ...e cable with the metal surface of the Raspberry Pi the same applies to installing the camera Install Robot HAT and camera and connect the Raspberry Pi power supply After the Raspberry Pi is turned on...

Page 55: ...same local area network as the Raspberry Pi 2 Obtain the IP address of the Raspberry Pi refer to the software installation section 3 Open the browser on the device chrome browser is recommended to av...

Page 56: ...robot products At this time only the camera can work and other functions can only be realized after PiCarPro is installed 2 4 1 Vedio module Showing the screen captured by the camera Depending on the...

Page 57: ...aying the RAM usage of Raspberry Pi 2 4 3 Move Control Module Controlling the movement of the robot product back and forth speed Using the slider to control the speed when the robot moves 2 4 4 Arm Co...

Page 58: ...to the left RIGHT The robotic arm turns to the right HANDDOWN The robotic arm rotates downward HANDUP The robotic arm rotates upward 2 5 Advanced Function Module Advanced function modules refer to th...

Page 59: ...acles When encountering obstacles try to find other ways POLICE LIGHT switching the police light mode In this mode the LED lights of the robot product will flash like a warning light STEADY CAMERA swi...

Page 60: ...and L2 are used to set the height of the two auxiliary lines Robot products will only recognize the lines in the screen surrounded by two auxiliary lines SP deflection tolerance The larger the value s...

Page 61: ...tune in the PWM input box Click these two buttons to make the servo rotate slightly clockwise or counterclockwise Click this button to save the current servo angle as the default angle Click this but...

Page 62: ...59 Controlling the switches of Port1 Port2 Port3 on the development board...

Page 63: ...1 3 2 Introduction of small warm color LED The small warm color LED is a LED that can emit warm white light after being lit It has a working power of 0 5W a working voltage of 5V 12V and a light emitt...

Page 64: ...be connected to the Port1 Port2 and Port3 on the Robot HAT driver board as shown in the red box 3 4 How to control the small warm color LED 3 4 1Run the program of this course 1 Log in to your Raspbe...

Page 65: ...on the Raspberry Pi by directly typing the following commands sudo python3 switch py 5 After successfully running the program you will observe that the small warm LED light will be on for 1 second an...

Page 66: ...tion two 1 To install a third party IDE tool you can choose Sublime Text Visual Studio Code Atom etc 1 2 Log in to the Raspberry Pi through MobaXterm software you can find the file you want to edit in...

Page 67: ...64...

Page 68: ...nied error just run the command in MobaXterm sudo chmod R 777 adeept_picarpro server 3 4 3 Main code program Complete code reference file switch py 1 First import the library used to control the Raspb...

Page 69: ...light is off and when the status is 1 the corresponding interface light is on 1 def switch port status 2 if port 1 3 if status 1 4 GPIO output 5 GPIO HIGH 5 elif status 0 6 GPIO output 5 GPIO LOW 7 e...

Page 70: ...n 8 time sleep 1 9 set_all_switch_off 10 print Light off 11 time sleep 1 3 5 How to control the LED on Robot HAT driver board When you study the content of this course even if you do not use the Small...

Page 71: ...ontrol toys such as airplanes submarine models and remote control robots We use a 180 servo in this lesson which can move between 0 and 180 Since the 180 servo can use the PWM signal to control the ro...

Page 72: ...is in use it needs to be connected to the servo interface on the RobotHAT driver board The yellow wire is connected to the yellow pin the red wire is connected to the red pin and the brown wire is con...

Page 73: ...ver 3 View the contents of the current directory file ls 4 Enter the command and press Enter to run the program sudo python3 servo py 5 After running the program successfully you will observe that the...

Page 74: ...pwm 3 0 300 i 4 time sleep 0 05 5 for i in range 0 100 6 pwm sety_pwm 3 0 400 i 7 time sleep 0 05 pwm set_pwm 3 0 300 i This method is used to control the rotation of a servo to a certain position whe...

Page 75: ...but this method of controlling the servo also has great drawbacks When the program is executed to the slow motion part of the servo it will be blocked which will seriously affect the program Therefor...

Page 76: ...ule is a low power RGB tri color lamp with integrated current control chip Its appearance is the same as a 5050LED lamp bead and each element is a pixel The pixel contains an intelligent digital inter...

Page 77: ...next WS2812 LED When using the Raspberry Pi to install the driver board RobotHAT the WS2812 LED can be connected to the WS2812 interface on the RobotHAT using a 3pin cable We use a third party library...

Page 78: ...LED 5 4 1Run the code 1 Remotely log in to the Raspberry Pi terminal 2 Enter the command and press Enter to enter the folder where the program is located cd adeept_picarpro server 3 View the contents...

Page 79: ...orted here is inconsistent with the official routine but this third party library can be successfully used after testing and using the import method here 1 class LED 2 def __init__ self 3 self LED_COU...

Page 80: ...24 self strip show After calling the show method the color will really change Build LED control class 1 if __name__ __main__ 2 led LED 3 led colorWipe 0 0 255 The colorWipe method must be used to pac...

Page 81: ...Screen this type of screen has extremely high contrast Even if the ambient light is strong you can see the information on the OLED Screen clearly and the power consumption is relatively low We only ne...

Page 82: ...ou need to connect the IIC interface on the Robot HAT driver board as shown in the figure below 6 4 How to display text on the OLED screen 6 4 1Run the code 1 Remotely log in to the Raspberry Pi termi...

Page 83: ...s the shortcut key Ctrl C on the keyboard 6 4 2 The main code program of this lesson For the complete code please refer to the file OLED py 1 from luma core interface serial import i2c 2 from luma cor...

Page 84: ...as draw 3 draw text 0 0 text_1 fill white 4 draw text 0 10 text_2 fill white 5 draw text 0 20 text_3 fill white 6 draw text 0 30 text_4 fill white 7 draw text 0 40 text_5 fill white 8 draw text 0 50...

Page 85: ...rical energy into mechanical energy It is widely used to drive various equipment such as electric fans remote control cars electric windows etc The DC motor is very suitable as the walking mechanism o...

Page 86: ...7 4 1Run the code 1 Remotely log in to the Raspberry Pi terminal 2 Enter the command and press Enter to enter the folder where the program is located cd adeept_picarpro server 3 View the contents of...

Page 87: ...the complete code please refer to the file move py 1 import time 2 import RPi GPIO as GPIO 3 4 Motor_A_EN 4 5 Motor_A_Pin1 26 6 Motor_A_Pin2 21 Import the dependent library where Motor_EN 4 Motor_Pin...

Page 88: ...int speed radius 6 motor_right 1 right_forward speed 7 elif turn left 8 motor_left 1 left_forward speed 9 motor_right 0 right_backward int speed radius 10 else 11 motor_left 1 left_forward speed 12 m...

Page 89: ...t has four pins namely VCC GND Echo and Trig The HC SR04 can provide a non contact distance sensing function of 2cm 400cm and the ranging accuracy can reach 3mm The module includes an ultrasonic trans...

Page 90: ...immediately stop timing when the reflected ultrasonic wave is received The propagation speed of ultrasonic waves in the air is 340m s According to the time t recorded by the timer the distance s from...

Page 91: ...ultrasonic sensor to the Ultrasonic interface on the driver board Do not connect it to the IIC port to avoid burning the ultrasonic module IIC is an interface used to connect I2C devices and the pin...

Page 92: ...ess Enter to run the program sudo python3 ultra py 5 After successfully running the program the command window will display the distance data of the obstacle detected by the ultrasonic sensor When you...

Page 93: ...LOW 5 6 while not GPIO input Ec When the module no longer receives the initial sound wave 7 pass 8 t1 time time Write down the time when the initial sound wave was emitted 9 while GPIO input Ec When...

Page 94: ...on 9 How to Assemble PiCar Pro 9 1Components used in this course The components we provide RobotHAT driver board x 1 LED headlight x 1 18650 battery holder x 1 LED strip x 1 MPU6050 pin header x 1 Cam...

Page 95: ...80 degree AD002 servo x 3 3pin cable for ws2812 x 1 4pin cable x 2 40CM camera cable black x1 Small LED light x2 DC gear motor JGA25 370 DC12V130RPM with 2pin cable x2 Internal 4mm coupling with screw...

Page 96: ...93 Big wheels x4 180 degree MG946R servo x4 Inner 4mm long 22mm plastic tube x2 Red metal rocker x1 OLED screen anti reverse connection interface x1...

Page 97: ...le x2 Tracking module x1 5pin cable x1 Copper pillar M2 5 14 x4 M3 60 x4 Round head screw black M2 8 x25 M2 14 x2 M2 5 4 x6 silver M2 5 8 x4 M2 5 12 x2 M3 4 x23 M3 16 x5 M3 10 x43 M4 6 x1 silver M4 25...

Page 98: ...3 15 x2 M3 20 x4 M3 40 x3 Flat head screw M3 6 x1 self tapping screw M1 4 6 x5 M1 7 6 6 x10 Hex nuts M2 x23 black M3 x13 black M4 x1 silver Locknut M3 x11 M4 x1 Mechanical parts bearings MF84ZZ x2 A s...

Page 99: ...96 x1 x1 x1 x1 x1 A set of acrylic...

Page 100: ...97 Small Cross head Screwdriver x 1 Cross Socket Wrench x 1 Large Cross head Screwdriver x 1 Large straight Screwdriver x 1 20CM Winding Pipe x 1...

Page 101: ...servo and control the servo to rotate to the middle position before installing the servo rocker arm in this way the rocker arm of the servo installed at the specified angle can be in the middle positi...

Page 102: ...ervo without a rocker arm will also rotate to the middle position 4 It takes a while to boot the Raspberry Pi to control the PCA9685 to set all the servo ports to the signal to rotate to the middle po...

Page 103: ...ch of RobotHAT does not control whether to supply power the switch of RobotHAT can only control the power supply of Vin 5 Do not use the USB port and Vin on the RobotHAT to supply power at the same ti...

Page 104: ...o ports to output neutral signals You can connect the servo to any servo port the gear of the servo will turn to the neutral position and then you can install the servo rocker arm according to the spe...

Page 105: ...ve we dye the screws used in the product During the assembly process you can refer to the fastener color in the tutorial to determine which type of screw and nut to use The actual color of the product...

Page 106: ...e software in the Raspberry Pi the Raspberry Pi will automatically run the robot product program when the Raspberry Pi is turned on After powering on the servo the drive board will automatically place...

Page 107: ...the right side of the above picture There is no need to fix it on the assembled component Since the acrylic panel on the right has directions the rendering diagram will fix it on the component to ind...

Page 108: ...105 Prepare the acrylic panel and acrylic gasket as shown in the picture above...

Page 109: ...he figure on the side panel It should be noted that the lock nut should not be tightened too tightly because this is the rotating pair of the movable part After tightening it will not be able to rotat...

Page 110: ...d M2 nuts to fix the AD002 servo on the acrylic panel shown in the figure above The acrylic panel here is similar in shape to the acrylic panel just installed except that there are more mounting holes...

Page 111: ...like the picture above after installation Prepare the acrylic panel top panel of GRIPPER and AD002 servo as shown in the picture Use M2X8 screws and M2 nuts to fix AD002 servo to the upper panel of t...

Page 112: ...109...

Page 113: ...d the gear shown above between the servo arm and the lower panel For the time being you don t need to fix it You only need to know that the gear is installed here The gear is clamped in this position...

Page 114: ...111 Use M2 5 12 screws and M1 7 6 6 self tapping screws to fix...

Page 115: ...112 Use four M3X20 nylon posts and eight M3X10 screws to fix the left and right panels of the chuck together...

Page 116: ...113...

Page 117: ...114...

Page 118: ...115...

Page 119: ...116 Use three M3X10 screws to fix the acrylic washer and M3X40 nylon column to the side panel of the robot arm...

Page 120: ...117 Use three M3X10 screws to fix the panel on the other side Use M1 7X6X6 self tapping screws to fix the side panel and the servo arm and use M2 5X8 screws to fix the servo to the side panel...

Page 121: ...118...

Page 122: ...119 The assembled look is shown in the figure above Prepare the gear on the other side and the connecting rod parts for the chuck...

Page 123: ...120...

Page 124: ...121 The installation method is shown in the figure above Use M3X10 screws and M3 LOCK locknuts to assemble the connecting rods...

Page 125: ...gear of the servo should be in the middle of the servo rotation range 2 After installing the software in the Raspberry Pi the Raspberry Pi will automatically run the robot product program when the Ras...

Page 126: ...large servos MG946R a camera and the following parts Use 8 M2 nuts on the front and back sides of the camera mounting hole use M2 8 screws to pass through the aluminum alloy and the camera and fix the...

Page 127: ...124 Use M3 4 screws to fix two L shaped aluminum alloys...

Page 128: ...125 Use M3 4 screws to pass through the aluminum alloy and L aluminum alloy to fix the servo...

Page 129: ...Install an M3 10 screw no need to fix for the connection of the PTZ and the robot arm Use M3 10 screws to pass through the aluminum alloy and the servo and fix them with M3 nuts Install the steering w...

Page 130: ...127...

Page 131: ...l automatically run the robot product program when the Raspberry Pi is turned on After powering on the servo the drive board will automatically place the servo in the middle position Use M3 4 screws t...

Page 132: ...129 Install the aluminum alloy and fix it with M3 lock nuts all lock nuts in this course do not need to be tightened Prepare the aluminum alloy as shown below...

Page 133: ...lloy pictured above Use 4 M3 4 screws to pass through the aluminum alloy and the L aluminum alloy on the servo to fix the servo Install the PTZ Use M3 4 screws to pass through the aluminum alloy and f...

Page 134: ...in the figure below M4 40 screws F624ZZ bearing large aluminum alloy M4 8 1 gasket plastic tube and M4 nut Use M4 40 screws to pass through the aluminum alloy sheet F624ZZ bearing aluminum alloy gaske...

Page 135: ...132 shown below Use M3 10 screws to fix aluminum alloy and aluminum alloy sheet...

Page 136: ...133 Install the tire and fix it with M4 locknut...

Page 137: ...134 Install small LED lights...

Page 138: ...on the other side Use M4 40 screws to pass through these from top to bottom MF84ZZ bearing small aluminum alloy long large hole aluminum alloy small hole aluminum alloy small hole aluminum alloy long...

Page 139: ...136...

Page 140: ...ass through these from top to bottom F624ZZ bearing large MF84ZZ bearing small aluminum alloy large hole aluminum alloy small hole aluminum alloy small hole aluminum alloy large hole F624ZZ bearing la...

Page 141: ...138...

Page 142: ...139...

Page 143: ...140 Install WS2812 LED lights Use M2 14 screws to pass through the aluminum alloy M2 6 copper column ws2812 LED lights and fix them with M2 nuts...

Page 144: ...l the Raspberry Pi and Robot HAT driver board Use M2 5 4 screws to penetrate the bottom of the aluminum alloy and fix them with M2 5 4 6 copper pillars Fix the Raspberry Pi with M2 5 4 6 install the c...

Page 145: ...142...

Page 146: ...143 Install the rear wheel Install the motor on the bottom of the aluminum alloy and use M3 4 screws to pass through the aluminum alloy to fix the motor...

Page 147: ...144 Install the inner 4mm coupling and fix it with screws...

Page 148: ...145 Install the rear wheel Use M2 5 4 countersunk screws to fix Install the OLED screen Use M2 8 screws to pass through the aluminum alloy and OLED and fix them with M2 nuts...

Page 149: ...146 Use M3 4 screws to fix the M3 60 copper column with aluminum alloy and use M3 4 screws to fix the aluminum alloy...

Page 150: ...ng the robotic arm Use M3 10 screws to fix the position of the robot arm and use two M1 7 6 6 self tapping screws to fix the direction of the robot arm Use M3 lock nut to fix the other end The install...

Page 151: ...the shovel is equipped with a camera when the ultrasonic mode is selected the camera on the PTZ must be removed and installed in the designated position Use M1 4 6 to install the ultrasonic and use M2...

Page 152: ...It is the same as the method of installing the robot arm Use M3 10 screws to fix the position of the robot arm and use two M1 7 6 6 self tapping screws to fix the direction of the robot arm Use M3 lo...

Page 153: ...150...

Page 154: ...151 The installation is complete 9 5 Circuit Wiring Diagram Robot HAT board interface diagram...

Page 155: ...m servo that controls the left and right steering of the PiCarPro car is connected to the port0 servo port of the drive board 4 Control the servo that swings the PTZ assembly to the left and right and...

Page 156: ...Raspberry Pi and sent to the WS2812 light bar with the 3PIN wire with the driver board It needs to be connected from the light bar with a white stripe The interface text on the back of this end is mar...

Page 157: ...es infrared rays to have different reflection properties on different colored physical surfaces When the car is running the infrared light is continuously emitted to the ground When the infrared light...

Page 158: ...ase disassemble the tracking module to avoid damage to the tracking module 2 Making a patrol track Due to the limitation of the steering range of the front wheel servo the curve radius of the track ca...

Page 159: ...oot time is about 1 minute 2 After PiCarPro is turned on enter the IP address of your Raspberry Pi with the Google browser of your mobile phone or computer and access port 5000 for example 192 168 3 4...

Page 160: ...he ground is about 7mm When the Tracking module cannot be used normally please refer to Tracking module adjustment tutorial Tutorial link https www adeept com learn detail 50 html 10 3 2 Main code pro...

Page 161: ...of the hunt module 1 def run 2 status_right GPIO input line_pin_right 3 status_middle GPIO input line_pin_middle 4 status_left GPIO input line_pin_left 5 6 Detect whether the line hunting module sens...

Page 162: ...lowing advantages 1 Using threads to put time consuming tasks in the background for processing 2 Improving the operating efficiency of the program The subsequent real time video and OpenCV processing...

Page 163: ...or detailed steps The web controller will then be displayed on the browser 3 Click POLICE LIGHT PiCarPro starts flashing lights of different colors 4 When you want to stop the warning light function c...

Page 164: ...161 7 time sleep 0 1 8 for i in range 0 3 9 self colorWipe Color 255 0 0 10 time sleep 0 05 11 self colorWipe Color 0 0 0 12 time sleep 0 05 13 time sleep 0 1...

Page 165: ...module When there are obstacles around it will display a red dot on the screen 12 2 Turning on the ultrasonic scanning function 12 4 1 Running the ultrasonic scanning program 1 Turn on PiCarPro the bo...

Page 166: ...nment After the detection is completed there will be red dots in the pattern where there are obstacles 12 4 2 Main code program For the complete code please refer to the file functions py Import depen...

Page 167: ...m0_pos pwm0_init Define scan function 1 def checkdist 2 Refer to the basic module to control ultra Py 3 4 def radarScan Main function of ultrasonic scanning function 5 global pwm0_pos 6 scan_speed 3 S...

Page 168: ...165 Execution function 1 if __name__ __main__ 2 radar_scan 3 GPIO cleanup...

Page 169: ...a horizontal picture the camera stabilization function is required 13 2 Turning on camera stabilization 13 2 1 Running camera stabilization program 1 Turn on PiCarPro the boot time is about 1 minute 2...

Page 170: ...rolled 9 servoPos 200 Control the reference position of the servo 10 P 1 PID P value setting proportional control parameter the higher the faster Main logic code 1 def pwmGenOut angleInput 2 3 Convert...

Page 171: ...echo detection method that is the ultrasonic transmitter emits ultrasonic waves in a certain direction and the timer starts timing at the same time as the launch time The ultrasonic waves propagate in...

Page 172: ...urn on PiCarPro the boot time is about 1 minute 2 After PiCarPro is turned on enter the IP address of your Raspberry Pi with the Google browser of your mobile phone or computer and access port 5000 fo...

Page 173: ...on For the complete code please refer to the file functions py Import dependencies and initialize 1 import time 2 import RPi GPIO as GPIO 3 import json 4 import Adafruit_PCA9685 5 6 pwm Adafruit_PCA96...

Page 174: ...setup Tr GPIO OUT initial GPIO LOW 25 GPIO setup Ec GPIO IN Main logic code 1 def checkdist 2 Refer to the realization of basic functions ultrasonic module 3 4 while 1 5 print Automatic obstacle avoi...

Page 175: ...e on the left is shorter than the right turn to the right 37 38 print Turn right 39 else 40 41 Otherwise turn left 42 43 print Turn left 44 elif scanList index min scanList 2 The shortest distance det...

Page 176: ...ls for the Raspberry Pi 3 Under normal circumstances if the robot program is not connected to the WIFI when it is turned on it will automatically turn on the hotspot You can use your phone or computer...

Page 177: ...174 Adeept is the name of the WIFI hotspot 12345678 is the password of the WIFI hotspot...

Page 178: ...175...

Reviews: