CHAPTER 7Voltage Sensors

In Chapter 5 you learned that the NXT converts the voltage on a sensor input into a digital value. Until now, the only voltage being converted was the 5V supply inside the NXT, or some part of it divided through an external resistor. It probably doesn't come as a big surprise that you can connect an external voltage to the input and have the NXT convert that instead.

Caution Never connect these voltage sensors to anything but low voltage battery-operated equipment. Connecting them to household electricity could be lethal both to you and the NXT.

Design of a −5V to +5V Sensor

Figure 7-1 shows a circuit diagram of the NXT input with a simple voltage sensor. The only component needed is a 10kΩ resistor. The external voltage ...

Get Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.