`
`
`
`n§.Zt§kEs§..¢,§.§..»§P§E:%i%§§m§§§s¥i.¥m§Ern.Et&%n£?§§.rr&5.¥
`
`soIuti a
`
`nr
`
`Ac5_q';.i-gr;
`
`irfg ‘
`
`z3%:mmMJ.Mfl..w,,§.w.
`
`
`
`.%».§m&,uW.%_i
`
`MW.New
`
`:25§:%..aV.,w,$m;.T,;...
`
`3%..3.
`..£3.
`
`
`
`
`
`
`
`
`
`
` Chapter 9 - Expanding Your Options with Kits and Creative Solutions
`
`introduction
`
`If, by now, you are caught up in robotics, you may feel a bit constrained byt
`limitations of the MINDSTORIVIS l<it.You want more.\X7hat do you perceixi
`most limiting: the number and range of parts, or the fiict your RCX has only
`three input and three output ports? l\/laybe you would like to use new kinds 0
`sensors, or serVo—motors.And why not try out some pneumatic devices?
`If the l\/IINDSTORJVIS was your first LEGO set, you will be pleased to sell
`that there are many additional parts to boost and support your creativity If
`lVllNDSTORl\/IS is an addition to your large collection of LEGO TECHNIC
`sets, you already know what parts the line includes and probably already have
`them——but there is 21 also wealth of compatible non—LEGO custom parts and kip
`you may never have dreamed of infrared and ultrasonic proximity detectors,
`compasses, sound frequency decoders, magnetic switches, and voice recognition
`units,_iust to mention a few. In this chapter, we will explore some options for
`expanding your designs and plans, surveying the most important additions, pro-
`viding you with information about where and how you can get them, and
`describing also the most significant non~LEGO custom devices.
`Extra parts are not the only way to expand your project ideas. Some mechan p
`ical tricks can also help you in getting the most from the limited number of
`output ports offered by the RCX.You will learn how a single motor can power
`two or more mechanisms, and how you can apply this trick to some of the
`mobile configurations we described in Chapter 8.
`
`
`
`»-
`if
`
`1
`
`Acquiring More Parts
`
`Describing all the components that make up the LEGO world would be a
`tremendously difficult task. The vast LEGO system includes tens of thousands of
`different parts, belonging to different themes, but all are easily integrated with
`each other. That’s the beauty of LEGO:You can always find a new use for some-
`thing that might have been built with a completely different purpose in mind.
`Whether it be towns, trains, or pirates, any or all of the LEGO themes might add
`something useful to your set of equipment. Of course, when it comes to building
`robofirs, the natural choice is the LEGO TECHNIC line.
`Created in 1977 to introduce older children to the world of mechanics and
`motors, the TECI-lNlC line developed into a complete system that includes
`many specialized parts.You are already familiar with the almost l40 varieties
`found in the MINDSTORMS kit, organized into some of the classes previously
`rnentioned—beams, plates, axles, liftarms, gears, and so on.
`
`
`
`
`figure 9.9 Compo nents of the Pneumatic System
`
`Confinued
`
`
`
`
`
`Expanding Your Options with Kits and Creative Solutions ' Chapter 9
`
`161
`
`
`
`Buying Additional Parts
`
`Now that you°Ve seen all these parts, you might wonder where you can get them.
`This is a Very good question which, unfortunately, has no easy answer. There are
`general accessory sets, themed sets, expansion sets, and service packs, as Well as
`general catalogues. Each may offer more or less than you need at one time, and
`price may also be a factor.
`The MINDSTORMS line has many sets, but in our opinion some of them
`are priced a bit too high for their actual Value.The 3801 Ultimate Accessory Set
`is a good choice, including a rotation sensor, a touch sensor, a light brick, a
`remote control, and other parts.
`The 9732 Extreme Creatures Set contains few interesting parts for its price,
`but remember the Fiber Optic System unit, as explained in Chapter 4, can be
`used as a rotation sensor, too.The 9730 R.oboSports Set is a bit more interesting,
`as it contains an extra motor. The most notable parts contained in the 9736
`Exploration Mars Set are two gearboxes, six balloon tires, two very long cables
`(3111) and a bunch ofhearns, plates, gears, and connectors. In our opinion, these
`three sets are good purchases only if you find them at a reduced price.
`The 9735 Robotics Discovery Set contains a unit called Scout that’s a sort of
`younger brother of the RCX. Scout incorporates a light sensor, and features two
`output ports for motors and two input ports for sensors (passive types only: touch
`and temperature). It has a large display and offers some limited programmability
`fiorn its console, without the need for a PC, thus offering an easy start to
`robotics. Despite this nice characteristic, we feel it’s a bit too limited.
`The two Star '\X/ars l\/HNDSTORMS sets, the 9748 Droid Developer Kit and
`the 9754 Dark Side Developer Kit contain an even more limited unit,
`MicroScout, that incorporates a motor and a light sensor, but has no ports. It has
`seven predefined programs, and can be interfaced to the Scout with an optical
`link to act as its third motor. Through the Scout you can also download a tiny
`P1'0gram to the l\/licroScout. In our opinion, MicroScout is definitely too simple
`
`
`
`
`
`
`
`162
`
`Chapter 9 - Expanding Your Options with Kits and Creative Solutions
`
`to be used for robotics, so we again suggest you buy these sets for their parts, and
`only if you find them for sale at a discounted price. If you really want another
`programmable brick, we strongly recommend a second MINDSTORMS kit,
`which with its RCX, two motors, three sensors, and more tl
`ian 700 additional
`parts, in our opinion remains your best option.
`LEGO also released a video camera system called 9731Vision CO1Tl11121i’J,(l.Tl1€
`camera connects to your PC, and a dedicated LEGO software can send lR com-
`mands to your RCX unit, through the tower, according to w
`hat happens inside the
`observed area. Don’t dream of recognizing shapes or performing other sophisticated
`artificial vision tasks, since Vision Command allows only veiy basic reactions to
`changes in some predefined areas of the screen.You will discover also that the cable
`that links the camera to the PC is a constraint to your robot mobility. Despite these
`limitations, however,Vision Command opens Lip a world of possibilities.
`MINDSTORMS expansion sets are an option, and TECHNIC sets another.
`Sad to say, but the currentTECI-INIC line does not incl
`ude many expansion sets
`with suitable parts for robotics. Old TECHNIC sets had
`more beams and plates
`then current ones do, Which, a
`s we explained, tend to rely more and more on stud-
`less lifiarms, which are useful but somewhat complicated to use. lf you are so lucky
`as to find some discontinued TECHNIC sets, you have a good chance of it better
`suiting your needs. Being bound to the current production, large sets are a better
`purchase than small ones, having a higher ratio between functional and decorative
`parts.We prefer not to suggest any specific model here, as each fan has his or her
`own references; also, evei Vear LEGO releases new sets and discontinues others.
`V ,
`With all that said, it is perfectly understandable that you may simply Wish to
`bu onl
`the s ecific
`arts you need. LEGO offers
`Y
`P
`,
`Y
`a mail service, called Shop—At—
`Home, from Whose cataloo ou can order
`2; Y
`both sets and eleme/its parks or _<€ri2i'te
`pat/es. Recently LEGO started an online service called LEGO Direct, through
`which you can order fiom your computer, pay with your credit cards,
`and get the
`parts or sets shipped to your door. LEGO Direct
`has been greeted with great
`enthusiasm by LEGO fans who see it as th
`e promising beginning ofa new era,
`one where everybody can order only
`the specific parts they need fi*orn a com-
`plete catalog. Currently,
`LEGO Direct offers the current line ofsets and a limited
`choice of service packs, but the range is increasing and we
`all hope that it ends in
`a thorough and practical worldwide service.
`Another useful resource is the DACTA service. DACTA is the branch of
`LEGO devoted to educational products, wl
`iose catalog includes a wide range of
`Sets and supplementary l<its.Though packed with a different
`assortment, the
`DACTA boxes contain the same p
`arts used in commercial LEGO products. In all
`
`
`
`.4.V1v»mm..w.-,.-,»sy._«,Wi~‘.
`
`
`
`,_,,,,-,._.s,s_,,..c.....——.w-i~imr-gA»y-n<*7s=v=ri>7'*1‘«"""',
`
`1.
`
`
`
`
`
`Expanding Your Options with Kits and Creative Solutions ° Chapter 9
`
`163
`
`countries, the sale of the DACTA line is entrusted to companies specialized in
`selling educational items to institutions, though they normally sell to the public, too
`(for example, PITSCO in the USA and Spectrum Educational in Canada).Though
`not exactly cheap, the DACTA catalog includes many parts no longer available in
`sets or service packs, like the turntable or the track links, and many other parts that
`remain hard to find in large quantities, like the L"rOt gear and the rotation sensor.
`Last but not least, LEGO fans from all over the world have formed a sort of
`community that has its own selling services. Some fan—run Web sites offer an
`impressive array of new and used parts and sets, in either mint or used condition,
`and most of the sellers accept credit cards and ship internationally. See Appendix
`A for some links to these commercial and private Internet LEGO shops.
`
`Creotiog Custom Components
`ln the following sections, you will see that some of the proposed enhancernents
`involve parts not supplied by the LEGO company. This applies in particular to
`electronics like motors and sensors.
`
`We understand that your attitude toward non—LEGO parts could range from
`enthusiasm to hostility. You might see the benefit in making your own tempera-
`ture sensor (spending only $2 instead of the $30 that the original costs), or you
`might be keen on the opportunity of giving your robot a voice recognition
`device. On the other hand, you might feel that using non—LEGO parts is a viola-
`tion ofthc: rules of the game, or you may be so fond of LEGO that you Wish not
`to contaminate it with foreign components.
`We can not. and will not, recornniend one viewpoint over the other~—the
`choice must be yours.V/e are personally open to some nonoriginal devices, pro~
`Vided that they “look like” LEGO parts.These can be cased into LEGO bricks,
`use standard LEGO wires and connectors, and quite closely resemble the origi-
`nals. However, the use of aluminum plates, brass nuts, and bolts through LEGO
`beams, axles or plates cut to match a specific size, and visible chips and resistors
`are all unacceptable options to us.This is, again, our own choice, however.
`Limiting your choices to LEGO parts has a certain appeal. its like a common
`iparadigni inside which you challenge yourself and other people to reach higher
`and higher goals. Most of the time, We build pure LEGO robots, using other
`devices only when we have something special in mind that we feel can really
`CF‘rm5ct:I3‘T‘?
`‘-7’C5I4
`VT‘:7‘
`'
`at particular‘ hardware. Staying with original LEGO is particularly
`,v1..mp01”t?iI1t when approaching contests and public challenges. Its a simple way to
`regulate whats admitted and what’s not, and to be sure, too, that all competitors
`l~‘~ulling from identical resources.
`
`
`
`
`
`
`
`164
`
`Chapter 9 - Expanding Your Options with Kits and Creative Solutions
`
`On the other side, if you’re open to experimenting with non—LEGO de
`your horizons become much broader. In this section, We’ll provide some ex
`ples of What can be done with them, our assumption being that you continu ;
`use LEGO parts to build your robots, and the RCX to run them; thus, we’ll
`cuss the use of non~LEGO sensors and motors only.
`
`i
`
`
`
`The LEGO company doesn’t release much information about the intern;
`its electronic devices, so most of the technical details currently available to
`public are based on the work of the pioneer hackers who analyzed and dissei
`the sensors and motors. Michael Gasperi is the person who made the strong:
`single contribution to this process, his Web site and book being reference poi
`for any work in the field. Some of these custom devices are really easy to mi
`you can solder, or have a friend who can. In this chapter, we will show you
`of L1/liar can be done; refer to Appendix A to find resources that teach you he
`
`make this stuff, or tell you where to buy it.
`
`Building Custom Sensors
`
`Michael Gasperi ‘s site explains how to build some simple custom sensors.T
`simplest of all is probably the passive light sensor built with a cadmium sulfi
`
`(CdS) photo—resistor and nothing more (Figure 9.lO).This sensor is much l:
`
`than theoriginal. LEGO light sensor in measuring ambient light, though it’:
`slow in acknowledging variations.\X/ith two CdS cells and some electronics
`
`can build a differential light sensor, which tells you in a single value if there
`difference in the amount of light received by the two units; this is Very usel
`
`pinpointing light sources.
`
`Figure 9.10 Single and Double CclS Light Sensors
`
`
`
`
`
`Expanding Your Options with Kits and Creative Solutions - Chapter 9
`
`165
`
`Recycling junk is an option when trying to save money. Figure 9.11 shows a
`.1Cl’1 sensor made with a switch from a computer mouse. Pulling apart a broken
`ause, you will discover that there are some micro—switches connected to its
`ish~buttons. Unsolder them from their circuit plate, solder their terminal to an
`ectric plate, then add some parts to the case in the switch.
`
`igure 9.11 A Mouse Switch Recycled into a Touch Sensor
`
`There are many people who describe in their Web sites how to make custom
`“H303, providing schematics and detailed instructions. Some of them also sell
`Construction kits or finished sensors. Pete Se-Vcik is a good exainple of this latter
`C‘alZ€g01*y; his sensors are Very well engineered and professionally cased into
`LEGO bricks. Figure 9.12 shows three of his i/g/itizrd pr0.\"z'mz'ty detcrfors (IRPD).
`An IRPD is a sensor based on the IR light proximity measurement system we
`
`
`
`
`
`
`
`
`
`166
`
`Chapter 9
`
`you can use them al
`
`° Expanding Your Options with Kits and Creative Solutions
`explained in Chapter 4, with the advantage being that you are not required to
`anything in your code, just read the sensor value. lRPl) sen
`ible range of applications.They are perie ct for obstacl
`so to make your robot toll
`'
`'
`trigger the grabbing feature ofa robotic hand, to find soda cans or loc
`opponent during competitions.As we explained in Chapter 4, the
`ate your
`detection technique cannot measure distances, but it can tell
`ptoxim i ty
`you ifan object is
`coming closer or entering its field of detection. The r
`ightniost sensor in Figure
`9.12 is a (lira! IRPD, able to detect an obstacle W
`ithin a wider angle and tell you
`ifit’s front, left, or right with -
`‘i
`
`sors have an incred-
`i"
`
`
`
`an thus control
`
`that returns a
`
`Sevick also produces a pitch St’/'Z$0l’,
`a sophisticated sound sensor
`value proportional to tl
`ie frequency of the incoming sound.You C
`your robot by simply
`Whistling or playing a flute or recorder like
`Piper. The robotic pianist of Chapter 21 represents a possible
`a modern Pied
`application for this
`sensor: It can learn a simple melody just by l
`istening to it.
`john Barnes is another person who has shown incredible cre
`‘
`petence in building custom sensors. Barnes made one oftl
`ible ultrasonic sensors (Figure 9.13),
`ie first LEGO compat-
`a device able to measure distances evaluating
`the delay between the emi
`ssion ofa sound and its returning echo. Like a sonar,
`the sensor emits an ultraso
`nic signal (not audible), reads its echo, and returns a
`Value that represents the d
`istance of the closest object. The fields of-application of
`these sensors are simil
`ar to whats described for the IRPD sensors, with the fin"-
`ther advantage tl
`iat ultrasonic sensors return an absolute distance Value. Tl 'us
`means that your
`robot can improve its n
`avigation abilities, because it can not
`only
`avoid obstacles but also End the be
`st route evaluating the dist
`surrounding objects.
`ances oi" the
`
`
`
`
`
`
`
`157
`
`Expanding Your Options with Kits and Creative Solutions - Chapter 9
`
`Figure 9.13 An Ultrasonic Distance Sensor
`
`
`
`Barnes has assembled many other amazing devices, including a compass with a
`resolution of3.75° (Figure 9.14) and a pyroelectric sensor able to detect the pres-
`ence of humans or animals by measuring the changes in ambient IR radiation
`(Figure 9.15).The compass sensor just looks like a pile of bricks, because there
`isn’t any device emerging fiorn its body, but the inside contains a small electronic
`compass and a circuit to convert its output into values that the RCX can inter-
`pret. Connect the compass sensor to an input port of the RCX configured for a
`‘light sensor, and it will return values in the range of O to 95, Where O is North,
`24 is East, 48 is South, and 72 is West. Having the RCX know which Way it’s
`
`pointing in order to keep going straight and having it make known angle turns
`. makes a big difference in solving navigation problems!
`
`Figure 9.14 A Compass Sensor
`
`
`
`
`
`168
`
`Chapter 9 - Expanding Your Options with Kits and Creative Solutions
`
`Figure 9.15 A Pyroelectric Sensor
`
`
`
`The casing around the pyroelectric sensor has a small hole that l
`ets its internal
`“eye” receive the infrairecl light any warm body
`produces. It requires some time to
`adapt to the ambient radiation, but afterward it can cl
`etect any change in intensity.
`These features make it unsuitable for
`mobile robots, but its very useful in those pro-
`jects where a robot must start doing 5
`oinething when it detects a human presence.
`Probably the most astonishing ofBarnes’ devices is his Voi
`ce Recognition unit
`(Figure 9. l 6). After a short teaching session, you will be able to give simple one-
`15::
`or two—word comniands to your robot
`like “go.
`stop,” “left,” “tal<e" and see your
`robot perform the required task. lt’s rather large and heavy, because it contains its
`own set of batteries, and, consequently, is not Very easy to place in a compact
`robot. However, it gives reality to the dreams of robots harbored by every sci—-fi
`fan: the ability to respond to vocal Comiiiandsl
`Figure 9.16 John Barnes’ Voice Recognition Unit
`
`
`
`
`
`n‘*1’V.‘:‘“V$:“—A
`
`
`
`
`
`
`
`’
`
`Chris Phillips followed a simpler and more effective approach to get the same
`result using a cheap and easy~to—mount Reed s1m'trlz.A Reed switch is a small bulb
`containing two thin metal plates very close to each other. \X/hen you put the bulb
`close to the source ofa strong magnetic field, the metal plates touch and com-
`plete the circuit. Small permanent magnets are the ideal parts to trigger this
`sensor, with the same procedure we described for the I-l_all—effect sensor.You can
`-2250 use the LEGO magnets designed to couple train cars. Detecting trains is
`actually what Phillips devised his sensor for, but it is suitable for many other
`T 7=lPplications: It can replace touch sensors in almost all applications, and even emuv
`vlilterotation sensors if you mount the permanent magnet on a wheel that makes
`.'P}1SS periodically in front of the sensor.
`\ Figure 9.18 shows a Reed bulb mounted in series with a 100K resistor over a
`EGO electric plate, which provides an easy way to interface custom sensors to the
`.31’$i LEGO 9V wiring system. The final sensor will be cased in a hollowed
`
`t0 make it look like a standard LEGO component.
`
`9
`
`G
`
`Expanding Your Options with Kits and Creative Solutions ° Chapter 9
`
`‘I69
`
`No—co1«ztact switches are Very useful tools, too. These are switches that close
`
`without the need of physical contacts with the casing of the sensor. We integrated
`Michael Gasperi’s General Purpose Analog Interface with a Hall—efiéct detector‘ to
`
`build a sensor capable of detecting magnetic fields (Figure 9.17). A Hall—effect
`detector is a small integrated circuit which returns different signals depending on
`whether it is in the presence of a strong magnetic field or not. Gluing a small per-
`manent magnet on a LEGO peg, you can easily mount it on any mobile part of
`the robot.\X/hen the magnet comes Very close to the sensor, the latter detects it.
`
`Figure 9.’i’}’AA Hall-Effect Sensor
`
`
`
`
`170
`
`Chapter 9 - Expanding Your Options with Kits and Creative Solutions
`
`Figure 9.18 A Reed Switch Sensor before Final Assembly
`
`
`
`
`
`Solving Port Limitations
`
`otics com-
`
`Some of the electronic devices that have appeared
`in the LEGO rob
`munity are meant to solve the endless
`dilemma of the limited input
`and output
`port number. The common approach
`involves III(rllfl'pl€.‘CI'lJ(_Q,
`a technique through
`which signals fi‘om different sources are co
`mbined into a single signal. Michael
`Gasperi explains how to build. a very simple multiplexer that can host up to three
`touch sensors and return 3 Value that
`the RCX decodes into their
`respective
`states (Figure 9.19).This device takes advantage of tl
`1e fact that the RCX can
`read raw Values instead of simple on/oft” states, and returns
`sors.
`any possible combination of three sen
`Figure 9.19 A Three Touch Sensor Multiplexer
`
`3 unique
`
`number fo r
`
`
`
`Nitin Patil designed a more compl
`Slnglfi input port to three. active sensor
`01’ any other custom active sensor like
`
`ex multiplexer suitable for connecting a
`5, like the original light and rotation sensors,
`IRPDS, sound, and so on.ActiVe sensors use
`
`
`
`
`
`Expanding Your Options with Kits and Creative Solutions - Chapter 9
`
`171
`
`the entire raw Value range, thus this device cannot combine their signals into a
`single number like the three touch sensor multiplexer does. Actually Patil’s device
`connects a single sensor at a time to the port, and requires the RCX to send a
`short impulse to select the desired sensor (Figure 9.20).
`
`Figure 9.20 A Three Active Sensor Multiplexer
`
`
`
`Pete SeVcil<’s Limit Switch, though not 21 multiplexer, allows you to save some
`ports by combining two touch sensors and a motor on a single output port
`(Figure 9.21). Until :1 switch closes, the motor is under normal control from the
`RCXJX/hen a touch sensor gets pressed, the inner circuit prevents the motor
`froin turning into 21 specific direction, thus autoniatically limiting the motion of a
`mechanical device. lf your robot has a rotating head, this limit switch can make it
`stop at its left eincl right bounds iisingjiist a single port.
`
`Figure 9.2’! Pete Sex/cik’s Limit Switch
`
`
`
`l Output port multiplexing, though technically possible, doesn’t get the same
`£te“t10n 35 Input port multiplexing, thus there are few schematics and little doc—
`“Elan ation on this topic.The focus seems most on using different kinds of
`mot
`t
`.
`-
`-
`.
`.
`.
`.
`‘31’3i5€rL't) motors in pSi1‘t1CL1la1‘. Servos are typically used in radio~control.led
`
`
`
`
`
` Chapter 9 - Expanding Your Options with Kits and Creative Solutions
`
`
`
`models to steer vehicles, move ailerons, and handle other niovabl
`They are cheap and have high torque, thus they are ideal for some application
`Unfortunately, they expect power in a specific waveform that the RCX cannof
`supply. Ralph Hempel solved the puzzle creating a simple electronic interface;
`that performs the appropriate conversion, thus revealing the power of servo
`motors to LEGO robotics hobbyists.
`
`
`
`
`
`OTE
`
`
`..m..._____________
`The number of electronic expansion devices is vast, and still growing. If
`you are curious about these devices, we once again invite you to visit
`some of the Web links we provide in Appendix A.
`
`
`Creatve Solutions When
`More RCX horts Are Needed
`\When you start gaining experience with LEGO robotics, and wish to build
`something more complex than your early robots, yo.u will quickly find yourself *
`facing the heavy constraints imposed by the limited number of ports the RCX
`has. Are three motors and three sensors too few for you? If you feel a bit fi'us—
`trated, remember that you’re in good company. Thousands of other l\/lIl\lD—
`STORMS fans feel the same!
`
`input port. We are going to describe here some tricks that, using only LEGO
`components, allow you to somewhat expand your motor outputs.
`Start by observing that in some applications you don’t need a motor turning
`in both directions,just one motor in one direction.Your robot can take advantage
`of this fact by driving two different gearings with a single motor. Figure 9.22
`shows how you can achieve this using a differential gear: lts output axles mount
`two 24t gears that can rotate each one only in a single direction. The two i. X 4
`beams work like raft/2efs.They let the gear turn in one direction but block its
`teeth in the other. If you connect the motor to the body of the differential, it will
`drive either the right or the left axle depending on its direction.
`Another setup, shown in Figure 9.23, is based on the fact that the worm gear
`is free to slide along the axle.