TTL and RS-232 Outputs
Most MaxBotix Inc. products include a serial data output option. Serial data is generally considered the most accurate output because it is a purely digital communication method. MaxBotix offers two different configurations of Serial data output, RS-232 and TTL. MaxBotix devices operate at a standard 9600 Baud, 8 data bits, 1 stop bit, no parity.
TTL
TTL is the standard communication protocol for most Microcontrollers (uCs) and Single Board Computers (SBCs). Most of those devices
have integrated UARTs which can decode these signals. TTL is an idle HIGH protocol.
RS-232
RS-232 is the standard communication protocol used by DB9 serial ports on computers. RS-232 has two key differences between TTL. Firstly, RS-232 is inverted relative to TTL.
in TTL a 1 is represented by a HIGH voltage, and a 0 is represented by a LOW voltage. In RS-232 a 1 is represented by a LOW voltage and a 0 is represented by a HIGH voltage.
Secondly, RS-232 typically operates at a higher voltage range. Where is TTL operates from 0-Vcc (often 0-3.3V or 0-5V), RS-232 signals are in the range of -15V to +15V.
MaxBotix's RS232 Implementation
MaxBotix sensors always operate at 0-Vcc voltage levels, regardless of serial data output type. This means that when outputting RS-232 signals, the sensors output
considerably less voltage than a typical RS-232 transmitter. With that said, most RS-232 Receivers have sufficient margin to read signals in this voltage range. If desired,
it is possible to convert a TTL signal to RS-232 at the full voltage range using a converter chip such as the MAX3232.
Please note that though it's often possible to connect the TX output of the sensor directly to the RX input on an RS-232 receiver, it is not possible to connect the RX input of the sensor to the TX output of the RS-232 device. Doing so could cause irreversable damage to the MaxBotix sensor due to the higher than expected voltages.
Serial Data Packet Structure
MaxBotix products have a standard serial data format. Below are diagrams showing all of the MaxBotix data packet formats. Please reference your sensor's datasheet for more information.