0% found this document useful (0 votes)
80 views33 pages

Bot115 Picaxe Create: Revolution

Uploaded by

abiel fernandez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views33 pages

Bot115 Picaxe Create: Revolution

Uploaded by

abiel fernandez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

BOT115 PICAXE CREATE

The PICAXE Create System is based around a PICAXE-18M2 motherboard


and various input/output modules which connect to the motherboard using
patented ‘micro-bric’ connectors. These connectors, tightened and loosened
with the supplied Allen key, are used to connect the various input/output
modules to the 13 available motherboard connectors. When the bolts are
tightened the plastic brics create both a strong mechnanical and electrical
joint, so that various circuit configurations can easily be built and adjusted
by just swapping modules around - no soldering required to reconfigure the
system!

The starter pack contains:


• PICAXE-18M2 Motherboard
• Microbric connectors and Allen Key

• Touch sensor input


• Push switch input
• Slide switch input
• DS18B20 Temperature Sensor input
• LDR input
• Infra-red Input
• Terminal block generic connector

• Infra-red output
• Piezo output
• LED output
• Darlington transistor output (e.g. for buzzer)
• L293D reversible motor driver output
• Servo Output connector
(purchase GBX013 servo separately)
• SRF005 Ultrasonic Range Finder connector
(purchase SRF005 sensor separately)
• Serial LCD connector
(purchase AXE133 or AXE133Y Serial LCD separately)

The motherboard is supplied fully assembled, the input/output modules


require soldering before first use. Once initially assembled (by the teacher)
the students do not need to do any soldering to assemble, disassemble or
reconfigure the system.

All modules are also compatible with the BOT120 Microrobot.

PICAXE Programming System


The ‘brain’ of PICAXE Create is a powerful PICAXE-18M2 micro-controller
that can be reprogrammed by the end user. Therefore the motherboard can
be easily reconfigured and then updated with new control programs as
required. For futher details about using the PICAXE system please see the
PICAXE manuals, which are available as a free download from
www.picaxe.com

This manual includes side by side examples of both ‘PICAXE BASIC’ and
‘Logicator flowchart’ programs. Either can be used to program the PICAXE
Create system.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 2

Contents
PICAXE Programming System 1
BOT115 PICAXE Create Contents List 3
PICAXE Create Power Supply 4
The Microbric Connector 4
Programming Software 5
Programming Cable 5
Download Hard Reset 6
PICAXE-18M2 Pin Connections 6
Assembly Guide - BOT116 Outputs PCB Panel 7
Assembly Guide - BOT123 Servo Outputs Pack 9
Assembly Guide - BOT117 Inputs PCB Panel 10
Assembly Guide - BOT121 Sensors PCB Panel 12
BOT127 (optional) Line Tracker / LED Upgrade Pack 14
TVR010A (optional) Infra-red TV Style Remote 15
Programming Example 1 - LED Module 16
Programming Example 2 – Push Button Switch 17
Programming Example 3 – Piezo Sounder 18
Programming Example 4 – Motors 19
Programming Example 5 – Infra-red Receiver 22
Programming Example 6 – Infra-red Transmitter 23
Programming Example 7 – LDR Light Sensor 24
Programming Example 8 – (optional) SRF005 Ultrasonic 25
Programming Example 9 – Servo 26
Appendix 1 - Making your own sensors 27
Appendix 2 - BOT115 Motherboard Schematic 28
Appendix 3 - BOT116 Output Modules Schematic 29
Appendix 4 - BOT117 Input Modules Schematic 30
Appendix 5 - BOT121 Sensors Pack Schematic 31
Appendix 6 - BOT123 Servo Pack Schematic 32
Appendix 7 - Copyright and Trademarks 33
BOT120 Microbot - the robot version motherboard!’ 33

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 3

BOT115 PICAXE Create Contents List

Qty Description Replacement


order code

1 PICAXE Create Motherboard BOT115


1 Hex screwdriver TOO063
1 Battery Clip BAT016
1 Battery Holder BAT013

40 M2 hex head bolts BOT125


40 M2 domed nuts BOT125
13 brics BOT125

Input / Output Components


1 Outputs PCB Panel BOT116
1 Inputs PCB Panel BOT117
1 Sensor PCB Panel BOT121
1 Servo PCB Panel BOT123

1 100nF capacitor CAP001


