1

I've been working with a Siemens PLC to send data using RS232. The communication itself is working perfectly, I can monitor it if I connect the PLC to my PC (via a serial comm port).

Now, I wanted to make this communication wireless. I found out about the HC-05 modules and decided to get a few. I set 2 of them up with my arduino (one as master, one as slave, both paired and using the UART 9600,1,0 which is the same that my PLC uses).

I made the following connections:

PC Connection (with a serial comm adapter)

PLC Connection

Let's say I want to send this string:

<SoH>1RZ<CR>

If I check my serial monitor, I get weird stuff. Like:

@#NULL©#NUL

The weird thing is that if I just remove the bluetooth modules and connect the PLC's Rx and Tx to the PC's Tx and Rx, respectively, the data is sent flawlessly. So I know that I have everything sorted out on the PLC/PC side.

Has anyone been through this, or does anyone have a suggestion that I can try?

gbernardon
  • 11
  • 1
  • I would try to divide the problem and check you have one end working before trying to get the other end working. If you make the PLC HC-05 the server, then you can use https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal on an Android phone to check that it is working. Once that end is working, then start on the PC HC-05 – ukBaz Sep 14 '20 at 10:51

1 Answers1

0

RS232 typically uses ±12V. Negative voltages between -3V and -15V is logic high and positive voltages +3V till +15V is logic low.

Your bluetooth module on the other hand uses TTL logic. With a voltage range of 0-5V. 0-0.8V is low, 2-5V is high.

So

a) you cannot create the necessary voltage levels

b) you risk to destroy your 5V hardware by connecting it to ±12V.

c) you might run into problems as RS232 also has optional mechanisms for flow control. So Rx and Tx might not be enough.

You'll at least need a TTL-> RS232 level shifter for the PLC side and a USB to TTL serial adapter for the PC

Piglet
  • 27,501
  • 3
  • 20
  • 43