Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help with RS232 wiring

tsopkow

New Member
Hi, I am trying to make an RS232 cable to connect a digital pressure module to a PLC. I purchased a cable that the maufacture supplies that uses a usb-->RS232 convertor (Note: The convertor supplies 5 VDC power to the module). I am able to communicate with the module using a terminal emulator with the command they supplied.

However, a PLC will not accomodate a USB connection so I need to make up my own cable. I have connected as follows

Module Rx pin to DB9 pin 3
Module Tx pin to DB9 pin 2
Module VCC pin to External Power supply V+
Module GND pin to External Power supply V-

This will only echo back the commands I send (even garbage commands).

I opened up the ends of the manufactures cable (See attached photos). It appears I have wired it the same, except for the GND, which I think could be the problem.

I think it is the GND that is the problem, the power and the communications could be two separate sources. Where do I connect the DB9 GND (pin 5) to?

Thanks in Advance.
Terry
Plug.jpg
USB.jpg
 
DB9 connectors always need pin 5 connected, in my experience. I think that all you have to do is to wire 0 V to pin 5 and to the -ve power input of the pressure sensor.

DB9 RS232 uses the original voltage levels, so logical 1 (idle) is between -5 V and -15 V, while logical 0 is between +5 and +15 V.

A lot of "RS232" converters use 0 - 3 V or 0 - 5 V with logical 1 (idle) at 3 (or 5) V and logical 0 at 0 V

A USB to RS232 converter can come in two forms, one that outputs at the original levels and the other that is just 0 - 3 V or 0 - 5 V. I don't know which yours is.
 
It looks like the converter only has a USB – UART chip, meaning it's using 0-5v (or 0-3.3v) signals. It needs a MAX232 chip to convert 0-5v signals to the bipolar levels required by RS232.

Look for a converter that explicitly states it's a USB – RS232 converter.
 
It looks like the converter only has a USB – UART chip, meaning it's using 0-5v (or 0-3.3v) signals. It needs a MAX232 chip to convert 0-5v signals to the bipolar levels required by RS232.

Look for a converter that explicitly states it's a USB – RS232 converter.
I think that the OP could communicate to the pressure module using the USB converter and a PC. It was the PLC he was having trouble with.
 
Ok, I missed a detail....

If the computer can talk to the sensor using the pictured USB – UART module, then the sensor is using TTL levels, not RS-232 levels. I would expect this to be the case with the sensor, especially as it's powered by 5 volts.

Therefore, it's still an issue of RS232 levels vs. TTL levels. The DB-9 connector of the PLC will be using RS-232 levels, so a MAX232 chip is still needed.

Something like this. They are available with either male or female pins, start with whatever mates to the existing DB-9 connector. Pins 2 & 3 may still need to be swapped, with pin 5 (ground) connected between the PLC and converter.

Screenshot_20241202_153611_Edge.jpg
 

Latest threads

New Articles From Microcontroller Tips

Back
Top