Inverting RS232 Signal?

Discussion in 'General Electronics Chat' started by jeff77789, Mar 21, 2013.

  1. jeff77789

    Thread Starter New Member

    Feb 22, 2013
    I have a Maxbotix MB1030 ultrasonic sensor, in which it gives out a "Tx" digital signal which is:

    When the *BW is open or held low, the TX output delivers
    asynchronous serial with an RS232 format, except voltages are 0-Vcc.
    The output is an ASCII capital “R”, followed by three ASCII character
    digits representing the range in inches up to a maximum of 255,
    followed by a carriage return (ASCII 13). The baud rate is 9600, 8
    bits, no parity, with one stop bit. Although the voltage of 0-Vcc is
    outside the RS232 standard, most RS232 devices have sufficient
    margin to read 0-Vcc serial data. If standard voltage level RS232 is
    desired, invert, and connect an RS232 converter such as a MAX232.
    When BW pin is held high the TX output sends a single pulse, suitable
    for low noise chaining. (no serial data).

    it mentions that the signal is inverted and you can use something such as a MAX232 to invert the signal...first of all i don't even know where to get one of those converters
    if i wanted my arduino to read this signal, what can i do to invert the RS232 signal?
  2. antonv


    Nov 27, 2012
    If you wanted your Arduino to read the signal I don't think you have to mess with the inversion. Just the sensor's TX to the Arduino's RX pin. How long is the cable between the sensor and the Arduino board?
  3. jeff77789

    Thread Starter New Member

    Feb 22, 2013
    this is where it gets a little tricky because i am using RF transmitters and receivers to send the signal over roughly 20ft.

    otherwise i just use the PWM setup that i already have if you throw the tx and the rx out of the equation

    the RF transmitters can only transmit digital signals through the ASK modulation (as far as i know)
  4. richard.cs


    Mar 3, 2012
    Many RF modules are designed for logic-level RS232, often with inputs that can accept logic 1 between 3 and 5 volts. If your modules have pins and are designed to solder to a PCB they will likely be this type (check the datasheet), if they have D connectors then they probably expect RS232 level signals.

    It's normal to have the level shifter and inversion combined so logic-level RS232 almost always uses Vcc as logic 1 and gnd as 0. RS232-level signals are always inverted with the -ve voltage as a logic 1. Essentially you don't usually have to worry about the inversion as Antonv says
  5. davebee

    Well-Known Member

    Oct 22, 2008
    I have run across some cases of logic-level serial data streams that were inverted with respect to their RS232-level format, and some that were not.

    So you may need to either electrically invert the signal or recode the serial receiver to expect the inverted logic.

    Lately, I've been using a propeller microcontroller, and its serial library initialization function includes a flag that can be set in code to invert incoming serial data or not, so it's easy to just try both ways and see which results in sensible data.