1 4 way terminal block CON006
1 3 way terminal block CON005
1 10 way header CON037
1 5 way socket CON041
2 Infrared LED LED021
1 Infrared Sensor LED020
1 Yellow LED LED003
1 1N4001 Diode RES041
1 BCX38C Transistor TRT002
1 DS18B20 Temperature Sensor ICO011
1 Miniature LDR SEN002
1 Miniature Switch SEN030
1 Minatrure Slide Switch SEN039
1 PCB Piezo SPE001
3 Resistor 33 RES-33R
1 Resistor 100 RES-100R
4 Resistor 220 RES-220R
1 Resistor 330 RES-330R
1 Resistor 4k7 RES-4k7
4 Resistor 10k RES-10k
1 16 pin IC Socket ICH016
1 L293D motor Driver ICO030

1 Buzzer SPE005
1 LCD Cable DAG002
1 Servo Cable DAG001

The full assembly instructions and program examples are


found in the manual which is a free download from:

http://www.picaxe.com/docs/bot115.pdf

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 4

PICAXE Create Power Supply


The motherboard is designed to run at 4.5V from 3 x AA size batteries
(not supplied). Good quality alkaline batteries are recommended.
Always ensure the batteries are connected the correct way around and do
not mix new and old, or different types, of batteries together.

Alternately a regulated 5V DC supply may be used.

If the motherboard fails to operate or works erratically try replacing the


batteries. Please dispose of old batteries by taking to a recycling centre.

The Microbric Connector


The motherboard is delivered as a pre-assembled panel, whilst the input/
output modules are a set of self-assembly mechanical parts.

A unique aspect of the Create system is that, once the modules have been
initally assembled, all reconfiguration of the system can be completed
without requiring a soldering iron or other tools apart from an Allen key.
All parts of the Create starter pack either bolt or clip together so can be
quickly and easily connected, rearranged, or removed as required.

The circuit boards are connected to each other using a patented plastic
‘microbric’ system. The bric has two purposes, firstly it physically holds
the modules together and secondly it provides electrical connection
between the modules.

Each bric has three holes into which nuts should be inserted to form a
complete bric assembly

Each bric has four locating posts which mount with corresponding holes
in the circuit board modules; two posts go into one board and two into
the other.

Note that the posts only allow the bric to be connected in one way.
When correctly oriented the connecting bric will fit flush to the circuit
board. If incorrectly fitted the connecting bric will be angled to the circuit
board; in this case remove the connecting bric, rotate it through 180
degrees and then refit.

When aligned correctly, bolts are then used to clamp the two modules
together and to form electrical contact from one board to the other.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 5

Programming Software
The ‘brain’ of your Microbot is a PICAXE-18M2 microcontroller.

Programming of the PICAXE-18M2 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.uk

In addition to the Microbot and your preferred software you will also
need a download cable to connect your computer to the Microbot to
download your programs. We recommend the AXE027 USB download
cable.

Programming Cable
Once the AXE027 USB download cable has been installed and you have
drawn your flowchart or written your PICAXE BASIC program you need
to connect the cable to the download socket on the motherboard. Make
sure the jack plug is fully pushed into the socket.

For further detail about the AXE027 USB cable see


www.picaxe.com/axe027

Once you have downloaded a program your motherboard will remember


that program even when it is turned off or the batteries are removed.

Don’t forget to turn your power supply during enable downloading! If


you do not turn the power on you will receive a message from your
programming software indicating the PICAXE-18M2 could not be found.
Also ensure the software is in the correct mode (PICAXE-18M2).

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 6

Download Hard Reset


If your PICAXE-18M2 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 boards power off using the
slide switch on the motherboard, starting the download, and then
turning the power back on. As the PICAXE-18M2 wakes-up it will always
check for a download request and allow the new program to be
downloaded, regardless of the program in memory.

PICAXE-18M2 Pin Connections

All circuit board modules are connected via the connector bric; bolting
the bric into place completes the electrical connection from one board to
the other.

There are 13 positions on the motherboard to which the bric can be


connected. Each position is connected to a particular PICAXE-18M2 pin.

In order to control your system you need to interact with its hardware via
programming the appropriate PICAXE-18M2 pins.

Note that the ‘Logicator for PICAXE’ flowcharting software uses a slightly
different pin naming system than the BASIC language used by
Programming Editor / AXEpad. In Logicator the portB pins are simply
called ‘outputs’ and the port C pins are simply called ‘inputs’.

