Andrew's Lego Robot

You are visitor Hit Counter to this page since July 1st, 2001

The following pictures are © Andrew H. Hochheimer, and may not be reposted without written permission.

horizontal rule

    This is the first Robotic Project I have made (1996) I am currently working on a new version as of 09/19/98.

Table of Contense:

    About The Robot's CPU

A Fresh Start (2001)

    Pictures and Information on a new object detection/tracking system I'm working on

My Second Lego Robot (1998)

    Pictures of my New Lego Robot

My First Lego Robot (1996)

    A list of parts I used to construct my first lego robot

    What can the Robot Do?

    Sample of the Robots Program

    Pictures of my Lego Robot

Other Sources

    On-Line Store

    For More Information

horizontal rule

About The Robots CPU:

BasicStamp II IC Chip
BASIC Stamp II Module -- Part #BS2-IC from Parallax Inc.
bullet2048 Bytes of EEPROM program/Data storage (600 instructions)
bullet32 Bytes of Variable Storage
bullet16 general-purpose I/O Lines supporting 0-5v
bullet20-MHz clock
bulletEach I/O Line can send or Receive 300-38,400 Baud
bullet24-pin DIP style package
bulletProgrammed from a PC or Mac, Using a Basic "Like" Language!

    The BS2 has 2K bytes of EEPROM which holds the executable BASIC program and any data. Memory not used by the BASIC program can be read and written at run-time as a data bank, or initialized with data at download time. This memory is only affected by downloading or run-time modification.

    There are 32 bytes of RAM which serve as variable space and I/O pin interface for the BASIC program. This memory can be accessed as words, bytes, nibbles, or bits. Each time the BASIC program is run anew, this memory is cleared to all zeroes.

    So, the 2K byte EEPROM is for program and data, and only affected by initial downloading or run-time modification. It survives power-down. The 32 bytes of RAM are for run-time variables and I/O pin access. This memory is cleared each time the BS2 is powered up, reset, or downloaded to.

horizontal rule

New Object Detection/Tracking System (2001)

PICTURES

  

    The new object detection system I am working on currently pans a arc 180 arc and measures the distance to all objects within it's detection distance. Once it determins the closest object moves back to it (points to it) and waits for the object to move, then repeats the scan.

A List of Parts I Have Used to Construct It:

  1. Basic Stamp II from Parallax Inc.
  2. One Futaba FP-S128 Servo (any RC Car Servos would work)
  3. D.I.R.R.S. Digital Infra-red Range Finding System from HVM Technologies
  4. 2x1K Resistors

Code Sample of the Object Detection System

T Var Byte
DISTANCE Var Byte
SERVO1 Con 3
SERVOL var Word
LOCATION var Word
CLOSE var Byte
OBJECTAT var Word

DEBUG "Ready.",cr
LOW SERVO1
PAUSE 500

TEST:
DEBUG "Starting Scan",CR
pulsout SERVO1,100
pause 200

CLOSE=0
for SERVOL=100 to 1150 STEP 50
	pulsout SERVO1,SERVOL
	GOSUB GET_DISTANCE
	pulsout SERVO1,SERVOL+25
	IF DISTANCE < CLOSE THEN SKIPIT
	CLOSE=DISTANCE
	LOCATION=SERVOL
SKIPIT:
	NEXT
DEBUG "Pointing At Object At=",DEC LOCATION,CR

FOR T=1 to 15
	pulsout SERVO1,LOCATION
	pause 40
NEXT

KEEPSTARING:
GOSUB GET_DISTANCE
OBJECTAT=DISTANCE
DEBUG "ObjectAt=",DEC OBJECTAT,cr
GOSUB GET_DISTANCE
IF DISTANCE>OBJECTAT+1 THEN EXIT
IF DISTANCE<OBJECTAT-1 THEN EXIT
GOTO KEEPSTARING

EXIT:

GOTO TEST

GET_DISTANCE:
HIGH 0
PAUSE 3
LOW 0
FOR T=1 TO 70
	PAUSE 1
	IF IN1=1 THEN FINISHED
