MaxBotix Sonar Rangefinder:Serial(Transmit with Xbee)

Items Needed:

  • 2 Xbees configured for comms. If you need to configure them see this tutorial: Xbee Basic Setup
  • 1 mbed Application Boards
  • transistor 2n7000
  • 10k ohms resistor
  • Bread borad and wires
  • XBee Adaptor board. Custom one used in tutorial, but equivialnt can be seen here: XBEE BOARD

Steps

(You only need to set up one board and should just see the Coordinaotr in the file browser)

  1. Set Xbee radios into designated spot on mbed Application Board and plug into computer: /media/uploads/dannellyz/img_5401.jpg
  2. Verify that the computer recognized the boards by checking the Computer section of your file browser for Devices with removable Storage. They will be named generically for the appBoard, I recommend you change their names based on their corresponding Xbee's configuration. I will be following the assumption that they are correctly named for the remainder of the tutorial. /media/uploads/dannellyz/mbed1.png
  3. Assemble the range finder as shown below on the bread board.
  • List Item 2
  1. Numbered List Item 2.1
  • Rangefinder should it from rows (14-20)
  • Row 10: Wire going to tx of XBee / Collector pin of transistor / One end of resistor
  • Row 11: Empty
  • Row 12: Base of Resistor / Wire connected to TX of range finder (Row 16) / Wire going to rx of XBee / Collector pin of transistor / One end of resistor
  • Row 13: Empty
  • Row 14: Ground of Rangefinder / Other grounding source (MUST BE SAME AS THAT FOR XBEE!)
  • Row 15: 3.3v of Rangefinder / 3.3v Power Source / One end of resistor
  • Row 16: TX of Rangefinder / Wire connecting to base of transistor (Row 12) /media/uploads/dannellyz/img_5414.jpg
  1. Attach XBee to breadboard providing:
  • 3.3V power
  • Same groudning source as Rangefinder
  • Wire connecting the DOUT or tx pin of XBee to the collector of the resistor (in above set up Row 10) /media/uploads/dannellyz/img_5423.jpg
  1. Download the following code onto the Coordinator appBoard:

    Import programserialRangeGet

    Gets serial communication from Xbee. Code should be on Coordinator. Will display distance in inches and if anything is within 2ft all BUS leds will illuminate.

    • No code is needed for End Device as XBee accepts direct serial comms.
  2. Code will send rounded range in inches over XBee and if anything is within 2ft it will illuminate the lights on the Coordinator.


Please log in to post comments.