PICAXE-18M2
(DAC / Touch / ADC / Out / In) C.2 1 18 C.1 (In / Out / ADC / Touch)
(SRQ / Out) Serial Out / C.3 2 17 C.0 (In / Out / ADC / Touch)
(In) Serial In / C.4 3 16 C.7 (In / Out) {kb data}
(In) C.5 4 15 C.6 (In / Out) {kb clock}
0V 5 14 +V
(SRI / Out / In) B.0 6 13 B.7 (In / Out / ADC / Touch)
(i2c sda / Touch / ADC / Out / In) B.1 7 12 B.6 (In / Out / ADC / Touch / pwm)
(hserin / Touch / ADC / Out / In) B.2 8 11 B.5 (In / Out / ADC / Touch / hserout)
(pwm / Touch / ADC / Out / In) B.3 9 10 B.4 (In / Out / ADC / Touch / i2c scl)

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 7

Assembly Guide - BOT116 Outputs PCB Panel

Qty Description Replacement


order code

1 PCB panel containing:


Piezo Output BOT116
Motor Driver BOT116
Transistor Driver BOT116
LED Output BOT116

1 100nF capacitor CAP001


1 4 way terminal block CON006
1 Yellow LED LED003
1 1N4001 Diode RES041
1 BCX38C Transistor TRT002
1 PCB Piezo SPE001
1 Resistor 33 RES-33R
1 Resistor 100 RES-100R
1 16 pin IC Socket ICH016
1 L293D motor Driver ICO030

1 Buzzer SPE005

The circuit boards of the BOT116 Outputs Pack require a small number of components
to be fitted and a small amount of simple soldering. All components required are
supplied.

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. Piezo).

Piezo Module
Solder the piezo onto the PCB (either way around) and cut the legs short.

LED Module
Place the 33 resistor (orange orange black gold) over the black text on the board so that
the legs come out the solder pads on the bottom of the board. Resistors can be placed
either way around. Solder in position and cut the legs short.
Place the long leg of the LED through the ‘red’ hole on the PCB. Solder in position and
cut the legs short.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 8

Transistor Output Module


Place the 100 resistor (brown black brown gold) over the black text on
the board so that the legs come out the solder pads on the bottom of the
board. Resistors can be placed either way around. Solder in position and
cut the legs short.
Place the 1N4001 diode in position, ensuring the grey band marked on
the diode lies over the black band marked on the PCB. Solder in position
and cut the legs short.
Place the BCX38C transistor in position, esnsuring the curved edge is
marked as on the PCB (curved side towards the microbric connection
points). Solder in position and cut the legs short.
Snap the 4 way connector block in half to create 2x 2 pole connector
blocks. Solder in position, ensuring the contacts face out.

If desired, screw the supplied buzzer into the terminal block, ensuring
the coloured wires match the coloured markers on the PCB.

Motor Driver Module


Place the 16 pin IC socket on the top of the board (side without text).
Solder in position.
Place the 100nF capacitor in position and solder in place.
Place the 2 pole connector blocks. Solder in position, ensuring the
contacts face the row of 4 identical holes.
Place the L293D chip inside the 16 pin socket, ensuring pin 1 is nearest
to the connector block.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 9

Assembly Guide - BOT123 Servo Outputs Pack

Qty Description Replacement


order code

1 PCB panel containing:


Servo module PCB x 2 BOT123
SRF005 servo adapter PCB BOT123
3 3 way straight header * CON035
1 5 way straight socket CON041
1 220 resistor (red red brown gold) RES-220
1 100mm servo cable (white wire at edge) DAG001
1 100mm LCD cable (white wire in middle) DAG002

* Please note that the 3 x 3 way headers may sometimes be supplied as 1x10
way header which needs to be simply snapped into 3 x 3 way lengths.

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.
SERVO).

Servo Module PCB


Place the 3 way header onto the top of the PCB, so that the pins come
out the bottom. Solder in position.

SRF005 Adapter
Place the 220 resistor (red red brown gold) over the black text on the top
of the board so that the legs come out the solder pads on the bottom of
the board. Resistors can be placed either way around. Solder in position
and cut the legs short.
Place the 3 way header onto the top of the PCB, so that the pins come
out the bottom. Solder in position.
Place the 5 way socket onto the top of the PCB, so that the pins come out
the bottom. Solder in position.

Using a Servo
Purchase a servo and connect it to the servo module.

