HC-05 Module sending data problem (Mater + Slave)

348 Views Asked by At

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?

1

There are 1 best solutions below

1
On

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