BOT120 PICAXE-20X2 MICROBOT Microbot Overview The BOT120 PICAXE 20X2 Microbot is a simple to assemble kit that uses a unique design which requires no soldering of wires to build and/or reconfigure a versatile robot. At the heart of the Microbot is a motherboard which contains a powerful PICAXE 20X2 microcontroller which can be programmed using flowcharts using the ‘Logicator for PICAXE’ software or in the PICAXE BASIC language. The Microbot can be programmed on Windows, Linux and Mac computer systems.
BOT120 PICAXE-20X2 MICROBOT Contents Microbot Overview PICAXE Programming System Microbot Power Supply BOT120 Microbot Contents List The Microbric Connector Assembly 1 – Motherboard Panel Assembly 2 – Battery Box Assembly 3 – Motor Housing Assembly 4 - Motors Assembly 5 - Wheels, Tyres and Rear Skid Assembly 6 - Line Tracker Assembly 7 – Bumper Switches Assembly 8 - Pen Holder, Servo and SRF005 Modules Fully Assembled Microbot Motor Trouble Shooting Programming Software Programming Cable Download Hard R
BOT120 PICAXE-20X2 MICROBOT BOT120 Microbot Contents List BOT120 BOT120S BOT120U Microbot Pack (software free download) Microbot Pack with AXE026 Serial Cable and software CD Microbot Pack with AXE027 USB Cable and software CD Qty Description Replacement order code 1 PCB panel containing: Microbot motherboard Bumper Modules x 2 Line Tracker Module Pen Holder Module Servo Module PCB Quarter Module PCB SRF005 Module PCB BOT120 BOT919 BOT127 BOT120 BOT123 BOT918 BOT120 2 Motors BOT900 1 1 Batte
BOT120 PICAXE-20X2 MICROBOT The Microbric Connector The Microbot is delivered as a pre-assembled panel containing the electronic modules as well a set of self-assembly mechanical parts. A unique aspect of the Microbot is that all assembly of the main parts can be completed without requiring a soldering iron or other tools apart from an Allen key. All parts of the Microbot starter pack either bolt or clip together so can be quickly and easily connected, rearranged, or removed as required.
BOT120 PICAXE-20X2 MICROBOT Assembly 1 – Motherboard Panel SRF005 Module PICAXE-20X2 Motherboard Quarter Module Servo Module Bumper Module Line Tracker Module Bumper Module Pen Holder The motherboard and other circuit board modules of the Microbot are delivered as a snap-apart panel. All panels are fully assembled and tested before leaving the factory. Each module should be snapped from the panel using a gentle pushdown and push-up action.
BOT120 PICAXE-20X2 MICROBOT Assembly 2 – Battery Box The battery box assembly consists of six components; a battery box with a lid, a base plate to mount the battery box, two M3 bolts and two M3 nuts to hold the assembly together and to the motherboard. Note that the nut and bolts are larger than the microbric nut/bolts. Align the two wires from the battery holder over the battery holder base. It is important that the two wires lay over the blue plastic.
BOT120 PICAXE-20X2 MICROBOT Assembly 3 – Motor Housing The motor housings consist of four parts; two motor mounts and two axles which transfer power from the motors to the wheels. The two axles are identical and can be used with either motor mount. Press an axle into each of the motor mounts. Make sure you face each axle in the opposite direction as shown. To fit the axle insert the short end in first and then push the long end into its slot.
BOT120 PICAXE-20X2 MICROBOT Place a motor into each of the motor housings ensuring that the motor terminals are facing the opposite way to the axle The motor housings are fitted so the axles are positioned closest to the front of the motherboard. Push the motor assemblies onto the motherboard one at a time ensuring that the motor terminals are angled and not flattened before doing so.
BOT120 PICAXE-20X2 MICROBOT Assembly 5 - Wheels, Tyres and Rear Skid The Microbot is driven by two wheels at the front and uses a skid to support itself at the rear. Each wheel has a tyre which must be fitted and the skid assembly consists of four parts; a bric, a 14mm support post, a bolt and the plastic skid itself.
BOT120 PICAXE-20X2 MICROBOT Assembly 6 - Line Tracker The Line Tracker consists of thirteen parts; the Line Tracker module, the quarter module, two connecting brics, three 14mm posts and six bolts. Ensure the Line Tracker module is the correct way up and fit one of the brics to the top of circuit board. Insert the three 14mm posts into the bric. Secure the bric and posts using three bolts from underneath the circuit board.
BOT120 PICAXE-20X2 MICROBOT Attach the line tracker assembly to the underside of the motherboard. Attach the short connecting quarter panel to the top of the bric. Then secure with three bolts. If the bolts are not firmly tightened the line tracker will not work. Note : If the top bric has been attached to the spacers incorrectly the line tracker assembly will not attach. If this is the case remove the top bric from the spacers and rotate it 180 degrees.
BOT120 PICAXE-20X2 MICROBOT Assembly 7 – Bumper Switches The front bumper of the Microbot consists of a number of parts. There are two bumper switches which consist of ten parts; a switch circuit board, a conductive polymer strip, a plastic switch cover and three bolts and three nuts to secure the switch in place.
BOT120 PICAXE-20X2 MICROBOT Repeat this procedure for the switch assembly on the other end of the bumper. Once the bumper has been assembled it can be fitted to the motherboard using the connecting bric, bolts and nuts provided. Note that the bumper assembly is fairly loose fitting when not attached to your Microbot so take care when moving it so it does not fall apart. Clipping the brics into the switch assembly first helps hold it together whilst connecting to the Microbot.
BOT120 PICAXE-20X2 MICROBOT Assembly 8 - Pen Holder, Servo and SRF005 Modules Note that the pen holder and line tracker cannot be used at the same time as they both use the centre position, and share the same 14mm posts and brics. The pen holder is used to hold a small pen (not supplied) between the wheels of the microbot, so that the microbot can draw patterns and leave a ‘trail’ on a piece of paper. These instructions assume the line tracker is currently fitted.
BOT120 PICAXE-20X2 MICROBOT Motor Trouble Shooting If while using your Microbot you find that it does not move in a straight line but instead turns to the left or right when it should be going straight, or one motor seems to turn faster than the other, it may be that the gearing within the motor housing is jamming. Remember the gears also require a small drop of grease (a tube of grease is supplied in the motherboard pack).
BOT120 PICAXE-20X2 MICROBOT Programming Software The ‘brain’ of your Microbot is a PICAXE-20X2 microcontroller. Programming of the PICAXE-20X2 microcontroller can be carried out using either flowcharts with ‘Logicator for PICAXE’ or using the PICAXE Basic programming language with the ‘PICAXE Programming Editor’ (Windows) or ‘AXEpad’ (Linux / Mac). All software can be downloaded from the software pages of the PICAXE website at www.picaxe.co.
BOT120 PICAXE-20X2 MICROBOT Download Hard Reset If your Microbot is busy doing something such as waiting for an IR Remote Control key press it may not notice you are attempting to perform a new download and the download may subsequently fail. If this happens it is necessary to perform what is known as a ‘Hard Reset’. A Hard Reset is performed by turning your Microbot’s power off using the slide switch on the motherboard, starting the download, and then turning the power back on.
BOT120 PICAXE-20X2 MICROBOT PICAXE-20X2 Microbot Pinout Table (Logicator) Pin Description Serial Out Serial Output (Diagnostics) Output 7 Right Motor Backward Output 6 Right Motor Forward Output 5 Left Motor Backward Output 4 Left Motor Forward Output 3 Right LED Eye Output 2 Piezo Sounder Output 1 Left LED Eye Output 0 Rear Centre Connector Input 7 ADC A3 Motor Current Sense Input 6 Push button switch Input 5 Motor Speed Control Input 4 Rear Left Connector Input 3 ADC A7
BOT120 PICAXE-20X2 MICROBOT PICAXE-20X2 Microbot Pinout Table (Programming Editor / AXEpad) revolution Pin Description A.0 Serial Output (Diagnostics) B.7 Right Motor Backward B.6 Right Motor Forward B.5 Left Motor Backward B.4 Left Motor Forward B.3 Right LED Eye B.2 Piezo Sounder B.1 Left LED Eye B.0 ADC1 Rear Centre Connector C.7 ADC3 Motor Current Sense C.6 Push button switch C.5 Motor Speed Control C.4 Rear Left Connector IR TX C.
BOT120 PICAXE-20X2 MICROBOT Programming Example 1 - LED Eyes The two LED eyes of your Microbot are controlled by Output Pins B.1 and B.3 of the PICAXE-20X2. Note that the LED eyes will always briefly flash when the Microbot is first switched on or after it is reprogrammed. This is to indicate that the Microbot is working correctly. After the eyes flash the Microbot will then start running the program that is stored in it’s flash memory.
BOT120 PICAXE-20X2 MICROBOT Programming Example 2 – Push Button Switch The push button is pre-fitted to the Microbot motherboard and is connected to input pin C.6. Reading pin C.6 will return a reading of 1 when the button is pushed and a value of 0 when it is not pushed. The following program tests the operation of the push button by lighting the right LED on the motherboard when the button is pushed. Sample Logicator Flowchart File: BOT120 PUSH SWITCH TEST.
BOT120 PICAXE-20X2 MICROBOT Programming Example 3 – Bumper If the front bumper has been fitted then the left bumper switch will be connected to Input Pin C.1 and the right bumper switch will be connected to Input Pin C.3. A bump on the left will set ‘Input Pin C.1’ to 1, a bump on the right will set ‘Input Pin C.3’ to 1, a central bump will set both ‘Input Pin 1’ and ‘Input Pin C.3’ to 1. The values of ‘Input Pin C.1’ and ‘Input Pin C.
BOT120 PICAXE-20X2 MICROBOT Programming Example 4 – Piezo Sounder Your Microbot motherboard has a piezo sounder connected to output pin B.2 which can be used to play a variety of tunes and sounds. The following program will play the “Happy Birthday” tune whenever the push button (input pin C.6) on the motherboard is pushed. Sample BASIC File: BOT120 PIEZO TEST1.BAS Sample Logicator Flowchart File: BOT120 PIEZO TEST1.PLF main: if pinC.6 = 1 then play B.
BOT120 PICAXE-20X2 MICROBOT Programming Example 5 – Motors By controlling the two motors of your Microbot it can be made to move about. There are four output pins used to control motor directions, left motor drive forward, left motor drive backward, right motor drive forward and right motor drive backward. Motor control pins are assigned as below: B.7 B.6 B.5 B.
BOT120 PICAXE-20X2 MICROBOT Logicator Only When using Logicator these combinations can be very simply generated by clicking the ‘movement’ buttons on the Motors cell dialog. Note also the speed selection option: Fast - always change to fast speed Slow - always change to slow speed No change - speed setting is not altered BASIC Only When using BASIC these movement combinations can be simplified by using the ‘forward’, ‘backward’ and ‘halt’ commands on each of the two motors - motor B is B.7 : B.
BOT120 PICAXE-20X2 MICROBOT This program will drive your Microbot forward until it collides with something and its bumper switches are activated. When a collision is detected, your Microbot will reverse backwards for a short distance, turn left or right, and then continue on its forward path until another collision occurs. Sample Logicator Flowchart File: BOT120 MOTOR TEST.PLF Sample BASIC File: BOT120 MOTOR TEST.BAS main: forward A forward B ; go forwards ; ; if pinC.3 = 1 if pinC.
BOT120 PICAXE-20X2 MICROBOT Programming Example 6 – Line Tracker Testing The Line Tracker module consists of a red LED which is permanently illuminated and phototransistor detector which will detect the red light reflected off the surface below. The infra-red sensor is ued as an analogue sensor to determine the amount of light reflected back from the surface it is over, which will give a measure of how white or black it is. Pin C.
BOT120 PICAXE-20X2 MICROBOT Programming Example 7 – Line Tracker Program The following program demonstrates using your Microbot as a black line follower. A suitable line can be created by sticking black insulation tape onto a pale colour background (e.g. a piece of MDF wood). Your Microbot should have the line tracker sensor fitted to the centre front connection of the motherboard ( pin C.
BOT120 PICAXE-20X2 MICROBOT BOT121 Microbot Sensors Pack BOT121 BOT121A Microbot Sensors Pack (self assembly kit) Microbot Sensor Pack (pre-assembled, no soldering) Qty Description Replacement order code 1 PCB panel containing: LDR Light Sensor (Left) LDR Light Sensor (Right) Infra-red Rceeiver (IR RX) Infra-red Tranmsitter (IR TX) x 2 BOT121 BOT121 BOT121 BOT121 2 10 7 brics bolts nuts BOT125 BOT125 BOT125 1 2 2 2 2 2 Infra-red Receiver LDR light sensors Infra-red LEDs 10k resistors (brown
BOT120 PICAXE-20X2 MICROBOT Assembly Instructions: Carefully remove all PCBs from the panels by applying a gentle rocking motion to the PCBs until they snap out of the panel. Note that in each case the bottom of the PCB is marked with the gold text label (e.g. IR RX). Infra-red Receiver (IR RX) Important - please note the resistors and infra-red receiver are physically mounted on opposite sides of the module.
BOT120 PICAXE-20X2 MICROBOT Assembly 9 - Infra-red Receiver (IR RX) Module The infra-red (IR RX) receiver module consists of eight parts, an IR circuit board which has an infra-red receiving sensor mounted upon it, a connecting bric, plus three bolts and three nuts to hold it in place. Insert the three nuts into the connecting bric Align the IR receiver circuit board with the right connector at the rear of your Microbot motherboard (position C.0), fit the connecting bric and bolt into place.
BOT120 PICAXE-20X2 MICROBOT Using the TVR010A Infra-red TV Style Remote Before use, the universal remote control must be programmed with the special ‘Sony’ transmit code. 1. Insert 2 AAA size batteries, preferably alkaline. 2. Press ‘S’ and ‘B’ at the same time. ‘S’ is in the centre of the arrows. The top left red LED should light. 3. Press ‘0’. The LED should flash. 4. Press ‘1’. The LED should flash. 5. Press ‘3’. The LED should go out. 6. Press the red power button (top right).
BOT120 PICAXE-20X2 MICROBOT Programming Example 8 – Infra-red Receiver The following program demonstrates waiting for an IR Remote Control key press and reporting what the key code value is of the key pressed. Sample Logicator Flowchart File: BOT120 INFRARED TEST.PLF Sample BASIC File: BOT120 INFRARED TEST.BAS main: irin C.0,b1 debug goto main The following flowchart waits for a Remote Control key press and then selects what to do based upon the key pressed.
BOT120 PICAXE-20X2 MICROBOT Programming Example 9 – Infra-red Transmitter By using the IR Transmitters it is possible for one Microbot to act like a Remote Control for another. By using the appropriate command it is possible to send what looks like a particular key press to every Microbot waiting to receive a Remote Control key press. Note that each IR Transmitter is controlled independently (if two transmitters are used).
BOT120 PICAXE-20X2 MICROBOT Assembly 11 - LDR Light Sensor Modules Each LDR Light Sensor module consists of eight parts, an LDR circuit board which has a LDR light sensor mounted upon it, a connecting bric, plus three bolts and three nuts to hold it in place. Remove the front bumper if currently fitted. Take care to carefully store the small components of the bumper so they are not lost. Connect the two LDRs to the front left and front right positions.
BOT120 PICAXE-20X2 MICROBOT Programming Example 11 – Light Follower The following program demonstrates using your Microbot as a light following robot. The left LDR sensor should be fitted to the front left connection point of the motherboard ( Pin C.1 / ADC 7 ) and the right LDR sensor should be fitted to the right connection point ( pin C.3 / ADC 9 ). To do this you will need to remove the bumper if it was previously connected.
BOT120 PICAXE-20X2 MICROBOT Sample BASIC File: BOT120 LIGHT FOLLOWER.BAS symbol symbol symbol symbol distance leftEyeLevel rightEyeLevel brightnessDifference = = = = w0 ‘ b1:b0 b2 b3 b4 ‘ Configure eye sensors as analogue inputs adcsetup = %1010000000 main: ‘ Read the eye sensor brightness levels readadc 7, leftEyeLevel readadc 9, rightEyeLevel ‘ Determine if there is an obstruction. Stop and wait if ‘ there is an obstruction. This uses the SRF005 (if fitted). do pause 10 pulsout C.2, 2 pulsin C.
BOT120 PICAXE-20X2 MICROBOT SRF005 Ultrasonic Range Finder Qty Description 1 1 1 Ultrasonic Range Finder 5 way right angle header 5 way straight socket Replacement order code SRF005 CON042 CON041 Also required (supplied in starter pack on motherboard panel) 1 SRF005 module PCB BOT120 Assembly: Note that the bottom of the PCB is marked with the gold text ‘SRF005’. Place the straight socket onto the top of the PCB, so that the metal pins come out the bottom. Solder in position.
BOT120 PICAXE-20X2 MICROBOT Programming Example 12 – Testing SRF005 The following program will repeatedly initiate a triggering of the ultrasound module and return the distance to an object in front of your Microbot which will be shown in the variable on the Debug screen. Sample BASIC File: BOT120 SRF005 TEST.BAS Sample Logicator Flowchart File: BOT120 SRF005 TEST.PLF #terminal 9600 main: pause 10 pulsout C.2, 2 pulsin C.
BOT120 PICAXE-20X2 MICROBOT Programming Example 13 – Using the SRF005 The following program will move the Microbot forwards until it detects an obstacle 5 cm in front of it. It will then stop until the obstacle is removed. Sample BASIC File: BOT120 SRF005.BAS Sample Logicator Flowchart File: BOT120 SRF005.PLF main: pause 10 pulsout C.2, 2 pulsin C.
BOT120 PICAXE-20X2 MICROBOT BOT123 Servo Upgrade Pack BOT123 BOT123A BOT123N Microbot Servo Pack (self assembly kit) Microbot Servo Pack (pre-assembled, no soldering) Microbot Servo Pack (self assembly kit, no servo included) Qty Description Replacement order code 1 3 1 1 1 PCB panel containing: Servo module PCB x 2 SRF005 servo adapter PCB 3 way straight header * 5 way straight socket 220 resistor (red red brown gold) 100mm servo cable BOT123 BOT123 CON035 CON041 RES-220 CAB103 2 10 7 brics
BOT120 PICAXE-20X2 MICROBOT Assembly 13 - BOT123 Servo / SRF005 Servo Adapter The SRF005 adapter is generally used in two ways: 1) mounted on top of the GBX013 servo, which is in turn stuck (e.g. using a sticky pad) to the top of the battery box. 2) Mounted directly on top of the battery box without a servo. This is generally to allow the SRF005 to connect to a rear connection point but still face forwards – e.g. to allow the SRF005 and the line follower modules to be used at the same time.
BOT120 PICAXE-20X2 MICROBOT The following program uses the ‘pulsout’ command to generate the servo pulse required to position it and the 20ms frame repeat rate the servo requires. This program also controls a servo connected to Output Pin B.
BOT120 PICAXE-20X2 MICROBOT BOT127 Line Tracker / LED Upgrade Pack Qty Description 1 PCB panel containing: Line Tracker Module Quarter Panel Adapter Module LED module BOT127 BOT127 BOT127 14mm posts brics bolts nuts BOT126 BOT125 BOT125 BOT125 3 2 10 7 Replacement order code Assembly: Carefully remove all PCBs from the panels by applying a gentle rocking motion to the PCBs until they snap out of the panel. Note that in each case the bottom of the PCB is marked with the gold text label (e.g.
BOT120 PICAXE-20X2 MICROBOT Appendix 1 - Home Made Sensors For advanced roboteers with appropriate electronics experience it is possible to build your own sensors for your Microbot. The easiest way to do this is to use the servo connector circuit board provided with the BOT120 motherboard which has a three pin header which provides direct links to the connection points on the motherboard. One servo connector is provided within the BOT120 starter pack.
BOT120 PICAXE-20X2 MICROBOT Appendix 2 - BOT120 Microbot Motherboard Schematic 1 2 3 Switched 4 Safe Power Safe Power C5 0.1uF + U1 B1 B2 TACT SWITCH S01 A1 A2 - D + FRONT-C BACK-C D Switched + Motor PWM BACK-L FRONT-R FRONT-C FRONT-L BACK-R R010 R011 R012 R013 R014 R015 R016 - V+ 3 4 5 6 7 8 9 10 1k 1k 220R 220R 220R 220R 220R 11 12 13 14 15 16 17 18 B.7 B.6 B.5 B.4 B.3 B.2 B.1 B.0 C.7 C.6 C.5 C.4 C.3 C.2 C.1 C.
BOT120 PICAXE-20X2 MICROBOT Appendix 4 - BOT121 Sensors Pack Schematic 1 2 3 4 6 5 D D Infrared Emitter A Infrared Emitter B X201Pos + Infrared Detector X202Pos + + R206 330R R201 D R202 D 33 C 33 D201 LED - D203 LED + B O GND V 220R D202 LED - LDR A IRD1 R205 D D204 LED - C IRM DETECTOR LDR B LDR201 58-0134 + D LDR202 58-0134 B D - R207 10k - R208 10k A A 1 2 3 4 5 6 4 5 6 Appendix 5 - BOT123 Servo Pack Schematic 1 2 3 D D C C SRF005 ser
BOT120 PICAXE-20X2 MICROBOT Appendix 6 - Advanced PIC (Non-PICAXE) Programming For more advanced roboteers, the Microbot has a Microchip PIC compatible ICSP connector which allows the PIC microcontroller to be programmed directly in assembly code or C. Note that if the ICSP programming capability is used, the PIC18F14K22 which the PICAXE 20X2 is based upon will have its PICAXE firmware permanently erased and it cannot be restored later.
BOT120 PICAXE-20X2 MICROBOT Appendix 7 - Copyright and Trademarks The PICAXE system, BOT120 Microbot and BOT120 manual is (c) Copyright 2010. This manual may be duplicated for non-profit, educational use in registered schools, colleges and universities. PICAXE® products are developed and distributed by Revolution Education Ltd Unit 2, Bath Business Park, Foxcote Ave, Bath, BA2 8SF, UK www.picaxe.co.uk BOT120 PICAXE Microbot is a joint venture between Revolution Education Ltd and Microbric Pty Ltd.