Waveshare AlphaBot 2 User Manual

Summary of AlphaBot 2

  • Page 1

    Alphabot 2 user manual 1 share awesome hardware alphabot 2 user manual august 2017 v1.3.

  • Page 2: To The Reader

    Alphabot 2 user manual 2 share awesome hardware to the reader selection guide note: accessories may be different in different product package. This manual describes all the compatible accessories but perhaps the product you bought doesn’t contain some of them. The figure below shows most the compati...

  • Page 3: Recommendation

    Alphabot 2 user manual 3 share awesome hardware recommendation reading this document can be a challenge for a freshman. We advise that the reader need to have some knowledge of the programming in raspberry pi python or arduino, which can be helpful for understanding the programming fundamentals. Due...

  • Page 4: Contents

    Alphabot 2 user manual 4 share awesome hardware contents alphabot 2 user manual 1 to the reader 2 selection guide 2 recommendation 3 get details 3 contents 4 what’s on board? 5 introduction 5 alphabot2-base 6 alphabot2-ar 7 alphabot2-pi 8 alphabot2-pizero 9 quick start 10 arduino examples 10 raspber...

  • Page 5: What’S On Board?

    Alphabot 2 user manual 5 share awesome hardware what’s on board? Introduction alphabot2 robot kits includes a chassis (alphabot2-base chassis) and an adapter board (one of the adapter boards alphabot2-ar / alphabot2-pi / alphabot2-pizero). The robot supports arduino / raspberry pi 3 model b / raspbe...

  • Page 6: Alphabot2-Base

    Alphabot 2 user manual 6 share awesome hardware alphabot2-base 1. Alphabot2 control interface: for connecting sorts of controller adapter board 2. Ultrasonic module interface 3. Obstacle avoiding indicators 4. Omni-direction wheel 5. St188: reflective infrared photoelectric sensor, for obstacle avoi...

  • Page 7: Alphabot2-Ar

    Alphabot 2 user manual 7 share awesome hardware alphabot2-ar 1. Alphabot2 control interface: for connecting alphabot2-base 2. Arduino expansion header: for connecting arduino shields 3. Arduino interface: for connecting arduino compatible controller 4. Xbee connector: for connecting dual-mode blueto...

  • Page 8: Alphabot2-Pi

    Alphabot 2 user manual 8 share awesome hardware alphabot2-pi 1. Alphabot2 control interface: for connecting alphabot2-base 2. Raspberry pi interface: for connecting raspberry pi 3 model b 3. Servo interface 4. Usb to uart: easy for controlling the pi via uart 5. Lm2596: 5v voltage regulator 6. Tlc15...

  • Page 9: Alphabot2-Pizero

    Alphabot 2 user manual 9 share awesome hardware alphabot2-pizero 1. Alphabot2 control interface: for connecting alphabot2-base 2. Lm2596: 5v voltage regulator 3. Raspberry pi interface: for connecting raspberry pi zero/zero w 4. Ir receiver 5. Buzzer 6. Fe1.1s: usb hub chip 7. 12m crystal 8. Usb to ...

  • Page 10: Quick Start

    Alphabot 2 user manual 10 share awesome hardware quick start we have provided the control programs for arduino and raspberry pi, which can implement many functions, such as tracking, obstacle avoidance, remote control, video monitoring and so on. You can get the example programs described in the fol...

  • Page 11

    Alphabot 2 user manual 11 share awesome hardware settings in the demos, like: 5-way joystick compile and download the program joystick. This joystick has 5 control directions: up, down, left, right and center (enter). Open the serial monitor, and set the baud rate to 115200. Then, the monitor displa...

  • Page 12

    Alphabot 2 user manual 12 share awesome hardware infrared remote control compile and download the program ir. You can control the smart robot by pressing down the numeric keys on the infrared remote controller, in which, “2”is for go forwards, “8” for go backwards, “4” for turn left, “6” for turn ri...

  • Page 13

    Alphabot 2 user manual 13 share awesome hardware in this example, the robot goes straight when there is no obstacle, and turns right when obstacle is detected. Ultrasonic distance measurement compile and download the program ultrasonic_ranging. Open the serial monitor, and set the baud rate to 11520...

  • Page 14

    Alphabot 2 user manual 14 share awesome hardware ultrasonic infrared obstacle avoidance compile and download the program ultrasonic-infrared-obstacle-avoidance. In this example, the robot goes straight when there is no obstacle, and turns right when obstacle is detected. Tracker sensor testing impor...

  • Page 15

    Alphabot 2 user manual 15 share awesome hardware sensor. And then, the measured values of sensors are displayed as well. The larger value means the deeper color. The last column of values indicate the position of the black line, in which “2000” means the black line is in the middle of the robot, “0”...

  • Page 16

    Alphabot 2 user manual 16 share awesome hardware have a direct influence to the tracking line capability of the robot. When the wheels of the robot begin to move, you can release the robot and it will run along with the black line. Rgb leds compile and download the program w2812. There are 4 rgbn le...

  • Page 17

    Alphabot 2 user manual 17 share awesome hardware pressing down the key again, the smart robot runs along with the black line, and the rgb led shows different colors. When there is an obstacle detected, the smart robot stops and the buzzer sounds. When the obstacle disappears, the smart robot continu...

  • Page 18

    Alphabot 2 user manual 18 share awesome hardware robot runs to the end along with the shortest route. Here are some requirements in making the maze: the corner should be a right angle, and the maze should not has any loop. About the program: when the smart robot detects any corner, it will slow down...

  • Page 19

    Alphabot 2 user manual 19 share awesome hardware.

  • Page 20

    Alphabot 2 user manual 20 share awesome hardware bluetooth control smart robot compile and download the program bluetooth. You should remove the bluetooth module from the smart robot before downloading, or else the program cannot be loaded. When finished, you should insert the bluetooth module to th...

  • Page 21

    Alphabot 2 user manual 21 share awesome hardware communicate with the module, and iphone4s or above is required. For android, bluetooth edr is applied. Startup the app, and click the option “scan” (note: turn on the bluetooth on your mobile phone). Then, insert the bluetooth module to the smart robo...

  • Page 22

    Alphabot 2 user manual 22 share awesome hardware note: if your android mobile phone support bluetooth ble as well, it will scan two devices. At this moment, please select the device with the mac address of 00:0e:0e. Select “remote control mode”, and click the option settings to configure the command...

  • Page 23

    Alphabot 2 user manual 23 share awesome hardware for more information about dual-mode bluetooth, please refer to the corresponding user manual chinese user manual: http://www.Waveshare.Net/wiki/dual-mode_bluetooth english user manual: http://www.Waveshare.Com/wiki/dual-mode_bluetooth bluetooth contr...

  • Page 24: Raspberry Pi Examples

    Alphabot 2 user manual 24 share awesome hardware raspberry pi examples extract the package alphabot2.Tar.Gz and place it to the directory of /home/pi under raspbian system. Before using this extension board, you should install the library python to your raspberry pi. In case that the example is unab...

  • Page 25

    Alphabot 2 user manual 25 share awesome hardware in case that the direction of motion is wrong, you may need to modify the motor wring or change the pin settings in your program. We recommend the latter one. If left wheels of the robot run in a wrong direction, you should exchange the settings of ai...

  • Page 26

    Alphabot 2 user manual 26 share awesome hardware keys on the infrared remote controller, in which, “2”is for go forwards, “8” for go backwards, “4” for turn left, “6” for turn right, and “5” for stop. Keys “-“ and “+” can adjust the speed of the robot , and “eq” can restore the default setting of th...

  • Page 27

    Alphabot 2 user manual 27 share awesome hardware ultrasonic distance measurement (raspberry pi 3b kit does not contain ultrasonic unit) enter the linux terminal, and input the following commands: cd ~/alphabot2/python sudo python infrared_obstacle_avoidance.Py expectation result: the robot goes stra...

  • Page 28

    Alphabot 2 user manual 28 share awesome hardware run the following command to perform the testing, you can see the rgb led flickering. Sudo ./test enter the commands below to install the library python. Cd python sudo python setup.Py install run the library python for testing, you can see the rgb le...

  • Page 29

    Alphabot 2 user manual 29 share awesome hardware tracker sensor testing enter the linux terminal, and input the following commands: cd ~/alphabot2/python sudo python trsensors.Py expectation result: you can see five set of data printed on the terminal, they are corresponding to five sensors. When th...

  • Page 30

    Alphabot 2 user manual 30 share awesome hardware expectation result::the servo will move to left and right, and its rotational range can reach 180 degree. Mjpg-streamer software real-time monitoring "mjpg-streamer" takes jpge from the web camera, and streams them over an ip-based network to various ...

  • Page 31

    Alphabot 2 user manual 31 share awesome hardware the software mjpg-streamer in the program has been compiled. You only need to run the following lines to start up the mjpg-streamer: cd alphabot2/lib/mjpg-streamer sudo ./start.Sh then, open the browser, and enter the ip address of rpi and the port nu...

  • Page 32

    Alphabot 2 user manual 32 share awesome hardware under the terminal, pressing the keys ctrl + c can end the program. However, we recommend you to keep the program running, since we still need it in the following operations. Remote control via webiopi webiopi is a web framework that can control gpio ...

  • Page 33

    Alphabot 2 user manual 33 share awesome hardware http://webiopi.Trouch.Com/ however, this software is no longer to be updated after the version 0.7.1. The software here we provided is the improvement version, able to support raspberry pi 3b. To install the webiopi, you should open a new terminal, an...

  • Page 34

    Alphabot 2 user manual 34 share awesome hardware then, open the browser on your pc or cell phone, and enter the ip address of rpi and the port number: 8000 into the address bar. For example, input http://192.168.1.16:8000 (the address can be changeable according to your actual condition). To login t...

  • Page 35

    Alphabot 2 user manual 35 share awesome hardware enter the directory of mjpg-alphabot, and modify the video source ip. Cd ~/alphabot2/mjpg-alphabot/ sudo nano index.Html find out the link: http://192.168.10.235:8080/?Action=stream in here, 192.168.10.235 is the ip address of rpi, and it can be chang...

  • Page 36

    Alphabot 2 user manual 36 share awesome hardware then, open the browser, and enter the ip address of rpi and the port number: 8000 into the address bar. (notices: the port number here is 8000, other than 8080.) the image captured by the camera will be shown in the website. Clicking the direction ico...

  • Page 37

    Alphabot 2 user manual 37 share awesome hardware sudo vi /etc/rc.Local add the commands following the comments. Please make sure the line exit 0 is the last line. And then, save the modification and exit. Cd /home/pi/alphabot2/lib/mjpg-streamer sudo ./start.Sh & remote control via bottle bottle is a...

  • Page 38

    Alphabot 2 user manual 38 share awesome hardware to implement web video control the smart robot by bottle, you should modify the ip address for the video stream. Cd ~/alphabot2/web-control vi index.Html find out the line below, and change the ip address to the actual rpi address and set the port to ...

  • Page 39

    Alphabot 2 user manual 39 share awesome hardware you can see the following webpage. Clicking the direction icon on the website can control the action of the robot . You can set the program to be started up on boot. Open the file /etc/rc.Local with your editor and add the following line into it. Sudo...

  • Page 40

    Alphabot 2 user manual 40 share awesome hardware since the raspberry pi uses dynamic ip which may change each time the device restart, you can add the following lines under the directory of /etc/dhcpcd.Comf to set the static ip: interface wlan0 static ip_address = 192.168.1.114/24 static routers = 1...

  • Page 41

    Alphabot 2 user manual 41 share awesome hardware click the button viedeo connet to connect to the video. When the connection is built up, the button will turn to green. Then, click the button cmd connect to connect to the smart robot sever. You will see the button turn to green, if the connection is...

  • Page 42

    Alphabot 2 user manual 42 share awesome hardware enter the actual ip address of rpi, and click the button connect. Then, you can see the images captured by the camera. Next, click the button connect under the image. When the control port has been connected to the program, this button will change fro...

  • Page 43

    Alphabot 2 user manual 43 share awesome hardware you should connect the raspberry pi to the router at every restart. Of course, you can enable the ap function of the rpi wireless network adapter, taking the rpi as sever. For more information about the operation, please refer to the raspberry pi tuto...

  • Page 44

    Alphabot 2 user manual 44 share awesome hardware after restarted the rpi, enter the command hciconfig (similar to the command ifconfig) to check the bluetooth service. If the bluetooth has been working, you will see the device hci0 displayed on the screen. When the bluetooth does not work, no blueto...

  • Page 45

    Alphabot 2 user manual 45 share awesome hardware agent on after entered the interface, input the following lines (you can input the command help to check the command list after entered the interface). Agent on default-agent following the scan on, you can see the physical address of the scanned bluet...

  • Page 46

    Alphabot 2 user manual 46 share awesome hardware when pairing is successful, add the device to the trust list. Trust xx:xx:xx:xx:xx:xx next, connect to the device. Connect xx:xx:xx:xx:xx:xx at last, enter the command quit to exit the interface. After the settings above, as the bluetooth device is tu...

  • Page 47

    Alphabot 2 user manual 47 share awesome hardware enter the graphic interface to make the connection. Click the bluetooth icon and add new device. Select the corresponding bluetooth device. Please make sure the bluetooth on the mobile phone should be enable and set to discoverable..

  • Page 48

    Alphabot 2 user manual 48 share awesome hardware on the rpi, select the option ok for pairing. And at the same time, on the mobile phone, click the option pair. Then, you may see the prompt saying that “paired successfully, but this device has no services which can be used with raspberry pi.”.

  • Page 49

    Alphabot 2 user manual 49 share awesome hardware.

  • Page 50

    Alphabot 2 user manual 50 share awesome hardware now, the connection has been built up. Run the following commands to start the program: cd /alphabot2/bluetooth-control sudo rfcomm watch hci0 1 python bluetooth.Py then, scan the qr code below with your mobile phone, and download the relative app. (t...

  • Page 51

    Alphabot 2 user manual 51 share awesome hardware if the bluetooth of the raspberry pi can not be searched, you can run the following lines to enable the bluetooth and set it to discoverable..

  • Page 52: Faq

    Alphabot 2 user manual 52 share awesome hardware faq question 1: comparing with alphabot, is there any improvement on alphabot2? Answer: alphabot2 has a smarter dimensions and more stable structure. Sensors are highly integrated in it. High-precision metal motor with low noise. Tb6612fng motor drive...

  • Page 53

    Alphabot 2 user manual 53 share awesome hardware lowest voltage should not be lower than 2.75v, or else the battery may be permanently damaged. This battery has a same dimensions with aa battery. But you should not use the aa battery to replace it, since the aa battery cannot provide enough voltage....

  • Page 54

    Alphabot 2 user manual 54 share awesome hardware question 6: how to know if the battery has power? Answer: if there is low battery, the smart robot will move slowly. Normally, when the raspberry pi shuts down or become unable to connect, you should charge the battery. When the battery voltage is low...

  • Page 55: Safety Precautions

    Alphabot 2 user manual 55 share awesome hardware safety precautions notice please reserve the following information for future use. Caution to prevent alphabot2, a precision device, from breaking down or being damaged, please follow the requirement listed below. The product employs two series 14500 ...

  • Page 56

    Alphabot 2 user manual 56 share awesome hardware protect the printed circuit board and the components on it from mechanical or electrical damages, in the course of any operations. Avoid touching the energized printed circuit board in the course of any operations. Touching the edge of the board is al...