ADEEPT PiCar-B User Manual

ADEEPT PiCar-B User Manual

Smart car robot kit for raspberry pi
Hide thumbs Also See for PiCar-B:

Advertisement

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PiCar-B and is the answer not in the manual?

Questions and answers

Summary of Contents for ADEEPT PiCar-B

  • Page 2 Please place and put the product gently. Do not smash or shock it. About Adeept is a technical service team of open source software and hardware. Dedicated to applying the Internet and the latest industrial technology in open source area, we strive to provide the best hardware support and software service for general makers and electronic enthusiasts around the world.
  • Page 3 This user manual and code can be used for learning, DIY, refitting, etc., except for commercial purpose. The Adeept Company owns all rights of contents in the manual, including but not limited to texts, images, data, etc. Any distribution or printing should be implemented with the...
  • Page 4: Table Of Contents

    2.7. Install and Remove Batteries..................... 50 2.8. Circuit Connection......................51 3. Software & Hardware........................52 3.1. Software Installation......................52 3.2. Download Program......................57 3.3. Set Up a Raspberry Pi......................57 3.4. Install Python3.7 in the PC....................66 3.5. Run the PiCar-B........................71 4.Afterword............................76...
  • Page 5: Components List

    1. Components List 1.1. Acrylic Plates 1pcs 1pcs 1pcs 1pcs 1pcs 1pcs 1pcs 2pcs 2pcs...
  • Page 6 1pcs 2pcs 2pcs 1pcs 1pcs 1pcs 1pcs 1pcs 1pcs The acrylic plates are fragile, so please be careful when assembling them in case of breaking. The acrylic plate is covered with a layer of protective film. You need to remove it first.
  • Page 7: Machinery Parts

    1.2. Machinery Parts M2*10 M2*14 Screw Screw www.adeept.com www.adeept.com www.adeept.com www.adeept.com www.adeept.com M2.5*8 M3*8 M3*12 M3*18 M4*6 Screw Screw Screw Screw Screw www.adeept.com www.adeept.com www.adeept.com www.adeept.com www.adeept.com M4*40 M3*10 M1.4*6 F624ZZ Screw Countersunk Self-tapping Spring Bearing Head Screw Washer Screw www.adeept.com...
  • Page 8: Transmission Parts

    1.3. Transmission Parts Bevel gear unit M3*3 Locking Screw x2 Bevel gear x2 S12D4 Coupling Set M4*4 Locking Screw x4 S12D4 Coupling D3.9L120 Axle x1 Motor x1 Servo x3 Wheel x4...
  • Page 9: Electronic Parts

    Raspberry Pi Camera X1 Adeept Motor HAT X1 18650x2 Battery Holder X1 Adeept Ultrasonic Module X1 Adeept RGB LED Module X2 3-CH WS2812 RGB LED X4 3-CH Line Tracking Module X1 Raspberry P1 Camera Ribbon X1 3-Pin Wires -A X3...
  • Page 10: Tools

    4-Pin Wires X3 5-Pin Wires X1 1.5. Tools Hex Wrench-1.5mm X1 Hex Wrench-2.0mm X1 Cross Screwdriver X1 Cross Socket Wrench X1 Ribbon X1 Large Cross-head Screwdriver X1 Winding Pipe X1 1.6. Self-prepared Parts 18650 Battery X2 Raspberry Pi X1...
  • Page 11: Assembly

    Assemble the following components Raspberry Pi Camera x1 Raspberry Pi Camera Ribbon x1 Effect diagram after assembling 2. Connect the Adeept Ultrasonic Module with 4-Pin wires. Assemble the following components Adeept Ultrasonic Module x1 4-Pin wires x1 Effect diagram after assembling The connection diagrams of the remaining modules and wires are as follows:...
  • Page 12 3-CH Line Tracking Module+5-Pin wires 1 set The two plugs of 3-Pin Wires-A are small plugs, 3-Pin Wires-B has a small plug at one end and a large plug at the other end. To prevent confusion between the following two components when reading the manual, we define the following two components as 3-CH WS2812 RGB LED-A and 3-CH WS2812 RGB LED-B.
  • Page 13: Car Light And Battery Holder Assembly

    2.2. Car Light and Battery Holder Assembly 1. Fix two M3*12 Copper Standoff on A01. Assemble the following components M3*12 Copper Standoff is fixed on the marked side of A01 A01 x1 M3*12 Copper Standoff x2 M3*8 Screw Effect diagram after assembling...
  • Page 14 2. Fix A06 on A01. Assemble the following components M3 Nut x4 A06 x1 For the convenience of reading, some modules of the manual will display other colors; the actual M3*12 Screw x4 color shall prevail. Effect diagram after assembling...
  • Page 15 3. Fix M2*6 Copper Standoff on A01. Assemble the following components M2*6 Copper Standoff x2 M2*14 Screw x2 Effect diagram after assembling...
  • Page 16 4. Fix one 3-CH WS2812 RGB LED-A on M2*6 Copper Standoff. Assemble the following components M2 Nut x2 3-CH WS2812 RGB LED-A input (the end marked 3-CH WS2812 with a white strip pattern) RGB LED-A is on the back.
  • Page 17 5. Follow step 3 and 4, fix another 3-CH WS2812 RGB LED-A on A01. Effect diagram after assembling Before install the 3-CH WS2812 RGB LED-A, pass the 3-Pin Wires-A on the 3-CH WS2812 RGB LED-A through A01 via the hole here.
  • Page 18 6. Fix 18650x2 Battery Holder on A01. Assemble the following components M3*10 Countersunk 18650x2 Battery Head Screw x2 Holder x1 M3 Nut x2 Effect diagram after assembling After the 18650x2 Battery Holder is fixed, connect the 3-Pin Wires -A of 3-CH WS2812 RGB LED-A on the left to the 3-CH...
  • Page 19 7. Fix one 3-CH WS2812 RGB LED-A and 3-CH WS2812 RGB LED-B respectively on both sides of the A02 . Assemble the following components With reference to the position of the two holes here (to the right), 3-CH WS2812 RGB LED-A and 3-CH WS2812 RGB LED-B cannot be fixed to the other side of A02.
  • Page 20 8. Fix A02 on A01. Assemble the following components M3 Nut x2 M3*12 Screw x2 Effect diagram after assembling...
  • Page 21 At this point, all the 3-CH WS2812 RGB LEDs are left with only one end of the 3-Pin Wires -B connected to the 3-CH WS2812 RGB LED-B unconnected. We leave it at the end and connect with the Adeept Motor HAT.
  • Page 22: Rear Wheel Assembly

    2.3. Rear wheel assembly 1. Fix the bevel gear on the Motor. Assemble the following components Motor x1 Bevel gear The M3*3 Locking Screw on the bevel gear should be fixed at this plane of the Motor's rotating shaft...
  • Page 23 2. Fix Motor on A06. Assemble the following components M3*8 Screw x2 Effect diagram after assembling Once assembled, the wires on the Motor can be passed through this hole in the A02.
  • Page 24 3. Fix four M3*30 Copper Standoff on A01. Assemble the following components M3*8 Screw x4 M3*30 Copper Standoff x4 Effect diagram after assembling...
  • Page 25 4. Then fix the A04 on the M3*30 Copper Standoff. Assemble the following components M3*8 Screw x4 A04 x1 A10 x2 Effect diagram after assembling...
  • Page 26 5. Take one S12D4 Coupling and fix it on the D3.9L120 Axle. Assemble the following components F624ZZ S12D4 Coupling x1 Bearing x1 M4 Spring Washer D3.9L120 Axle Effect diagram after assembling Insert D3.9L120 Axle to the bottom end of the S12D4 Coupling shaft hole and tighten the M4*4 Locking Screw on the S12D4 Coupling 6.
  • Page 27 7. Take another S12D4 Coupling and fix it on the D3.9L120 Axle. Assemble the following components S12D4 When installing, pay attention Coupling X1 M4 Spring to that the tooth surface of the Washer X1 bevel gear should be facing...
  • Page 28 8. Fix the tire on the S12D4 Coupling. Assemble the following components wheel X1 M4*6 Screw Effect diagram after assembling...
  • Page 29 9. In the same way, fix another S12D4 Coupling to a tire.. Effect diagram after assembling 10. Fix the bevel gear on the D3.9L120 Axle. Effect diagram after assembling Push the bevel gear on the D3.9L120 Axle from right to left with one hand until it engages with the bevel gear on the Motor, and then tighten the M3*3 Locking Screw of the bevel gear on the D3.9L120 Axle with the other hand to...
  • Page 30: Front Wheel Assembly

    2.4. Front wheel assembly 1. Fix 3-CH Line Tracking Module on A03. Assemble the following components M3 Nut X1 3-CH Line Tracking Module should be 3-CH Line Tracking fixed on the side Module X1 with the logo. A03 X1...
  • Page 31 2. Fix two 3*12 Copper Standoff on A03. Assemble the following components M3*12 Copper Standoff X2 M3*8 Screw Effect diagram after assembling...
  • Page 32 3. Calibrate the servos. First, learn the structure. The servo can connect the rocker arm and spin to drive components bound with the arm. There are 3 types of rocker arms and 3 screws in the package. The smallest one is to fix the arm onto the servo.
  • Page 33 After the adjusting, the rocker arm should be in the middle axis. Remove the arm. Make sure all servos have been adjusted and DO NOT spin the servo shaft before the whole assembly is done for the car. If you move it accidentally, readjust before the assembly.
  • Page 34 5. Fix the assembled servo to the M3*12 Copper Standoff on the A03. Assemble the following components M3*8 Screw X2 M3*12 Copper Standoff Effect diagram after assembling...
  • Page 35 6. Fix four M3*30 Copper Standoff on A03. Assemble the following components M3*30 Copper Standoff x4 M3*8 Screw Effect diagram after assembling...
  • Page 36 7. Connect the rocker arm of a servo with A07. Assemble the following components Rocker arm x1 A07 x1 Self-tapping screw packaged with servo x1 Effect diagram after assembling Pay attention not to tighten the screw, otherwise the A07 can't move freely.
  • Page 37 9. Fix the rocker arm on the A07 to the servo on the A03. Insert the rocker arm into the servo in the direction as the following picture and then fix it. 。 Assemble the following components Fixing screw packaged...
  • Page 38 10. Fix the M3*30 Copper Standoff on A01 and A03. Assemble the following components M3*8 Screw x4 F687ZZ Bearing x2 M3*30 Copper Standoff Effect diagram after assembling...
  • Page 39 Adeept RGB LED Module x2 A05 x1 M2*14 Screw x4 Effect diagram after assembling M2 Nut only needs to be screwed into the M2*14 Screw, do not tighten. 12. Fix Adeept RGB LED Module and A05 on A01. Assemble the following components...
  • Page 40 First insert M2 Nut into A01, A05 into A03. Then tighten M2 Nut and M2*14 Screw. Insert M2 Nut into Insert A05 into A03 Then tighten M2 Nut and M2*14 Screw.
  • Page 41: Front Part Assembly

    M2 Nut X4 M1.4*6 Self-tapping A18 X1 Screw X4 Raspberry Pi Camera X1 Effect diagram after assembling 2. Fix the Adeept Ultrasonic Module to the A18. Assemble the following components M2 Nut X4 Adeept Ultrasonic M1.4*6 Self-tapping Screw X4 Effect diagram after assembling...
  • Page 42 3. Take a servo and fix it with A15. Assemble the following components M2*10 Screw X2 Servo X1 A15 X1 M2 Nut X2 Effect diagram after assembling Install strictly according position in the picture, A15 is below the Servo, output shaft of the Servo is to the left 4.
  • Page 43 5. Insert A16 into A17. Assemble the following components Effect diagram after assembling A16 X1 6. Insert A15 into A17. Assemble the following components Effect diagram after assembling 7. Fix the A18 to the M3*30 Copper Standoff on the A17.
  • Page 44 8. Install a rocker arm on the servo. Install the rocker arm on the servo at the angle as shown in the picture. 90° Assemble the following components Effect diagram after assembling Rocker arm x1 9. Fix A13 with servo.
  • Page 45 10. Select a 'cross' rocker arm and fix to the A12. Assemble the following components Effect diagram after assembling Rocker arm x1 A12 x1 Self-tapping screw packaged with servo 11. Then fix the rocker arm to the servo assembled with A09.
  • Page 46 12. Fix M3*18 Screw on A14. Assemble the following components Effect diagram after assembling M3 Nut x1 A14 x1 M3*18 Screw x1 13. Insert A13, A14 into A12. Assemble the following components Effect diagram after assembling Insert the M3*18 Screw on the A14 into the round hole on the A16.
  • Page 47 14. Then use A3*12 Screw to fix A13 and A14 to A12. Assemble the following components Effect diagram after assembling M3 Nut M3*12 Screw x2 15. Fix the assembly completed in the previous step on the M3*12 Copper Standoff on the A1.
  • Page 48 Then fix A09 to M3*12 Copper Standoff with M3*8 Screw. M3*8 Screw X1...
  • Page 49 Rotate the upper part of the Servo 180° counterclockwise, then fix the A09 and M3*12 Copper Standoff with the M3*8 Screw. M3*8 Screw X1...
  • Page 50: Raspberry Pi Assembly

    Finally turn the upper part of the servo back to original position. Effect diagram after assembling 2.6. Raspberry Pi assembly 1. Fix M2.5*10+6 Copper Standoff and M2.5*14 Copper Standoff to Raspberry Pi. Assemble the following components Effect diagram after assembling M2.5*14 Copper...
  • Page 51 2. Connect the other end of the Raspberry P1 Camera Ribbon to the Raspberry Pi via Adeept Motor HAT and fix the Adeept Motor HAT to the Raspberry Pi. Assemble the following components Effect diagram after assembling Raspberry P1 M2.5*8...
  • Page 52 Effect diagram after assembling Number the three servos and two Adeept RGB LED Modules to facilitate the next circuit connection. Servo-A Servo-B Servo-C Adeept LED RGB Module-B Adeept LED RGB Module-A...
  • Page 53 4. If you have to use the Voice Module, you need to insert it into the Raspberry Pi. Assemble the following components Insert the Voice Modul e into any of these four USB ports. Voice Module x1 Effect diagram after assembling...
  • Page 54: Install And Remove Batteries

    2.7. Install and Remove Batteries Take out 2 ribbons and 2 batteries. Roll one end of the ribbon to let through a battery and fix. Insert the batteries into the rings - ribbon closer to the anode. Install the batteries into the holder based on the pole.
  • Page 55: Circuit Connection

    2.8. Circuit Connection Connect components based on the figure. Pay attention to match the wire and port and not connect inversely.
  • Page 56: Software & Hardware

    3. Software & Hardware 3.1. Software Installation Install the Raspbian Operating System First, install the operating system for the Raspberry Pi. The official system, Raspbian, is recommended. If you've finished the installation and the system works well, you may skip this step.
  • Page 57 After it's downloaded, unzip it for later SD card system creation. Write Raspberry Pi Operating System to SD Card First, insert the SD card into the card reader and connect it to the USB port of the computer. Click open the Win32 Disk Imager and choose the path of the SD card (here it's Disk G).
  • Page 58 In the code above, replace WIFI with your own WiFi SSID name and PASSWORD with your password for the WiFi network. Save the file and change the name of the file wpa_supplicant.txt into wpa_supplicant.conf.
  • Page 59 Acquire Raspberry Pi’s IP Address Install the 18650 batteries and switch on the car. Method A: Log in to the router management page on the computer to check the address of the Raspberry Pi. Method B: Download the Network Scanner App to check the address.
  • Page 60 If a warning window prompts, click Yes.
  • Page 61: Download Program

    Then you must set up a raspberry pi yourself, by following the instructions of next chapter named Set Up a Raspberry Download the program of the PiCar-B. Input the code below to download: git clone https://github.com/adeept/Adeept_PiCar-B.git Then setup:...
  • Page 62 Set Up A Root User To change ordinary user into root user on the terminal, you need to setup up a password for the user by entering the following command in the terminal of the RPi: sudo passwd root...
  • Page 63 5.Enable I2C and Camera After the Raspberry Pi is updated, you may continue operations on it. The Adeept Motor HAT V1.0 communicates with the Raspberry Pi via the I2C port but the I2C port is disabled by default. You need to enable it: sudo raspi-config A window will pop up.
  • Page 64 Now you’ve already enabled I2C, move on to enable Camera. sudo raspi-config Click through: 5 Interfacing Options ->P1 Camera ->Yes ->OK ->Finish ->Yes Reboot the Raspberry Pi. If it does not reboot automatically, type in the following command: reboot Then the I2C and Camera module are both enabled.
  • Page 65 *Now you may wonder about the difference between apt-get install and pip install, here is the answer: pip3 is used to download and install packages directly from PyPI (Python Package Index), hosted by Python Software Foundation. It is a specialized package manager that only deals with python packages.
  • Page 66 Type in the command to download: sudo wget https://sourceforge.net/projects/cmusphinx/files/sphinxbase/5prealpha/sphinxbase-5preal pha.tar.gz/download -O sphinxbase.tar.gz sudo wget https://sourceforge.net/projects/cmusphinx/files/pocketsphinx/5prealpha/pocketsphinx-5p realpha.tar.gz/download -O pocketsphinx.tar.gz GNU Wget (or just Wget, formerly Geturl, also written as its package name, wget) is a computer program that retrieves content from web servers. It is part of the GNU Project.
  • Page 67 Compile Sphinxbase: cd sphinxbase-5prealpha ./configure –enable-fixed make sudo make install sudo pip3 install pocketsphinx Sphinxbase is a package contains the basic libraries that Pocketsphinx requires. More information: https://github.com/cmusphinx/sphinxbase ./configure scrip is responsible for getting ready to build the software on your specific system.(Get ready to build the software)
  • Page 68 Download Packages for WS_2812: sudo pip3 install rpi_ws281x rpi_ws281x is a Raspberry Pi library for controlling WS281X LEDs. Download Program for the PiCar-B git clone https://github.com/adeept/Adeept_PiCar-B.git Set AP-Hotspot Configure the Raspberry Pi as the Wi-Fi hotspot mode to build up a direct communication between the PC and the car.
  • Page 69 Check the following steps and more information from Github: https://github.com/oblique/create_ap Downloadthe code from Github to a local path for installation: git clone https://github.com/oblique/create_ap cd create_ap sudo make install Install the dependent libraries: sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq Add the RPi Car program to auto-start Creat a car.desktop to add the RPi Car program to auto-run...
  • Page 70: Install Python3.7 In The Pc

    Input to save and press Enter to confirm. Then you need to copy the set.txt /home/pi/ so that the program could find it and load settings. If you set a wrong setting and the car won’t work well, you can simply copy it again to replace the old one, and the car will go back to normal.
  • Page 71 Click through Downloads->Download Python 3.7.0. Install it after download is done. Python will configure the environment variables during the installation. *Pay attention to the 32-bit or 64-bit of your system when downloading Python - choose the corresponding Python version based on your own system.
  • Page 72 Install PyAudio Download pyaudio.whl to install PyAudio or you may install Visual C++ 14.0 to build the wheel, which takes a lot of space and time. You don’t have to install Visual C++ to build the wheel, you can down the wheel from www.lfd.uci.edu...
  • Page 73 Set the environment variable to point to the "swig" 's executable which is under the root directory of swig. Just hit and R at the same time to get command prompt. Then type sysdm.cpl, go to Advanced and select Environmental Variables.
  • Page 74 Download PocketSphinx.whl: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx case, download pocketsphinx-0.1.15-cp37-cp37m-win_amd64.whl Python3.7 Download it and save it in C:\Users\Administrator\ so you don’t have to input the path when installing it. Now you can install PocketSphinx: pip3 install pocketsphinx-0.1.15-cp37-cp37m-win_amd64.whl 6.Install OpenCV: Install numpy: pip3 install numpy...
  • Page 75: Run The Picar-B

    And then you need to install zmq and pybase64(same reason in RPi): pip3 install zmq pybase64 3.5. Run the PiCar-B Start Switch on the car. After a while, if the LEDs turn red, it means the car’s server is connected to a Wi-Fi waiting for the PC client to join.
  • Page 76 After connection, the program will save the IP address. For the next use, if the IP address of the Raspberry Pi has not changed, you may press Enter directly next time to connect. After the connection is made successfully, the Video window shows up.
  • Page 77 Press X to implement ultrasonic scanning. During this process, the car is unable to execute other actions. After the scanning is done, the results will be shown on the GUI as shown below: You may select the range of scanning in the upper scale and set the speed of car running in the bottom one.
  • Page 78 Line Following Mode The Rover can track lines and follow them, proceeding along a preset path that can be altered by moving the lines, and this part of Python program is easy to understand. You can open findline.py and learn to write it yourself.
  • Page 79 The Sphinx SR button calls the Speech Recognition program in the Rover, click it and you can directly tell the Rover what to do, it can understand simple command such as ‘forward’ ‘backward’ ‘turn left’ ‘turn right’ and ‘stop’, you can also add your own command by change the code in speech.py.
  • Page 80: Afterword

    After completing all projects in the guide, you should have some knowledge of the Raspberry Pi and Robot, thus you can try to change the robot into other projects by adding more Adeept modules or changing the code for extended functions.

Table of Contents