Using the SRF005 Ultrasonic Range Finder


Purchase an SRF005 range finder and then insert it into the adapter PCB.
Connect the adapter PCB to the servo connector via the servo cable.

Using an AXE033 Serial LCD Module


Purchase an AXE033 and then it to the servo connector via the LCD
cable. Note the LCD cable has the white wire in the cntre at the AXE033
end.

Using an AXE133Y Serial OLED Module


Purchase an AXE133Y and then it to the servo connector via the servo
cable. Note the servo cable has the white wire at the edges at both ends.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 10

Assembly Guide - BOT117 Inputs PCB Panel

Qty Description Replacement


order code

1 PCB panel containing:


Temperature Sensor BOT117
Push switch (button) BOT117
Touch Sensor BOT117
Slide Switch BOT117
Terminal Block BOT117

1 3 way terminal block CON005


1 DS18B20 Temperature Sensor ICO011
1 Miniature Switch SEN030
1 Minatrure Slide Switch SEN039
1 Resistor 4k7 RES-4k7
1 Resistor 330 RES-330
2 Resistor 10k RES-10k

The circuit boards of the BOT117 Inputs Pack require a small number of
components to be fitted and a small amount of simple soldering. All
components required are supplied.

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.
button).

Touch Sensor Module


No assembly required.

Terminal Block Module


Solder the 3 way terminal block onto the PCB, ensuiring the contacts face
away from the microbric connector pads.

Button (push switch) Module


Place the 10k resistor (brown black orange gold) over the black text on
the board so that the legs come out the solder pads on the bottom of the
board. Resistors can be placed either way around. Solder in position and
cut the legs short.
Place the push switch in position and solder.

Slide Switch Module


Place the 10k resistor (brown black orange gold) over the black text on
the board so that the legs come out the solder pads on the bottom of the
board. Resistors can be placed either way around. Solder in position and
cut the legs short.
Place the slide switch in position and solder.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 11

Temperature Sensor Module


Place the 4k7 resistor (yellow violdet red gold) over the black text on the
board so that the legs come out the solder pads on the bottom of the
board. Place the 330 (orange orange red gold) resistor in position.
Resistors can be placed either way around. Solder in position and cut the
legs short.
Place the DS18B20 temperature sensor in position Flat edge next to the
resistors), solder in position and cut the legs short.

The optional 4 way connector is for connecting an iButton probe, part RSA001
(not supplied).

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 12

Assembly Guide - BOT121 Sensors PCB Panel

Qty Description Replacement


order code

1 PCB panel containing:


LDR Light Sensor (Left) BOT121
LDR Light Sensor (Right) BOT121
Infra-red Rceeiver (IR RX) BOT121
Infra-red Tranmsitter (IR TX) x 2 BOT121

1 Infra-red Receiver LED020


2 LDR light sensors SEN002
2 Infra-red LEDs LED021
2 10k resistors (brown black orange gold) RES-10K
2 220 resistors (red red brown gold) RES-220
2 33 resistors (orange orange black gold) RES-33

Optional (not included, purchase separately)

1 Infra-red TV style remote control TVR010A

The circuit boards of the BOT121 Sensor Pack require a small number of
components to be fitted and a small amount of simple soldering. All
components required are supplied.

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).

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 13

Infra-red Receiver (IR RX)

Important - please note the resistors and infra-red receiver are


physically mounted on opposite sides of the module.

Place the two 220 resistors (red red brown gold) over the black text on
the bottom of the board so that the legs come out the solder pads on the
top of the board. Resistors can be placed either way around. Solder in
position and cut the legs short.
Bend the infra-red receiver legs at 90 degrees so that it can lie flat on the
top of the PCB between the resistor solder joints. Solder the 3 receiver
legs on the other side of the PCB and cut the legs short.

LDR Left and LDR Right


Place the 10k resistor (brown black orange gold) over the black text on
the top of the board so that the legs come out the solder pads on the
bottom of the board. Resistors can be placed either way around. Solder
in position and cut the legs short.
Carefully bend the legs of the LDRs so that it lies in the slot on the PCB
with the legs lying over the rectangular gold pads and then through the
holes. LDRs can be placed either way around (or facing upwards if
preferred). Solder in position and cut the legs short.

Infra-red Transmitter (IR TX)


Note you may only require one IR TX (although two are provided).
In this case you may decide to use a coloured LED (not supplied)
instead of the infra-red LED on the second board to make a
different ‘home made’ output module.