NEXT

FINISHED:
SHIFTIN 1,0,2,[DISTANCE\8]
'DEBUG "Dir=",Dec SERVOL,cr
DEBUG "Distance=",dec DISTANCE,cr
PAUSE 200
RETURN

horizontal rule

My Lego Robot (1998/1999)

PICTURES

New Robot Side View

New Robot Front View New Robot Top View New Robot Bottom View New Robot Back View

Click Image to Zoom

    Currently I have not started to add sensors. I have just debugged the drive system. Aprox 200 speed settings for each wheel set and forward/rev control for turning in place.

1999 Update:

    I added a Infrared Proximity Detector (not seen in the above pictures, purchased from Lynxmotion) to detect objects in the path of the robot (left, center, or right) and added code to avoid objects.

horizontal rule

My First Lego Robot (1996)

A List of Parts I Have Used to Construct It: (Old Version of Lego Robot)

  1. Basic Stamp II from Parallax Inc.
  2. Two Futaba FP-S128 Servos (any RC Car Servos would work)
  3. 9V Lego technic Motor
  4. Serial Backpack / 16 Character x 1 line LCD
  5. DB9 Female connector
  6. 1 5v Reed Relay from RadioShack
  7. Some 0.1uF Ceramic Capacitors, and 1K Resisters
  8. A Green Led
  9. A Hi-quality Photocell
  10. Two 9V batteries for power
  11. 3.6 Million wires & a Bread Board to plug it all into.
  12. Two Switches
  13. Technic Lego Kit #8042 and some extra Gears from other kits.

horizontal rule

What Can the Robot Currently Do?

Currently the robot can only navigate to the brightest light source in a room. It's current operation mode has four major steps:

- Scan a 180 Degree Field of "Vision" taking light level readings, and determining the brightest direction of light.

- Decide if it needs to turn left, right, or continue moving forward.

- Check for Collision with an object while moving, if a collision occurs, display the total travel distance on the display

- Move forward for 1.5 Seconds and then repeat the process.

I am currently going to add a Ultrasonic range finder to the sensor platform, and rebuild the robot from the ground up to include two motors for steering, and 360 deg turning.

horizontal rule

Sample of the Robots Program:  (I think this is the right version)

MOTOR1 con 0
MOTOR2 con 1
EYE con 2
SERVO1 con 3
SERVO2 con 4
HIT1 var in5
DISPLAY con 7
HEADLIGHT con 8
LED con 15
DIST VAR WORD
TRAVELED VAR WORD
I var word
LIGHT var word
LDIR var word
LLEV var word
SERVOL var word
SCENTER con 600
SLEFT con 150
SRIGHT con 1050
CLR con 1
DI con 254
debug "Running",CR,CR
'Initialize all motors/servos
HIGH LED
LOW SERVO1
LOW SERVO2
LOW MOTOR1
LOW MOTOR2
PAUSE 50
'LOOP:
'HIGH EYE
'RCTIME EYE,9,LIGHT
'pause 40
'SEROUT DISPLAY,396+$4000,[DI,CLR,DI,Dec LIGHT]
'PAUSE 40
'goto LOOP
FOR I=1 To 10 
PAUSE 250
	SEROUT DISPLAY,396+$4000,[DI,CLR,DI,Dec 11-I," WAITING."]
NEXT
SCAN:
FOR I=1 to 35
	pulsout SERVO2,150
	pause 20
NEXT
LDIR=150
LLEV=30000
for SERVOL=150 to 1150 STEP 50
	pulsout SERVO2,SERVOL
	pause 20
	pulsout SERVO2,SERVOL
	pause 20
	HIGH EYE
	RCTIME EYE,9,LIGHT
	SEROUT DISPLAY,396+$4000,[DI,CLR,DI,Dec LIGHT]
	'debug "LOCATION=",dec SERVOL," LIGHT=",dec LIGHT,"/",dec LLEV,cr
	IF LIGHT >LLEV then CSCAN1
	LLEV=LIGHT
	LDIR=SERVOL
	CSCAN1:
	TOGGLE LED
