2002.02_Making Quick Fix Sensors for Lego Robots.pdf

(74 KB) Pobierz
36 robots
FEATURE
QUICK FIXES
The sensors that come
with the MindStorm
are limited. So John
Southern decided to
make some of his own
ROBOTS: Extra sensors
HOWTO on Lego MindStorm with Linux, and
received lots of emails back from those who
asked for the PDF files of the previous article that
should have been printed in December, the biggest
request was for DIY sensors and actuators, as the
range with the MindStorm is considered small.
Sensors consist of two parts: the first connects to
the RX brick and the latter is the actual sensor. Like
most people I want to do things quick, so I’m
prepared to cut corners if the time saved outweighs
the flimsiness of the product.
When making extra sensors I
should have produced wonderful
connectors by using a lathe, turning
down machine screws and mounting
these inside a Lego brick to make
good connectors. If I had that much
spare time I would do something
more constructive such as watch TV.
A quick look through the spares box finds mini
crocodile clips, which clip onto the Lego RCX and
hold quite well. Hurrah! The easy part of the sensor,
done in a minute.
slowly to choose the correct path and we had to
drive the buggy, wait, test the temperature and
compare this with the previous result to see any
change. Another quick fix to make it a waterproof
sensor was to cover it in hotmelt glue.
The motion of the ocean
The next quick fix sensor is a mercury tilt switch. This
works as a simple contact when turned in a set
orientation. These are great fun, as by putting them
in series with resistors in parallel we are able to make
a motion detector. Changing the orientation proved
to be tricky, but hotmelt glue came to the rescue.
With one mercury switch we could sense if the buggy
was travelling on a level surface or on a slope.
With two mercury switches we have enough data
to determine whether it’s travelling uphill or downhill.
This is done by positioning one sensor so it only
contacts when the bugging is climbing and one that
makes contact when running level. If sensor one is
connected then the buggy is going up hill; if the
second sensor is connected the buggy is running
level; and if neither sensor is connected the buggy is
travelling downhill.
How to hook us
easily to the
Lego connectors
The heat is on
Now for the actual sensor. The first we build is a
temperature sensor in the hope of making the buggy
move towards heat. Adding a thermistor to the other
ends of the crocodile clips is the quickest way we can
make a temperature sensor.
The only problem that arises from
this, is that it needs a temperature
offset constant to make it accurate.
After two days of playing with this,
we found that the crocodile clips
give variable contact resistance – so
what works one day fails to be
accurate the next time we build.
Rather than be forever adjusting the program data
each time we build, we can fudge the sensor by
putting a variable potentiometer in line with the
thermistor. We can now easily adjust the resistance in
the connecting cable so the thermistor gives an
accurate reading. At this point the buggy sort of
works, except that changes in temperature are
actually very small and the thermistor requires time to
settle on a temperature. This meant it worked very
Orienteering
Next up is an angle sensor. Here we simply link a ski on
the bottom of the buggy to a variable potentiometer.
As the ski changes angle with the terrain so too does
the resistance through the potentiometer. This is much
easier that our other sensors, and means we can also
now work out the gradient.
At this point we were still plagued with cats
thinking the buggy was their personal plaything so
we will investigate imaging next time.
Te mperature probe
Hot glue – the quick fix solution.
Angle sensor using a potentiometer
38
LINUX MAGAZINE
Issue 17 • 2001
H aving finally read the whole of Luis Villa’s Mini-
563794910.001.png 563794910.002.png 563794910.003.png
Zgłoś jeśli naruszono regulamin