background image

RoboPi v1.00

User Manual v0.85

Copyright 2014 William Henning

RoboPi Expansion Connectors

Raspberry Pi I/O header pins

RoboPi requires exclusive use of RX/TX

RoboPi makes the Raspberry Pi I2C available on a Mikronauts four-pin 3v3 I2C header

All other Raspberry Pi I/O pins are available for your use

Mikronauts 

EZasPi

 was designed to stack between RoboPi and Raspberry Pi for expansion

Mikronauts 

EZasPi (B)

 was designed to stack below the Raspberry Pi for more expansion

EXP1/EXP2/EXP3 3v3 Expansion Connectors

EXP1 is for Propeller pins P0-P7, and servo connectors 1-8

EXP2 is for Propeller pins P8-P15, and servo connectors 9-16

EXP3 is for Propeller pins P16-P23, and sensor connectors 1-8

Mikronauts 3v3 10 pin modules can be used in EXP1/EXP2/EXP3

You must not use the 3 pin servo connectors for pins used by a 10 pin module

PI-I2C Header

For using 3v3 I2C expansion modules with RoboPi

PROP-I2C Header

For using 3v3 I2C expansion modules with the Raspberry Pi

PROPPLUG Header

For programming RoboPi when it is not mounted on a Raspberry Pi

Intended for stand-alone RoboPi applications

DO NOT USE WHEN MOUNTED ON A RASPBERRY PI

http://Mikronauts.com

7

2014-01-27

Summary of Contents for RoboPi

Page 1: ...Henning Using RoboPi Copyright 2014 William Henning RoboPi User Manual v0 85 Photo 1 Fully assembled RoboPi v1 00 The most up to date documentation will always be available at http www mikronauts com...

Page 2: ...ep 4 Using the Raspberry Pi serial port with RoboPi 9 Step 5 Installing RoboPiLib 10 Step 6 Installing the RoboPi Firmware 10 Step 7 Installing SimpleIDE for the Raspberry Pi OPTIONAL 10 Introducing R...

Page 3: ...2 Why the ENABLE signal of three wire drivers is useful 23 Two pin motor driver sample code 24 How to Read Analog Distance Sensors 26 How to Read Digital Ultrasonic Range Sensors 27 Supported Ultrason...

Page 4: ...r selectable power from Pi s 5VDC supply or external servo power supply P8 P15 jumper selectable power from Pi s 5VDC supply or external servo power supply P16 P23 is powered by 5V from the Pi expansi...

Page 5: ...ile wiring your robot after assembling your RoboPi PLEASE NOTE The PROPPLUG connection is for stand alone RoboPi operation where RoboPi is NOT stacked on top of a Raspberry Pi Pins 1 4 are the same as...

Page 6: ...processor pins 3v3 I O only connects to signal pin on SERVO9 16 through a 2k4 current limiting resistor 5V I O safe For the servo header SV3 selects between the Pi s 5V and VBat from the screw termina...

Page 7: ...EXP3 3v3 Expansion Connectors EXP1 is for Propeller pins P0 P7 and servo connectors 1 8 EXP2 is for Propeller pins P8 P15 and servo connectors 9 16 EXP3 is for Propeller pins P16 P23 and sensor connec...

Page 8: ...ters to make a bootable Raspbian SD card Step 1 Get a compatible Class 10 speed SD card 8GB 32GB in size You can find a database of SD cards that are known to work with the Raspberry Pi at http elinux...

Page 9: ...isplay boot messages after which it becomes a serial console My favorite small text editor is joe which you can install with sudo apt get install joe then sudo joe boot cmdline txt remove console ttyA...

Page 10: ...uts com raspberry pi robopi You will also need to download the latest version of propeller_load zip from the product page Step 7 Installing SimpleIDE for the Raspberry Pi OPTIONAL You only need to ins...

Page 11: ...available for both Python and C and the native Spin object uses the same API as RoboPiLib The Python interface that is almost identical to the C interface all you have to do is prefix the library func...

Page 12: ...RoboPi v1 00 User Manual v0 85 Copyright 2014 William Henning http Mikronauts com 12 2014 01 27...

Page 13: ...t pin to one of INPUT OUTPUT SERVO PWM digitalRead pin returns int returns 0 or 1 state of pin digitalWrite pin val sets pin to 0 or 1 analogRead chan returns int returns 0 1023 from specified channel...