next
SERVOL=LDIR
for i=1 to 25
	pulsout SERVO2,SERVOL
	pause 20
next 
HIGH LED
IF LDIR>SCENTER+150 then MOVELFT
IF LDIR<SCENTER-150 then MOVERGT
SEROUT DISPLAY,396+$4000,[DI,CLR,DI,"L=",Dec LLEV," CENTER"]
SERVOL=SCENTER
GOSUB TURN
DIST=1500
GOSUB FORWARD
goto scan
MOVERGT:
SEROUT DISPLAY,396+$4000,[DI,CLR,DI,"L=",Dec LLEV," TURN RGHT"]
SERVOL=SRIGHT
GOSUB TURN
DIST=1500
GOSUB FORWARD
GOTO SCAN
MOVELFT:
SEROUT DISPLAY,396+$4000,[DI,CLR,DI,"L=",Dec LLEV," TURN LEFT"]
SERVOL=SLEFT
GOSUB TURN
DIST=1500
GOSUB FORWARD
goto SCAN
END
TURN:
debug "MOVE SERVO TO ",dec Servol,cr
for I=1 to 20
	pulsout SERVO1,SERVOL
	pause 20
next
return
FORWARD:
HIGH MOTOR1
for I=1 to DIST
TRAVELED=TRAVELED+1
	if hit1 then crash
next
LOW MOTOR1
return
Crash:
LOW MOTOR1
SEROUT DISPLAY,396+$4000,[DI,CLR,DI,"CRASH! ",DEC TRAVELED]
end

horizontal rule

PICTURES

Old Robot Side View

Side View

Old Robot CPU/Screen View Old Robot Side View #2

Other Images

horizontal rule

OTHER INFORMATION

Information on The Basic Stamp II From Parallax INC

Scott Edwards Electronics, Inc. produces BASIC Stamp compatible LCD displays, servo controllers (That I used to construct my robot) and other peripherals.

Solutions Cubed produces add-on products for use with BASIC Stamps.

Lynxmotion has large selection of PBASIC programmable mobile robots, manipulators and accessories.

Mondo-tronics' Robot Store features over 100 actual robot kits, books, and software, as well as Muscle Wires® shape memory alloys, and lots of other great robot related hardware, electronics, video tapes and more.

Arrick Robotics

Books That can be ordered on-line.

COVER INFO DESCRIPTION / MY NOTES / CLICK TO ORDER
Paperback - 300 pages Bk&Cd Rom edition (November 15, 1999)
Dave Baum's Definitive Guide to LEGO Mindstorms (Technology In Action); Dave Baum, Rodd Zurcher (Illustrator) 
Paperback - 247 pages 1 Ed edition (November 1999)
The Unofficial Guide to LEGO MINDSTORMS Robots; Jonathan B. Knudsen
Paperback - 416 pages (March 1997)
Basic Stamp; Claus Kuhnel, Klaus Zahnert (Contributor)
Paperback - 300 pages Bk&Cd Rom edition (October 1999)
Microcontroller Projects With Basic Stamps; Al Williams 
Sorry No Picture of the Cover
Spiral-bound - 170 pages 1 edition (February 1998)
The Basic Stamp 2 - Tutorial and Applications; Peter H. Anderson 
Paperback - 350 pages Bk&Cd-Rom edition (March 1998)
Programming and Customizing the Basic Stamp Computer; Scott Edwards 

Paperback - 248 pages (October 9, 2000)

The Microcontroller Application Cookbook; Matt Gilliland, Ken Gracey

Paperback - 336 pages 2 edition (January 2000)
Basic Stamp: An Introduction to Microcontrollers; Claus Kuhnel, Klaus Zahnert 

 

horizontal rule

If you wish to contact me, you can by:

E-Mail:   Andrew: andrew@softwareartist.com

By Mail: The Software Artist Limited, 195 Ellis Street, Chatham, Ontario, Canada, N7L 2L9

horizontal rule

Home

horizontal rule

Last Updated: Monday, August 11, 2014 08:50:30 AM