Page 230 - The Unofficial Guide to Lego Mindstorms Robots
P. 230

219


          Passive Sensors

          There are several simple passive sensors that attach directly to the inputs of the RCX. These are the simplest do-it-yourself
          sensors because you don't need any interface circuitry to make their output comprehensible to the RCX.

                                      A Peaceful Demonstration

          To really understand passive sensors, it's helpful to see a diagram of one input of the RCX in passive mode:

















          In passive mode, the sensor connected to the input is essentially a resistance. It forms a
          voltage divider with Rinput. The A/D converter in the RCX converts the analog voltage to a
          digital raw input value from 0 to 1023. The A/D converter itself has a resistance, Rad, but
          it's so small you probably don't have to worry about it. The two diodes limit the voltage that
          can be seen by the A/D converter; this makes it hard to damage the RCX by hooking
          something up incorrectly.

          Touch Sensors

          Touch sensors are the easiest kind of sensors to make. Any kind of contact switch is appropriate, and no special circuit is
          necessary. All you need to do is attach the switch leads to the input somehow.

          Browse the pages of a catalog from Jameco (800-831-4242) or Digi-Key (800-344-4539) and you'll find a dizzying array of
          contact switches.

          Another interesting possibility is using a mercury switch as a touch sensor. A mercury switch has a sealed bulb that contains a
          drop of mercury. When the switch is oriented the right way, the mercury drop connects the two switch leads together. Figure
          11-2 shows a photograph of a mercury switch; you may have seen ones with clear bulbs in your thermostat. The LEGO brick is
          shown for scale.
   225   226   227   228   229   230   231   232   233   234   235