Written by Techbricks.nl
Thursday, 13 March 2008 11:55
On this page I shows how I display graphic drawings of NXT sensor measurements on a LEGO Mindstorms NXT (part no: 53788) using NXT-G programs.
Displaying pressure levels:
This program shows the pressure level of a NXT Mindsensors pressure sensor in graphic drawing on y-axis. The x-axis is the time-axis. The time interval, which determine how long it take before a new measurement is draw, is in this case 2 seconds.
The maximum pressure level this sensor can measure is 2467 mBar (about 35 PSI). The NXT screen resolution is 99 (x-axis) x 63 (y-axis). I choose in this case to multiply the y-axis (the pressure level) by 2. Therefore a pressure level higher then 31 fall out side the screen!
note: PSI means pounds per square inch.
1 Bar (1000 mBar) = 14.5038 PSI
1 PSI = 0.068947mBar
(for more info look at http://www.convertworld.com/en/pressure)
After 100 samples (200 seconds) printed on the NXT screen, the graphic drawing starts again with a clear screen. Check my pneumatic air compressor tested with this NXT-G pressure measure program...
Download the NXT-G pneumatic pressure sensor program: www.techbricks.nl/downloads/pressure_sensor.rbt
Displaying sound levels:
This program shows the level of sound of a NXT sounds sensor in a graphic drawing on the y-as. The x-axis is the time-axis. The time interval, is in this case about 1/100 of a second.
Within one second the measurement is completed. Hundred samples then are printed on the NXT screen and the program will wait until you touch the orange select button on the NXT and start a new measurement.
Download the NXT-G sound sensor program: www.techbricks.nl/downloads/sound_sensor.rbt
Displaying all kinds of measurements with different sensors:
The next program can be used for many sensors. Ones it is loaded on the NXT you still can change the interval time (the wait time before the next measurement is printed on the screen). It is also possible to adjust the scale of the measurement. It even saves these setting to a file (sensor_tmp) on the NXT, so you don't have to set them every time you start the program.
This program now is setup with a Ultrasonic sensor, but you can change that to any sensor you like. But of course you need a NXT-G sensor object.
Different sensors have different output.
Mindsensors NXT pneumatic pressure sensor maximum output 35 PSI (or 2413mBar)
LEGO temperature sensor can have a max of 70C (or 158F)
NXT sound sensor maximum output is 100 (sound level), 1024 (global sound level) or 65536 (frequency between 264 en 4000 Hertz)
NXT Ultrasonic sensor does have a max of 255cm (or 100inch).
NXT Light sensor maximum output is 100 (level) and 1024 (global level).
HiTechnic NXT Gyro sensor
HiTechnic NXT IRseeker sensor
HiTechnic NXT Compass sensor
HiTechnic NXT Colour sensor
HiTechnic NXT Acceleration/Tilt sensor
Different sensors need different interval times. Some measurements need to go slow others can run quick.
After you start the program you can adjust the interval time and the scale using the left and right arrow. Every time you press the orange select button you skip between setting the interval time or the scale. On the second row of the NXT screen two figures are printed. The left one is a factor (1-100) that adjust the scale. The right figure is a factor (1-100) that adjust the interval time. Ones the correct adjustments are made the settings can be saved for a next session by pressing the orange select button.
Download the NXT-G graphic drawing sensor program: www.techbricks.nl/downloads/sensorgraphic.rbt
Check the complete NXT sensor graphic drawing high resolution photo gallery at Google Picasa...