• For basic understanding about RS-232: https://www.maximintegrated.com/en/desig­n/technical-documents/tutorials/8/83.htm­l and there is also the wikipedia page https://en.wikipedia.org/wiki/RS-232

    But that does not help you much directly... so I whipped this up:

    (1.) 'Tame' 12V signal down to 3V with resistors / voltage divider:

    `
    :+12V >-----//-------.
    :                    |
    :                    |
    :                    |
    :                    |
    :                    |
    :                    |
    :                    |
    :                R2 .-.
    :              5.6k | |
    :                   '-'
    :                    |
    :                    +---------------------> +3V (+2.92V 'exact')
    :                    |                       --- safe for 0..3.3V input
    :                R1 .-.                          still good enough to be
    :              1.8k | |                          detected as logical 1
    :                   '-'
    :                    |
    :0V GND --+-//-------+-----------------+---- 0V GND
    :         |                            |
    :       -----                        -----
    :        ---                          ---
    :         -                            -
    `
    

    The voltage divider of 5.6k Ohm and 1.8k Ohm takes the +12V down into the safe zone of 0..3.3V but still high enough - +2.92V - to be detected as a logical 1.

    (2.) Checking what this voltage divider does 'to us' when the signal switches to -12V:

    `
    :                        .-----------------> -3V  (-2.92V 'exact')
    :                        |                   --- kills 0..3.3V input
    :                        |    
    :                        |    
    :                        |    
    :                        |    
    :0V GND --+-//-------+---(------------+----- 0V GND
    :         |          |   |            |
    :       -----    R1 .-.  |          -----
    :        ---        | |  |           ---
    :         -         '-'  |            -
    :                    |   |    
    :                    +---' <--- -3V (-2.92V 'exact')
    :                    |
    :                R2 .-.
    :                   | |
    :                   '-'
    :                    |
    :                    |
    :                    |
    :                    |
    :                    |
    :                    |
    :                    |
    :-12V >-----//-------'
    `
    

    The same way the divider worked for positive voltages, it works for negative ones, which means we end up with -2.92V, way below the safe zone for a 0..3.3V input, and it will kill 'us'.

    (3.) A simple solution to prevent the -12V coming thru and reusing part of the existing voltage divider:
    add a diode in forward direction in to the input:

    `
    :                        .-----------------> 0V
    :                        |
    :                        |    
    :                        |    
    :                        |    
    :                        |    
    :0V GND --+-//-------+---(------------+----- 0V GND
    :         |          |   |            |
    :       -----    R1 .-.  |          -----
    :        ---        | |  |           ---
    :         -         '-'  |            -
    :                    |   |    
    :                    +---'
    :                    |
    :                R2 .-.
    :                   | |
    :                   '-'
    :                    |
    :                    |
    :                    |
    :                  --+--
    :                   / \
    :                  '---'
    :                    |
    :-12V >-----//-------'
    `
    

    The diode blocks the current flow and resistor R1 makes no the output line a 'solid' 0V / GND, detected as a logical 0.

    (4.) Verify the new circuit with +12V:

    `
    :+12V >-----//-------.
    :                    |
    :                  .---,
    :                   \ /
    :                  --+--
    :                    |
    :                    o <----- 11.5...11.3V
    :                    |
    :                R2 .-.
    :              5.6k | |
    :                   '-'
    :                    |
    :                    +---------------------> +3V (+2.80..+2.75V exact)
    :                    |                       ---------- still good enough 
    :                R1 .-.                                 to be detected as
    :              1.8k | |                                 logical 1
    :                   '-'
    :                    |
    :0V GND --+-//-------+-----------------+---- 0V GND
    :         |                            |
    :       -----                        -----
    :        ---                          ---
    :         -                            -
    `
    

    The diode now lets current pass. It passes though for a price: a voltage drop of theoretical 0.7V for a readily available Silicon (SE) diode, such as an 1N4148 or alike, (vs 0.2V of a today less used Germanium (GE) diode. GE was first detected and applied for semiconductors). I said theoretical, because the drop is also current dependent and is less for very low currents... Almost any switching diode will do. Calculated 'new' voltage at the input pin for the processor is now 2.80..275V, still good enough for a solid logic 1 detection.

    To understand a schematic, it is helpful to think of the 'text' line - position on the vertical matches the voltage. This is especially helpful to immediately understand what a voltage divider does. In our case we have to make it a 4:1, and since 'the 1 part is included in the 4 parts' - think of a gallon jar filled by 4 quarts reduced to 1, like 12V to 3V, the resistors are 3:1... and with the E-series values, 5.6k and 1.8k get us there... the values were chosen to put a load of about 1.6mA, well in the safe zone, and with a short line (symbolized as // ) , it is stable enough. I expected the GPS is really delivering -12/-12V on the lines..., if it is less, the divider resistances have to be adjusted.

    This help with the GPS TX line connected to the Pixle RX pin (the pin you define for your serial or is defined with the serial you pick).

    Then, of course, GND goes to GND.

    Now, that the GPS device sends, may require a few other connections to be in place. The null-modem description - such as the wikipedia one: https://en.wikipedia.org/wiki/Null_modem­ - gives it away. It also depends on the flow control. Since above circuitry works only from reading signals from GSP and no sending, flow control is not really an option. Similar, almost a simple, adaptors you can build to send signals to GPS with a Transistor and resistors.

    The whole RS-232 was introduced to transmit digital data over a simple 2-wire phone line with the technology available an affordable end of the 50' / early 60'. Beside the two digital devices, usually a RS-232 Terminal - CRT Monitor display and keyboard - and the computer, two Modems were needed - one on both sides - to MOdulate a carrier frequency by the digital signal, then transmitted as audio / sound over the phone line, and on the other side DEModulated back to the digital signal. Since with a direct line, this is not needed... but to simulate the circuitry to satisfy the protocol conditions, a null-modem is used, that, for example the RX with the TX lines on one connector compared to the other connector. Since we miss some of the signals on the processor side, we can connect specific pins on the GPS side, so the GPS think the modem (connection() is ready to send and the other side is ready to receive.

About

Avatar for allObjects @allObjects started