Place the 33 resistor (orange orange black gold) over the black text on
the top of the board so that the legs come out the solder pads on the
bottom of the board. Resistors can be placed either way around. Solder
in position and cut the legs short.
Carefully bend the legs of the LED so that it points out at 45 degrees to
the PCB. The IR LED on the first board should always be in the position
nearest the black terminal on the bric connector point. If using two IR
LEDs make sure they point in opposite directions on the two boards. The
long leg (anode) of the LED must be placed in the red hole. Solder in
position and cut the legs short.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 14

BOT127 (optional) Line Tracker / LED Upgrade Pack

Qty Description Replacement


order code
1 PCB panel containing:
Line Tracker Module BOT127
Quarter Panel Adapter Module BOT127
LED module BOT127

3 14mm posts BOT126


2 brics BOT125
10 bolts BOT125
7 nuts BOT125

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. LED).

The line follower module is connected to the motherboard by the 3


14mm support posts. This lifts it above the motherboard so that white/
black paper can be placed underneath it.

The LED module provides an additional LED for connection to your


motherboard.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 15

TVR010A (optional) 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).

Note that buttons A, C, D, E, F and G are for setting the remote control
into different modes which are not required for using the Microbot - the
Microbot only ever uses mode B. We recommend always pressing ‘B’
before use.

Avoid pressing these other letter buttons as this will accidentally set your
remote into another mode. You can always return to the ‘B’ mode by
pressing the B button.

Note that it is quite easy to accidentally press the F and G keys


when using the arrow keys. If this happens you will need to press
B again before the arrow keys will work as expected.

When a key is pressed on the remote control the red LED in its top left
corner will light and flash and a number will be sent to the Microbot IR
receiver. These numbers will correspond to keys pressed as follows:

Symbol KEY_POWER = 21
Symbol KEY_UP = 16
Symbol KEY_DOWN = 17
Symbol KEY_RIGHT = 18
Symbol KEY_LEFT = 19

Symbol KEY_1 =0
Symbol KEY_2 =1
Symbol KEY_3 =2
Symbol KEY_4 =3
Symbol KEY_5 =4
Symbol KEY_6 =5
Symbol KEY_7 =6
Symbol KEY_8 =7
Symbol KEY_9 =8

Symbol KEY_MINUS = 98
Symbol KEY_0 =9
Symbol KEY_PLUS = 11

Symbol KEY_BAR = 96 NB: The six keys at


Symbol KEY_TENT = 54 the bottom of the
Symbol KEY_VERT_CROSS = 37 remote are not used.
Symbol KEY_DIAG_CROSS = 20

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 16

Programming Example 1 - LED Module

Connect an LED module to outputs B.1 and/or B.3.

The following flowchart will turn the left LED on for half a second, turn
that LED off and turn the right LED on for half a second and repeat.

Sample Logicator Flowchart File: Sample BASIC File:


BOT120 LED FLASH TEST.PLF BOT120 LED FLASH TEST.BAS

main:
low B.1
high B.3
pause 500
high B.1
low B.3
pause 500
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 17

Programming Example 2 – Push Button Switch

Connect the push button module to input C.6 and an LED module to
B.3. 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 an LED on the motherboard B.3 when the button is pushed.

Sample Logicator Flowchart File: Sample BASIC File:


BOT120 PUSH SWITCH TEST.PLF BOT120 PUSH SWITCH TEST.BAS

main:
if pinC.6 = 1 then
high B.3
else
low B.3
end if
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 18

Programming Example 3 – Piezo Sounder


Connect the piezo sounder module connected to output pin B.2 so that
it can be used to play a variety of tunes and sounds.

The following program will play the “Happy Birthday” tune whenever the
push button (on input pin C.6) on the motherboard is pushed.

Sample Logicator Flowchart File:


BOT120 PIEZO TEST1.PLF Sample BASIC File:
BOT120 PIEZO TEST1.BAS

main:
if pinC.6 = 1 then
play B.2,0
end if
goto main

The following program will make a two-tone beep whenever the push
button (input pin C.6) on the motherboard is pushed.

Sample Logicator Flowchart File: Sample BASIC File:


BOT120 PIEZO TEST2.PLF BOT120 PIEZO TEST2.BAS

main:
if pinC.6 = 1 then
sound B.2,(50,100,100,100)
end if
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 19

Programming Example 4 – Motors


