Mindsensors currently has a new sensor in beta. It is a sensor which is a bit out of the ordinary. It is not to make robots or automated devices, but it is more a tool to help in electronics. It allows to measure current and voltage used either by the NXT brick itself (using the provided probes) or an external circuit (without using the probes). The firmware of the sensor is not completely finished yet which means some of the features are not available yet. However, even in its current state it is a marvel ! It can measure up to 13.5 volts and 3 amps.
I decided to start slowly and created a simple circuit with a 9V battery, one fixed resistor of 50 ohm and one variable resistor of 1K. Since the battery is a rechargeable battery I measure around 7-8V, which is normal and the current depends on the variable resistor. After trying the provided NXC program written by Deepak, I decided to convert it into a RobotC library. I used the same naming convention as Deepak's NXC library. Once I got it working, I added all routines to read all registers of the NXT PowerMeter, so that the library is ready for future expansion (meaning when Mindsensors adds features to the firmware)
Finally I wrote a program that turns the NXT into a simple multimeter. It shows the device ID, vendor ID, firmware version of the PowerMeter along with the measured current and voltage. Using Ohm's Law it is easy to calculate the resistance from this. The NXT shows those 3 values but by pressing the buttons you can change which one is shown in a big font. The other 2 are shown in small fonts. It also displays the internal timer. The PowerMeter has an internal timer in msec which can be reset.
The video is available on YouTube, the software on the Mindsensors website.