Advertisement

share awesome hardware

AlphaBot User Manual

AlphaBot
User Manual
Feb. 2017
V1.2
1

Advertisement

Table of Contents
loading

Summary of Contents for Waveshare AlphaBot

  • Page 1: Alphabot User Manual

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

    Note: AlphaBot requires a control board, Arduino OR Raspberry Pi, if you don't have one in hand, please consider the all-in-one kits: AlphaBot-Ar-Basic, AlphaBot-Ar-Bluetooth, AlphaBot-Pi AlphaBot-Pi Acc Pack requires the control board Raspberry Pi, if you don't have one in hand,...
  • Page 3: Recommendation

    Get details Waveshare Wiki provides detailed data of AlphaBot, 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 User Manual Contents AlphaBot User Manual To the Reader Recommendation How to get data Contents Product description Introduction Functions Features Audience On-board resource Module functions Main control module Motor driver module Power supply AD sampling chip...
  • Page 5 AlphaBot User Manual Servo Tracker module NRF24L01+wireless control Bluetooth control ZigBee control Wifi video monitoring Example programs Arduino example program Raspberry Pi example program Arduino and raspberry Pi combined control Safety Precautions Notice Please reserve the following information for future use.
  • Page 6: Product Description

    Functions AlphaBot is a robotic development platform compatible with Raspberry Pi and Arduino. It consists of the AlphaBot mainboard, the mobile chassis, and everything required to get it moving. Just connecting a controller board, Raspberry Pi or Arduino, and combined with our...
  • Page 7: Audience

    Waveshare, you can quickly study the smart robot, including the structural framework, the basic principle and the external modules. In this document, we will take the example of Waveshare AlphaBot smart robot to present the working principle and the production process of the smart robot.
  • Page 8 AlphaBot User Manual this paper. If you have any question, please don’t hesitate to visit Waveshare site http://www.waveshare.com and leave your message.
  • Page 9: On-Board Resource

    AlphaBot User Manual On-board resource Raspberry Pi interface: for connecting Raspberry Pi Arduino interface: for connecting Arduino Motor interface Ultrasonic module interface Servo module interface Obstacle avoidance module interface Speed measuring interface Battery holder: supports 18650 batteries Reserved power input (not soldered): for connecting other external power supply 10.
  • Page 10: Module Functions

    Module functions Main control module The main control module is the key part of the smart robot. AlphaBot provides Arduino and Raspberry Pi interfaces. Configuration can be one of two options, or both of them work together. By taking fully use of the hardware and software of both boards, the smart robot can be applied to much more application scenarios.
  • Page 11: Motor Driver Module

    AlphaBot User Manual Motor driver module Moter driver module is one of the most important parts of the smart robot. AlphaBot use the L298P driver chip from ST, which is a high voltage, big current motor driver chip.
  • Page 12 AlphaBot User Manual Interface definition of driver module: Interfaces Raspberry Pi Arudino IN1 and IN2 are connected to the left motor, while IN3 and IN4 are connected to the right motor. ENA and ENB are output enable pins, active high enable. When they are driven to High level, the PWM pulse will be outputted from IN1, IN2, IN3 and IN4, so as to control the speed of the motor robot.
  • Page 13: Power Supply

    For using external power supply, the input voltage should not beyond 12V. AD sampling chip Since the GPIO of raspberry Pi do not support AD function, AlphaBot smart robot has an on-board 10-bit of 11 channel AD conversion chip for tracking line...
  • Page 14 AlphaBot User Manual...
  • Page 15: Obstacle Avoidance Module

    AlphaBot User Manual Obstacle avoidance module Obstacle avoidance module consists infrared transceiver and a comparator. The infrared transmitter has an infrared array luminophor. When there is an obstacle (reflector) detection direction, the Infrared light will be reflected, and received by the infrared receiver, which is a semiconductor with a PN junction made of a special material as its core part.
  • Page 16: Speed Testing Module

    AlphaBot User Manual Speed testing module speed testing module contains a coded disc and a WYC-H206 photoelectric sensor. WYC-H206 photoelectric sensor has an infrared transmitter and an infrared receiver. When the infrared receiver is obscured, unable to receive infrared light, the sensor will output a high level voltage.
  • Page 17: Infrared Remote Control

    AlphaBot User Manual Infrared remote control The smart robot applies LFN0038K receiver to receive infrared signal. infrared remote controller provided with application kit, complies with standard NEC encoding protocol. When the infrared receiver receives the infrared signal, it will output the relative pulses to the main control chip.
  • Page 18 AlphaBot User Manual Infrared control protocol: The 32-bit binary code made up of logical “0” and logical“1” should be secondary modulated with a 38kHz robotrier frequency, in order to enhance the transmitting efficiency and reduce the power consumption. The secondary modulated code will be transmitted in the form of infrared light by a infrared transmitter, as the figure shows below.
  • Page 19: Ultrasonic Distance Measurement Module

    AlphaBot User Manual Ultrasonic distance measurement module The ultrasonic distance measurement module has 4 pins, they are VCC, GND, TRIG (transmitting pin) and ECHO (receive pin). Control theory: Here is the principle of ultrasonic distance measurement. When the ultrasonic wave meets a object, it will be reflected back and received by the receiver.
  • Page 20 AlphaBot User Manual The timing diagram above shows the control principle of ultrasonic distance measurement. When the module is working, it sends out a high level signal at least for 10us to control the pin TRIG to trigger distance measurement. Then, the module transmits 8 serial of 40kHz square wave automatically, to check whether there is echo signal.
  • Page 21 AlphaBot User Manual 5V operating current Vcc=5V 3.3V operating current Vcc=3.3V 5V minimum detection distance Vcc=5V 3.3V minimum detection distance Vcc=3.3V 5V maximum detection distance Vcc=5V 3.3V maximum detection distance Vcc=3.3V Detection angle ° Detection accuracy Resolution...
  • Page 22: Servo

    AlphaBot User Manual Servo Servo is a auto-control system with a DC motor, a reduction gear set, a sensor and a control circuit. The servo can control the rotation angle of the output axis by transmitting control signal. It has 3 control lines, the red one is the positive power line (5V), the orange one is signal line (IO) and the brown one is power ground (GND).
  • Page 23 AlphaBot User Manual control as an example, the relationship between the pulse and the rotation angle is showed as the table below. Pulse width Rotation angle 0.5ms 0 degree 1.0ms 45 degree 1.5ms 90 degree 2.0ms 135 degree 2.5ms...
  • Page 24: Tracker Module

    AlphaBot User Manual Tracker module The working principle of the tracker module is similar to the infrared obstacle avoidance module. tracker module ITR20001/T infrared reflection sensor, of which the infrared transmitter can transmit the infrared light all the time. When the infrared light is reflected back by the obstacle, it will be received by the infrared receiver.
  • Page 25 AlphaBot User Manual...
  • Page 26: Nrf24L01+Wireless Control

    AlphaBot User Manual NRF24L01+wireless control AlphaBot has a SPI interface which can connect with the NRF24L01 module, a new RF transceiver. The NRF24L01 has built-in frequency synthesizer, a power amplifier, a crystal oscillator and a modulator. With...
  • Page 27 AlphaBot User Manual declares the number of bit occupied by the address in the RF data package, enabling the NRF24L01+ to make a distinction between the data and the address; Receive channel, receive the address of data, the address from channel 0 to channel 5;...
  • Page 28: Bluetooth Control

    AlphaBot User Manual Bluetooth control AlphaBot has a UART interface, which can connect with a Bluetooth module 2.0 directly, or connect with dual Bluetooth module via the Accessory Shield module. Since the Bluetooth module is controlled via serial port, user do not need to know much about the Bluetooth protocol.
  • Page 29 AlphaBot User Manual interface is not provide in our application kit.
  • Page 30: Zigbee Control

    AlphaBot User Manual ZigBee control AlphaBot can connect with the Core2530 (B) module via Accessory Shield, to perform ZigBee control. In this configuration, the PC should be connected to the CC2530 Eval Kit (B) via a USB cable.
  • Page 31: Wifi Video Monitoring

    AlphaBot User Manual Wifi video monitoring In AlphaBot application, when raspberry Pi works as the main control part, you can use your mobile phone or PC to perform wifi video monitoring via website control. The webiopi can help you to perform the remote control, and the mjpg-streamer software can realtime display the image captured by the camera.
  • Page 32: Example Programs

    Arduino to the libraries folder under the installation directory of Arduino IDE. Then, reboot Ariduino IDE, and click File-> Example to check whether there are the options of AlphaBot, TRSensor and Servo. If there are, the library has been exported successfully. Extract the Raspberry Pi program from the package, and place it under the directory of /home/pi in the Raspbian.
  • Page 33 AlphaBot User Manual Click File -> Example -> AlphaBot -> E02_Infrared_Obstacle_Avoidance to open the project. Compile and download the program to the Arduino development board. Install the Infrared Proximity Sensors to the left side and the right side of the smart robot.
  • Page 34 AlphaBot User Manual Click File -> Example -> AlphaBot -> E04 Infrared_Remote_Control to open the project. Compile and download the program to the Arduino development board. Connect the jumper of motor in A area to the Arduino, and the jumper of the Infrared receiver IR in G area to the jumper D4 on Arduino.
  • Page 35 Then, it will move to the side that far away from the obstacle. Infrared tracking line program Click File -> Example -> AlphaBot -> E08_Infrared_Line_Tracking to open the...
  • Page 36 For more detailed information about the control theory and the algorithm, please refer to the Tracker Sensor User Manual. Bluetooth remote control program Click File-> Example -> AlphaBot -> E09_Bluetooth_Control to open the project. Compile and download the program to the Arduino development board. Install the...
  • Page 37 Connect the CC2530 Eval Kit5 development kit to your PC with a USB cable. Turn on the power adapter, and open the AlphaBot.exe on your PC, select the corresponding serial port number. Then you can control the motion of smart robot with the direction keys.
  • Page 38: Raspberry Pi Example Program

    AlphaBot User Manual Raspberry Pi example program Extract the AlphaBot.tar.gz, and place it under the directory of /home/pi in the raspbian. Before using this extension board, we should install a python library to the Raspberry Pi. For more information about the Raspberry Pi library installation and...
  • Page 39 AlphaBot User Manual Install the Infrared Proximity Sensors to the left side and the right side of the smart robot. Connect the jumpers IN1, IN2, ENA, ENB, IN3 and IN4 of motor in A area to the pins P12, P13, P6, P26, P20 and P21 of the Raspberry Pi, respectively. And connect the jumpers DL and DR of the infrared unit in E area to the pins P19 and P16.
  • Page 40 AlphaBot User Manual Infrared remote control program Connect the jumper of motor in A area to the Raspberry Pi, and the jumper of the Infrared receiver IR in G area to the pin P18. Enter the Linux terminal, and input the following lines: cd ~/AlphaBot/python sudo python Infrared_Remote_Control.py...
  • Page 41 AlphaBot User Manual obstacle. Ultrasonic Ranging program Install the steering gear and Ultrasonic module to the smart robot. Connect the jumpers TRIG, ECHO of Ultrasonic unit in D area to the pins P17 and P5 on the Raspberry Pi.
  • Page 42 AlphaBot User Manual respectively. Then, it will move to the side that far away from the obstacle. WiFi control video program This test demonstrates how to remote control the robot via webiopi, and real-time display the image captured by the camera with the software mjpg-streamer. For some browser may be unable to display the image correctly, we recommend you to use the Chrome browser or the Firefox browser.
  • Page 43 AlphaBot User Manual Check the installation: run the command webiopi –h. When the library is installed successfully, you can see the following information as the figure shown below.
  • Page 44 AlphaBot User Manual Enter the terminal, and input the line below: sudo webiopi -d -c /etc/webiopi/config 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...
  • Page 45 AlphaBot User Manual a) Run the command raspi-config to start up the camera before using it: sudo raspi-config Then, select the option Enable Camera. b) For the camera with CSI interface, the system may be unable to find out the device under the directory of /dev/video0.
  • Page 46 AlphaBot User Manual g) Start up 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. (Notices: the port number here is 8080, other than 8000 what we used before.) The website will show the information about the M-JPEG streamer.
  • Page 47 AlphaBot User Manual Under the terminal, pressing the keys Ctrl + C can end the program. However, it should be kept running, since we still need it in the following operations. Step 3. Run the robot program...
  • Page 48 AlphaBot User Manual Enter the directory of magpi-cambot, which contains the source code for controlling the robot. cd ~/AlphaBot/mjpg-AlphaBot/mjpg-AlphaBot Modify the file index.html: sudo nano index.html You should modify the html tag according to the IP of Raspberry Pi in used.
  • Page 49 If you cannot enter this webpage, we recommend you to use the Chrome browser or the Firefox browser. Furthermore, please make sure the current directory of Raspberry Pi is ~/AlphaBot/mjpg-AlphaBot/mjpg-AlphaBot and there should be a file index.html under this directory. And then, input the code sudo webiopi -c config to enter the index.html.
  • Page 50: Arduino And Raspberry Pi Combined Control

    AlphaBot User Manual Automatically start settings Replace the configuration file cd ~/AlphaBot/mjpg-AlphaBot/mjpg-AlphaBot sudo cp config /etc/webiopi/config This starts the webiopi script when system boot up. sudo update-rc.d webiopi defaults Edit the /etc/local file: sudo vi /etc/rc.local Append the following lines after the comment lines and you must make sure the “exit 0”...
  • Page 51 If you can not find it, please add the line at the end of the file. enable_uart=1 Download program to Arduino Open Arduino IDE,click File-> Example -> AlphaBot -> to open E11_mjpg-AlphaBot the project.Compile and download the program to the Arduino development board.
  • Page 52 AlphaBot User Manual the browser bar to control the smart robot. In assembling, Arduino and Raspberry Pi should not touch each other.
  • Page 53: Safety Precautions

    Please reserve the following information for future use. Caution To prevent AlphaBot, a precision device, from breaking down or being damaged, please follow the requirement listed below. The product employs two series 18650 batteries for power supply with input ...
  • Page 54 The product should not expose to water and moisture, or not be placed on  conductive surface, in the course of any operations. AlphaBot should not touch any heat source, to make sure reliability service  under normal room temperature environment Protect the printed circuit board and the components on it from mechanical or ...
  • Page 55 Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Seeed Studio 110090141 110090142 110090144 110090145 110090143...

Table of Contents