By controlling the two motors your motherboard could be made to move
about. To do this you would need two motor driver modules, one
connected to B.3/B.4 and the other connected to B.6/B.7.

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 Right Motor Backward


B.6 Right Motor Forward
B.5 Left Motor Backward
B.4 Left Motor Forward

Each output pin is individually controllable to allow selection of any of


nine completely different robot movement combinations.
Right Right Left Left
Microbot
Motor Motor Motor Motor
Backward Forward Backward Forward
B.7 B.6 B.5 B.4

Halt Low Low Low Low

Forward Low High Low High

Backward High Low High Low

Turn Left Low High High Low

Turn Right High Low Low High

Veer Left
Low High Low Low
Forward
Veer Left
Low Low High Low
Backward
Veer Right
Low Low Low High
Forward
Veer Right
High Low Low Low
Backward

A ‘turn’ movement is an ‘on the spot spin’ when one motor is switched
forward and the other backward.

A ‘veer’ movement is created by only switching one motor on at a time.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 20

Logicator Only

When using Logicator these combinations can be very simply


generated by clicking the ‘movement’ buttons on the Motors cell
dialog.

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.6 and motor A is B.5 : B.4 Right Left
Microbot
Motor (B) Motor (A)

; Exampe to Move Microbot Forwards


forward A ; Set Motor A Forward
forward B ; Set Motor B Forward Halt Halt B Halt A

Forward Forward B Forward A

Backward Forward B Backward A

Turn Left Backward B Backward A

Turn Right Backward B Forward A

Veer Left
Forward B Halt A
Forward
Veer Left
Halt B Backward A
Backward
Veer Right
Halt B Forward A
Forward
Veer Right
Backward B Halt A
Backward

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 21

Sample Logicator Flowchart File:


BOT120 MOTOR TEST.PLF

Sample BASIC File:


BOT120 MOTOR TEST.BAS

main:
forward A ; go forwards
forward B
; test bumpers
; to see if hit
if pinC.2 = 1 then doLeft
if pinC.1 = 1 then doRight
goto main

doLeft:
backward A ; reverse for 0.5s
backward B
sound B.2,(50,100) ; beep
pause 500
forward A ; turn for 0.32s
backward B
pause 320
goto main

doRight:
backward A ; reverse for 0.5s
backward B
sound B.2,(100,100) ; beep
pause 500
backward A ; turn for 0.32s
forward B
pause 320
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 22

Programming Example 5 – Infra-red Receiver


Connect the IR RX Module to input C.0.
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

Sample BASIC File:


The following flowchart waits for a Remote Control key press and BOT120 INFRARED.BAS
then selects what to do based upon the key pressed. The Microbot
will continue to do as instructed until another key is pressed. symbol KEY_UP = 16
symbol KEY_DOWN = 17
Sample Logicator Flowchart File: symbol KEY_LEFT = 19
BOT120 INFRARED.PLF symbol KEY_RIGHT = 18
symbol KEY_MINUS = 98
symbol KEY_PLUS = 11
symbol KEY_DIAG_CROSS = 20

main:
irin C.0, b1
select case b1
case KEY_UP
forward A
forward B
case KEY_DOWN
backward A
backward B
case KEY_LEFT
backward A
forward B
case KEY_RIGHT
forward A
backward B
case KEY_MINUS
low B.1, B.3
case KEY_PLUS
high B.1, B.3
case KEY_DIAG_CROSS
halt A
halt B
end select
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 23

Programming Example 6 – Infra-red Transmitter


By using the IR Transmitters it is possible for one motherboard to act like
a Remote Control for another.

Connect an IR transmitter (TX) board to pin B.0

To check the IR Transmitters are working fully you will need two
Microbots, one sending and one receiving and reporting what it has
received. The operation of the IR transmitters is invisible to the human
eye but can usually be observed by using a PC webcam, mobile phone
camera or camcorder.

Take care not to place any webcam, digital camera or camcorder too close
to the IR LEDs to view their operation as this may permanently damage
the image sensors. Observing the IR LEDs in this manner is undertaken
entirely at your own risk.

The following flowchart will use an IR transmitter connected to


the B.0 on the motherboard to act as an automated remote
control which can control one (or more) other motherboard
which has been programmed to respond to remote control key
presses as in the previous infra-red receiving program.

The program repeatedly sends out a simulated up arrow press followed


