Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Contact sensors are the simplest NXT sensors because they're only on or off. The LEGO Touch Sensor is a good example of a contact sensor. Homebrew contact sensors use the same NXT-G Touch Sensor block shown in Figure 4-1 as the LEGO ones. You probably already have everything you need to homebrew one. Even if you don't, the parts are readily available from electronic stores such as Radio Shack, and even from hardware stores.
Figure 4-1. NXT-G Touch Sensor block
We've already covered many methods for connecting to the NXT sensor inputs in Chapter 3. For contact sensors, we're interested in only two of the six connections. On the NXT plug they're pins 1 and 2, and in the cable they're the black and white wires. For now, it doesn't even matter which is which. In the examples that follow, we'll only show some 18 gauge (0.8mm2) speaker wires, and you can presume they're attached to these two NXT connections.