A New Era of Bluetooth Communication: Wireless Data Transmission Between Microcontrollers and PLCs

Dear friends, hello everyone! I am Da Yi, and today I bring you a technical article about wireless communication between microcontrollers and PLCs. With the arrival of the Internet of Things era, Bluetooth technology has quietly undergone revolutionary changes, and wireless communication will play an increasingly important role in the field of industrial control.

First, let’s take a look at the advantages of Bluetooth communication:

  1. Wireless and portable, not limited by cable length and wiring
  2. Low power consumption, such as the energy-saving scheme of Bluetooth 5.0, significantly extends battery life
  3. Secure and reliable, with encryption authentication mechanisms, making communication more secure and reliable
  4. Low cost, Bluetooth modules are cheap and compact

Hardware Preparation
First, we need to prepare some necessary hardware:

  1. Microcontroller development board (such as Arduino or STM32)
  2. PLC controller (Siemens S7-200 or Mitsubishi FX series)
  3. Two low-power Bluetooth modules (recommended HC-05 or JDY-08)

Circuit Connection
The connection of the Bluetooth module is very simple; let’s take the HC-05 module as an example:
Microcontroller:

  • Module RXD <–> Microcontroller TXD
  • Module TXD <–> Microcontroller RXD
  • Module GND <–> Microcontroller GND
  • Module VCC <–> Microcontroller 3.3V or 5V

PLC:

  • Module RXD <–> An empty input terminal of the PLC
  • Module TXD <–> An empty output port of the PLC
  • Module GND <–> PLC GND terminal
  • Module VCC <–> PLC 24V DC power supply

It’s that simple! How does it feel like plugging in a USB keyboard, right?

Software Configuration
Next, let’s proceed with a simple software configuration:

Microcontroller Side

c

// Baud rate 9600, stop bit 1, no parity
Serial.begin(9600);

// Send data to the Bluetooth module
Serial.print("Hello PLC!");  

// Read feedback data from the Bluetooth module
if (Serial.available()) {
  char data = Serial.read();
  // Process the received data
}

PLC Side

  1. Create a new serial communication module in the PLC software
  2. Set communication parameters consistent with the Bluetooth module: 9600, 8, N, 1
  3. Use serial read/write instructions to interact with Bluetooth module data

It’s that simple; the microcontroller and PLC can directly “talk” via wireless Bluetooth! Doesn’t it feel like a hacker invasion?

Practical Application
Having discussed so much theory, it’s time for a practical case:

A factory workshop has installed a PLC control system, but due to the long pipeline, there are often signal transmission delays and interference issues. A friend suggested using Bluetooth technology for wireless modification to improve system stability. We adopted the aforementioned solution to wirelessly transmit key PLC signal quantities to the microcontroller monitoring terminal in the main control room, solving the workshop’s problems.

Precautions

  1. Module pairing: Remember to pair the two Bluetooth modules before powering on
  2. Prevent interference: Bluetooth communication can easily be interfered with by 2.4G frequency WiFi and other wireless devices, so appropriate shielding and cabinet isolation measures should be taken
  3. Power consumption control: If powered by battery, pay attention to the low power consumption settings of the Bluetooth module to avoid rapid discharge

In summary, Bluetooth communication brings new opportunities for the wireless transformation of microcontrollers and PLCs. Keep learning and enjoy the new era of wireless control! Feel free to communicate if you have any questions. See you next time~

Leave a Comment