This article provides instruction on the easy setup for the MaxBotix Inc USB-MaxSonar ultrasonic sensor lines.
This instructional set will help you set up the USB-MaxSonar ultrasonic sensors with your computer system.
Serial Port Configuration Settings
57600 Bits per Second
0 / none
0 / none
Windows Operating Systems
Connecting the USB-MaxSonar
- Download a terminal program.
- Unzip to a location of your choice.
- Connect a USB-MaxSonar ultrasonic proximity sensor to a computer with a Micro-B USB Cable.
Windows will automatically configure drivers, and this may take several minutes.
If Windows does not install the drivers immediately, they are available to download here.
- Run the terminal program .exe file.
The terminal program .exe file should look for the first available sensor and connect. If this does not
occur, configure the above serial setting.
- Please note that the first available COM Port in Windows is typically COM2 or greater.
COM1 is frequently reserved by the Windows operating system. Also in certain computer hardware
configurations, additional COM ports are reserved by the Windows operating system. The sensor will
select the next available COM port. A good rule of thumb is to select the highest number COM port.
- Advanced user setup can be seen here.
If the software does not find the USB-MaxSonar automatically, simply click on “SETTINGS” and change the “Port” menu.
The communication port number should match the com port assigned to your computer by windows. After changing the “Port” menu click OK. None of the other settings need to be changed.
To connect or disconnect the COM port click the button shown.
Multiple Sensor Operation
- Open a second terminal window
- Click “Settings”
- Change port to match the newest COM#
- Configure the COM port settings to the required values in the chart at the top of this page
- Click “Okay”
Linux Operating System
Terminal Software Setup
This was created with Ubuntu 12.10 and the software used is MoSerial.
- Download and install a terminal program.
- If Linux OS doesn’t recognize the sensor, drivers are available to download here.
- Configure the port.
- Click “Port Setup”
- Set “Device” menu to “/dev/ttyUSB0”
- Set Baud Rate to 57600
- Set Data Bits to 8
- Set Stop Bits to 1
- Set Parity to none
- Turn off all “Handshakes”
- Setup should match the image on the right
- Click “Connect.”
- Click tab that says “Received ASCII.”
- Advanced user settings are available here.
Terminal Program Setup
- Download terminal program.
- If the operating system doesn’t recognize the sensor, drivers are available to download here.
- Configure the terminal program.
- Select the “Settings” menu.
- Select the “Modem Preferences” option.
- Select “USB serial 0” (The zero may change depending on hardware configuration).
- Set the following options:
- Set “Data Rate” to 57600
- Set “Data Bits” to 8
- Set “Parity” to None or 0
- set “Stop Bits” to 1
- Remove checkboxes from “Flow Control” options.
- The “Service Name” can be named at the user’s preference.
- “Phone Number”, “Pre-dial init”, and “Password” options can be left blank.
Please be aware that we have not evaluated Zterm for operation with the USB‑MaxSonar ultrasonic sensors. If you have a preferred terminal software, it can be configured with the same settings of Zterm
Computer USB ports have latency and buffer sizes which can change the time between the range readings reported by the USB‑MaxSonar ultrasonic sensors. This time delay can be caused by the USB hardware on the computer’s system board, the chipset managing USB communication ports, the age of the computer hardware, the number of devices using USB communication, and by the computers operating system.
When multiple USB connections are working in parallels, such as a mouse, keyboard, and flash-drive, the bandwidth is shared among the devices. When bandwidth is shared between devices, the buffer and latency are increased due to the extra demand of resources from the computer chipset.
The following direction sets are how to help lower the latency of the USB port in the computer’s operating system.
For advanced Windows users, this instruction set will allow the use of a low-latency mode of operation for the USB‑MaxSonar.
- Open “Device Manager”
- Expand the “Ports (COM & LPT)” menu
- Select the COM port that is assigned to the USB‑MaxSonar
- Right-click on the COM port and go down to “Properties” on the new menu
- On the Communications Port Properties window select the “Port Settings” Tab
- Click on the option that says “Advanced”
- Set the “Recieve (Bytes)” option to 512
- Set the “Transmit (Bytes)” option to 512
- Set the “Latency Timer (msec)” option to 2
- The “Serial Enumerator” option should be checked.
This setting makes Windows remember the COM port assigned to the Device. When this is unchecked, Windows will assign it the first available Com Port A screenshot of what the Advanced Communications Port Properties window should look like after configuration. This can be seen here.
For advanced Linux users that wish to operate in low-latency with the USB‑MaxSonar please use the following directions. While operating in low-latency mode, the USB buffer delay will be reduced to 128mS at most.
- Open the “xTerm” window.
- Type the following command: $ dmesg | grep FTDI.
A line that looks like “/dev/ttyUSB#” will be output.
- Enter the following command: $ setserial /dev/ttyUSB# -g.
The # sign will be the USB port assigned to the USB‑ProxSonar‑EZ sensor.
Information will be output that looks like”/dev/ttyUSB#, UART: unk, PORT:0X0000, IRQ:0″.
- Enter the low latency command: $ setserial /dev/ttyUSB# low_latency.
This command will set the USB‑MaxSonar into a low-latency mode.
- It is recommended that the configuration is confirmed.
- Enter the command $ setserial /dev/ttyUSB# -g.
The low-latency flag should be appended as follows:
“/dev/ttyUSB#, UART: unk, PORT: 0X0000, IRQ: 0, Flags: low_latency”.
Products Related to the Article
The HRUSB‑MaxSonar‑EZ1 is a great choice for use where sensitivity is needed along with side object…
The HRUSB‑MaxSonar‑EZ0 has the widest and most sensitive beam pattern of any unit from…
The USB‑ProxSonar‑EZ1 has a detection zone of ~5 feet and will allow for 8+ simultaneous sensors…