by a down arrow press every five seconds. The receiving Microbot will
therefore move forwards for 5 seconds and then backwards for 5 seconds.

Sample Logicator Flowchart File: Sample BASIC File:


BOT120 INFRA TRANSMIT.PLF BOT120 INFRA TRANSMIT.BAS

symbol KEY_UP = 16
symbol KEY_DOWN = 17

main:
irout B.0, 1, KEY_UP
pause 5000
irout B.0, 1, KEY_DOWN
pause 5000
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 24

Programming Example 7 – LDR Light Sensor

Connect an LDR light sensor module to input C.1

To determine the light intensity on each LDR perform an analogue read


of the appropriate analogue channel. The LDR sensors will give a higher
reading for a higher light intensity.

Sample Logicator Flowchart File: Sample BASIC File:


BOT120 LDR TEST.PLF BOT120 LDR TEST.BAS

main:
readadc C.1,b7
debug
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 25

Programming Example 8 – (optional) SRF005 Ultrasonic


Connect the SRF005 Ultrasonic module, via the servo cable and servo
module, to pin C.2

The following program will repeatedly initiate a triggering of the


ultrasound module and return the distance to an object in front of your
SRF005. Distance will be shown in the variable on the Debug screen.

Sample BASIC File:


Sample Logicator Flowchart File:
BOT120 SRF005 TEST.BAS
BOT120 SRF005 TEST.PLF

