Robotics‎ > ‎

Arduino and NXT Sensors

NXT sensor cable pinouts

from: http://en.wikipedia.org/wiki/Lego_Mindstorms_NXT

Arduino pinouts


Analog Sensors

Similar to our project

NXT Ultrasonic I2C sensor


Arduino and NXT Ultrasonic Sensor




Infrared-Ultrasonic Beacons - www.convict.lu/htm/rob/ir_us.htm

From Lego Mindstorms NXT Hacker's guide
page 116
Equipped with its own microconroller, the NXT ultrasonic sensor is able to accurately measure the distance between itself and an object that is in its path.  It has an emitter and receiver.
The emitter generates an ultrasonic sound that is "chirped" from a piezo crystal microphone-like element.  This chirp has a fequency of 40 kHz and a sound level of 110 dB when measured at 30 cm.  Once this sound wave reaches an object, it is reflected back to the sensor.  This reflection is called an echo. Once this echo has been detected, the onboard microcontroller calculates the amount of time that has elapsed between the initial chipr and the reception of the return echo.   

Emissions ranging from single chirps to time-delayed "bursts" of chirps can be programmed into the Brick.  The spacings of these bursts can be controlled between 80 msec and 2.5 s.  The default burst rate is 10 - 15 bursts per second. 

A deflection of approx. -10 to +10 cm either side of the sensor's centerline will rpoduce valid measurements.  Degradation of distances greater than 78 cm.

Light


Digital Sensors - I2C

Arduino and the I2C bus

Using the NXT to interface with I2C

Wiring
 Arduino Duemilanove, Uno or100% compatible board, you will be using pins A4 for SDA (data) and A5 for SCL (clock).  So, from the NXT cable, pin 5 from the NXT cable plugs into A5 on the Arduino and pin 6 from the NXT cable plugs into A4 on the Arduino.

Arduino and I2C

Two possibilities to use a motion detector with the Arduino:
  1. Connect the Vernier motion detector to the Arduino.   Figure out how to use I2C to read from the motion detector.  Here's a starting point in which an Arduino is getting compass heading readings through I2C: http://www.arduino.cc/playground/Learning/Hmc6352
  2. Connect a ping ultrasonic range finder to the Arduino.  Here's a video from Sparkfun: http://www.sparkfun.com/commerce/product_info.php?products_id=639
    1. Here's some info on hooking up the ping ($25.95):  http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor
    2. For wireless capability, check here:   Arduino and Wireless  There are two options, the XBee (expensive, and you need to buy the XBee that would attach to the arduino and another board for the computer.  Or, you can try the much cheaper option of a transmission receiver pair ($5) from: http://www.robotshop.ca/home/products/robot-parts/communication-control/data-telemetry/on-shine-low-cost-tx-rx.html   Here's a video of someone using it for their nunchuck controlled robot: http://www.societyofrobots.com/robotforum/index.php?topic=2633.0
    3. How do we interface to either of these options using Matlab?  Does the XBee interface as a serial port?  Does the receiver?

Intro to using the I2C bus:  http://www.robot-electronics.co.uk/htm/using_the_i2c_bus.htm

Some info from a forum for one arduino sending data to another over I2C:  http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263047612

Using the I2C bus with an accelerometer: http://www.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/

Here's an arduino connected to a Radio Shack ($10) motion detector.  It doesn't detect distance, just motion.http://antipastohw.blogspot.com/2007/12/arduino-with-radion-shack-parallax.html

I2C right from computer (Mac OS - yay!):  http://www.instructables.com/id/Worlds-Cheapest-I2C-I-Squared-C-Adapter/

Comments