Advertisement

share awesome hardware

AlphaBot 2 User Manual

AlphaBot 2
User Manual
August 2017
V1.3
1

Advertisement

Table of Contents
loading

Summary of Contents for Waveshare AlphaBot 2

  • Page 1: Alphabot 2 User Manual

    AlphaBot 2 User Manual AlphaBot 2 User Manual August 2017 V1.3...
  • Page 2: To The Reader

    AlphaBot 2 User Manual 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...
  • Page 3: Recommendation

    Get details Waveshare Wiki provides detailed data of AlphaBot2, including user manual, schematic diagram, Demos, data sheet and the likes. Users can apply the product in a safe and correct matter by reading them.
  • Page 4: Table Of Contents

    AlphaBot 2 User Manual Contents AlphaBot 2 User Manual To the Reader Selection Guide Recommendation Get details Contents What’s on board? Introduction AlphaBot2-Base AlphaBot2-Ar AlphaBot2-Pi AlphaBot2-PiZero Quick start Arduino examples Raspberry Pi examples Safety Precautions Notice Please reserve the following information for future use.
  • Page 5: What's On Board

    AlphaBot 2 User Manual 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 / Raspberry Pi Zero W with different adapter boards.
  • Page 6: Alphabot2-Base

    AlphaBot 2 User Manual 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 avoiding 6. ITR20001/T: reflective infrared photoelectric sensor, for line tracking 7.
  • Page 7: Alphabot2-Ar

    AlphaBot 2 User Manual 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 Bluetooth module, remotely control the robot via Bluetooth 5.
  • Page 8: Alphabot2-Pi

    AlphaBot 2 User Manual 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.
  • Page 9: Alphabot2-Pizero

    AlphaBot 2 User Manual 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.
  • Page 10: Quick Start

    You can get the example programs described in the following sections from the website of Waveshare Wiki. To apply these examples to your application, you need to copy the file libraries under the directory of Arduino into the folder libraries under the installation directory of Arduino IDE.
  • Page 11 AlphaBot 2 User Manual 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.
  • Page 12 AlphaBot 2 User Manual 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 right, and “5”...
  • Page 13 AlphaBot 2 User Manual 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 115200. Then, the monitor displays the current measured distance.
  • Page 14 AlphaBot 2 User Manual 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 Import the library TRSensors to the file libraries under the installation directory of Arduino IDE.
  • Page 15 AlphaBot 2 User Manual 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 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.
  • Page 17 AlphaBot 2 User Manual 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 continue to run.
  • Page 18 AlphaBot 2 User Manual 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.
  • Page 19 AlphaBot 2 User Manual...
  • Page 20 AlphaBot 2 User Manual 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 the smart robot again.
  • Page 21 AlphaBot 2 User Manual 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 robot. After a few second, you can find the corresponding Bluetooth device in the list.
  • Page 22 AlphaBot 2 User Manual 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 commands according to the program.
  • Page 23 AlphaBot 2 User Manual For more information about please refer to the corresponding Dual-mode Bluetooth, 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 control smart robot (JSON formatted command) Remove the Bluetooth module, then, compile and download the program Bluetooth-json.
  • Page 24: Raspberry Pi Examples

    AlphaBot 2 User Manual 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.
  • Page 25 AlphaBot 2 User Manual 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 ain1 and ain2.
  • Page 26 AlphaBot 2 User Manual 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 the speed.
  • Page 27 AlphaBot 2 User Manual 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 straight when there is no obstacle detected by the sensor on the left, and turns right when obstacle is detected.
  • Page 28 AlphaBot 2 User Manual 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 LED flickering.
  • Page 29 AlphaBot 2 User Manual 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 the smart robot is placed on the white KT board, the data value will be in the range of 800~900.
  • Page 30 AlphaBot 2 User Manual 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 types of viewers.
  • Page 31 AlphaBot 2 User Manual 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 number: 8080 into the address bar.
  • Page 32 AlphaBot 2 User Manual 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...
  • Page 33 AlphaBot 2 User Manual 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, and keep the route described above running.
  • Page 34 AlphaBot 2 User Manual 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).
  • Page 35 AlphaBot 2 User Manual 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 changeable according to your actual condition.
  • Page 36 AlphaBot 2 User Manual 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 icon on the website can control the action of the robot.
  • Page 37 AlphaBot 2 User Manual 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 simple and effective micro python Web framework complying with WSGI.
  • Page 38 AlphaBot 2 User Manual 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 the stream port.
  • Page 39 AlphaBot 2 User Manual 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.
  • Page 40 AlphaBot 2 User Manual 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...
  • Page 41 AlphaBot 2 User Manual 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 successful.
  • Page 42 AlphaBot 2 User Manual 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 from green to blue.
  • Page 43 AlphaBot 2 User Manual 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 tutorial.
  • Page 44 AlphaBot 2 User Manual 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.
  • Page 45 AlphaBot 2 User Manual 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 Bluetooth device, similar to XX:XX:XX:XX:XX:XX.
  • Page 46 AlphaBot 2 User Manual 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 turned on, the Raspberry Pi will automatically connect to it.
  • Page 47 AlphaBot 2 User Manual 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 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...
  • Page 49 AlphaBot 2 User Manual...
  • Page 50 AlphaBot 2 User Manual 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.
  • Page 51 AlphaBot 2 User Manual 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 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.
  • Page 53 AlphaBot 2 User Manual 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 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.
  • Page 55: Safety Precautions

    AlphaBot 2 User Manual 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 batteries for power supply with input ...
  • Page 56 AlphaBot 2 User Manual 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 ...

Table of Contents