#terminal 9600
main:
pause 10
pulsout C.2, 2
pulsin C.2, 1, w0
w1 = w0 * 10 / 58 ; Convert to cm
w2 = w0 * 10 / 148 ; Convert to inches
sertxd(“Distance is “, #w1, “cm”,CR,LF)
sertxd(“Distance is “, #w2, “inch”,CR,LF)
goto main

Understanding how the SRF005 sensor works.

For Logicator flowcharts use of the SRF005 is very simple, as all the ‘hard
work’ is carried out automatically via the ‘ultra’ command cell. The
BASIC program is slightly more complex.

The Ultrasound Module is controlled by a single pin which both initiates


an ultrasonic ‘ping’ and receives an echoed ‘pong’. The length of the
returned pulse corresponds to the distance to the object.

The millisecond pulse length value returned by the SRF005 command


can be converted to centimetres by dividing by 58 and converted to
inches by dividing by 148. As the base unit of the PICAXE-20X2 ‘pulsin’
command is actually 10ms, the pulsin value also needs to be multipled
by 10 prior to dividing.

Note that there should be at least a 10ms pause between each triggering
of the SRF005 Ultrasound Module.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 26

Programming Example 9 – Servo


With the (optional) servo connected to the centre rear connector of the
motherboard it will be controlled by output Pin B.0.

The following program will turn a connected servo from left to right
switching every two seconds.

Sample Logicator Flowchart File:


BOT120 SERVO TEST.PLF

Sample BASIC File:


BOT120 SERVO TEST.BAS

main:
servo B.0, 100
pause 2000
servo B.0, 200
pause 2000
goto main

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 27

Appendix 1 - Making your own sensors

For advanced roboteers with appropriate electronics experience it is


possible to build your own sensors for your motherboard. The easiest
way to do this is to use the servo connector module which has a three
pin header which provides direct links to the connection points on the
motherboard.

Note the order of the connection point contacts on the servo header:

Pin 1 (Gold) Signal Input or Output


Pin 2 (Red) +V Power from motherboard (4.5V)
Pin 3 (Black) 0V 0V from motherboard

Note that the motherboard has 220 ohm series protection resistors on all
signal lines on the motherboard (see the circuit diagram in the appendix
2). This must be accounted for when designing home made circuits.

The maximum output sink/source current of any i/o pin is 20mA, with a
maximum total load of 90mA for all output devices. Exceeding these
values may permanently damage your motherboard.

The full assembly instructions and


program examples are found in the
Microbot manual which is a free
download from:

www.rev-ed.co.uk/docs/bot120.pdf

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 28

Appendix 2 - BOT115 Motherboard Schematic

1 2 3 4 5 6

D D

C.7 C.6 C.2 C.1 C.0


OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1

D
+

-
C.7 C.6 C.2 C.1 C.0

5V 5V 5V 5V 5V

5V

5V +

OUTSIDE EDGE 1-1-1


J1 S1
2

B.7
SW SPDT B.7 D
1
CON2 C1
CAPACITOR
-
C C

5V

OUTSIDE EDGE 1-1-1


5V

B.6
B.6 D
J2
R2 C2
22k CAP
-
PHONEJACK2
R1 5V 5V
10k RP1 U1 RP2
C.2 1 16 1 16 C.1 5V
1 18
2 15 2 15 C.0

OUTSIDE EDGE 1-1-1


2 17
3 14 3 14 C.7 +
3 16
4 13 4 13 C.6
4 15
B.0 5 12 5 12 B.7
D1 B.1 6 5 14
11 6 11 B.6
LED B.2 7 6 13

B.5
10 7 10 B.5 B.5 D
7 12
B.3 8 9 8 9 B.4
B 8 11 B
9 10
220 x 8 220 x 8
PICAXE18M2 -

5V 5V 5V 5V 5V
B.0 B.1 B.2 B.3 B.4
+

+
-

-
D

D
B.0 B.1 B.2 B.3 B.4
OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1 OUTSIDE EDGE 1-1-1

A A

1 2 3 4 5 6

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 29

Appendix 3 - BOT116 Output Modules Schematic

1 2 3 4 5 6

D D

Piezo L293D Motor Driver

X201Pos
+ +

P1
D 1 D
1
2
2
U1
Piezo 1 16
- -
2 15
J2
3 14
4 13 C1 1
5 12 100nF 2
C 6 11 C
Terminal Block
7 10
8 9
+
L293D

Transistor Output D

J1
Terminal Block
2

-
D1
1
A K

1N4001
2
1

D R1 Q1
100 BCX38C

-
B B

A A

1 2 3 4 5 6

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 30

Appendix 4 - BOT117 Input Modules Schematic

1 2 3 4 5 6

D D

Touch Sensor Terminal Block


Slide Switch
X201 X202 X203
INSIDE EDGE 1-1-1

INSIDE EDGE 1-1-1

INSIDE EDGE 1-1-1


X201Pos
+ + +

J1
S1
+
D Touch Pad D D
D
C - C
R1 SW SPDT Terminal
X201Neg
- - 10k -

Temperature sensor/1-wire adaptor


Push Switch R4
330
X204 X205
INSIDE EDGE 1-1-1

INSIDE EDGE 1-1-1

+ + R3
TACT SWITCH 4k7
B J2 B
S01 U1
B1 A1 1 LED+
VDD
D B2 A2 D 2 LED-
DQ
3 1-wire
GND
4 0V
R2 DS18B20
1-wire header
- 10k -

A A

1 2 3 4 5 6

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 31

Appendix 5 - BOT121 Sensors Pack Schematic

1 2 3 4 5 6

D D

Infrared Emitter A Infrared Emitter B Infrared Detector

X201Pos
+ X202Pos
+ + R206
330R
IRD1
D R201 D R202 D R205
O
33 33 220R GND
V
C D201 D203 D202 D204 C
- - - IRM DETECTOR
LED LED LED LED

LDR A LDR B

LDR201 LDR202
+ 58-0134 + 58-0134

B B
D D

- R207 - R208
10k 10k

A A

1 2 3 4 5 6

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 32

Appendix 6 - BOT123 Servo Pack Schematic

1 2 3 4 5 6

D D

C C

SRF005 servo adaptor PCB Servo module Servo module

+ +

5
4 1 1 1
220 D D
3 2 2 2
2 3 3 3
1 Servo Servo Servo
SRF005 - -

B B

A A

1 2 3 4 5 6

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD
BOT115 PICAXE Create 33

Appendix 7 - Copyright and Trademarks


The PICAXE system, BOT115 Create and BOT115 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.com

BOT115 PICAXE Create is a joint venture between Revolution Education


Ltd and Microbric Pty Ltd.
Microbric Pty Ltd
PO Box 8052, Grange, SA 5022, Australia
www.microbric.com

PICAXE® is a registered trademark licensed by Microchip Technology Inc.


Revolution Education is not an agent or representative of Microchip
and has no authority to bind Microchip in any way.

BOT120 Microbot - the robot version motherboard!’


If you enjoyed the create Motherboard you may also be interested in
Microbot - a programmable robot. Modules are interchangeable between
the two models so you can combine kits for more interesting creations!

Fore more details visit www.picaxe.com or contact your local reseller,


asking for part ‘BOT120 PICAXE-20X2 Microbot’.

revolution (c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.0 11/11
BOT115.PMD

You might also like