Page 14: ...igitalWrite int pin int val sets pin to 0 or 1 int analogRead int chan returns 0 1023 from specified channel int analogReadRaw int pin returns 0 4095 from specified channel void analogWrite int pin in...

Page 15: ...the top level Spin object for implementing the functionality that is exposed by the firmware and as such it can be used directly from Spin programs running on RoboPi s Propeller micrcocontroller Plea...

Page 16: ...nalogRead chan read analog input channel scale to 0 1023 return value analogReadRaw chan read analog input channel return raw 0 4095 value analogWrite pin value write PWM value to pin 0 is off 255 is...

Page 17: ...s to ground when closed include stdio h include RoboPiLib h define LEFT_BUMPER 22 define RIGHT_BUMPER 23 define PRESSED 0 int main int argc char argv RoboPiInit dev ttyAMA0 115200 pinMode LEFT_BUMPER...

Page 18: ...pins through 470R resistors include stdio h include RoboPiLib h define LEFT_BUMPER 22 define RIGHT_BUMPER 23 define LEFT_LED 8 define RIGHT_LED 9 define PRESSED 0 int main int argc char argv RoboPiIn...

Page 19: ...rt schematic of CdS circuit Connect a 10K pullup to the signal pin of an analog input to 5V also connect one side of the CdS to the signal pin Connect the other leg of the CdS to GND Use analogRead ch...

Page 20: ...SERVO_MIN i SERVO_MAX i 100 servoWrite LEFT_SERVO i servoWrite RIGHT_SERVO SERVO_REV i printf LEFT SERVO d n servoRead LEFT_SERVO printf RIGHT SERVO d n servoRead RIGHT_SERVO sleep 1 Controlling a Con...

Page 21: ...note that the minimum speed will be different for different motors Some driver boards permanently tie EN high in order to use only two pins however I do not recommend this practice as it is harder on...

Page 22: ...tate in opposite direction 1 1 Break EN DIR PWM Three Wire Driver Some motor drivers will have an EN signal but use extra logic to to use one pin as motor direction and another as a PWM input to contr...

Page 23: ...speed control is used both inputs are guaranteed to be driven low during the off period of the PWM signal which will short the two motor leads actively breaking This is less than ideal for the motor...

Page 24: ...TORB_IA 14 define MOTORB_IB 15 int main int argc char argv int i RoboPiInit dev ttyAMA0 115200 while 1 set both motors FORWARD pinMode MOTORA_IA PWM pinMode MOTORA_IB OUTPUT digitalWrite MOTORA_IB 0 p...

Page 25: ...h motors REVERSE pinMode MOTORA_IA OUTPUT digitalWrite MOTORA_IA 0 pinMode MOTORA_IB PWM pinMode MOTORB_IA OUTPUT digitalWrite MOTORB_IA 0 pinMode MOTORB_IB PWM for i 0 i 256 i 16 analogWrite MOTORA_I...

Page 26: ...ble at ranges shorter than 15cm Unfortunately the output voltage is not linear with respect to the distance to the object however it is easy to construct a table of voltages corresponding to the dista...

Page 27: ...ted should function SEEDSTUDIO_136B not tested How to connect your ultrasonic range sensor HC SR04 pin RoboPi Pin use any of 24 servo three pin headers Vcc Servo header red wire any of 24 servo three...

Page 28: ...minal of power selection header SV2 or SV3 Supply GND to RoboPi via one of pins 9 14 of the Pi Header GND terminal of the external motor power screw terminal If you will never mount your RoboPi on a R...

Page 29: ...u can find the data sheets for the listed Digikey part numbers at Digikey com by typing in the part number and clicking on the pdf icon on the resulting page Appendix C Support For Raspberry Pi suppor...

Page 30: ...EEPROM use MCP3208 While there is no motor driver on RoboPi if you connect a two channel motor controller as follows it will be RoboProp compatible Tie EN1 2 and EN3 4 high P8 to IN1 P9 to IN2 P10 to...

Page 31: ...distributors Please contact us for a custom quote Q Can we make our own RoboPi printed circuit boards A I am afraid not While RoboPi is an open platform in that it is fully documented with source code...

Reviews: