Cara setting ESP32 sebagai slave Remote IO

less than 1 minute read

Ilustrasi Modbus dan ESP32

Step 1 Persiapan hardware

terminasi kabel sbb: ESP32 – TTL to RS485 – USB to RS485

Step 2 Persiapan Software

  • Arduino IDE
  • Modbus Poll

Step 3 Programming Arduino IDE

  1. Pilih board ESP32 dan COM serial yang aktif.
  2. Upload program.
    Test
    

    Step 4 Testing menggunakan Modbus Poll

    Kirim perintah ke Slave ESP32:

  3. Hubungkan A-B modul RS485 di ESP32 ke USB to RS485.
  4. Hubungkan USB to RS485 ke komputer.
  5. Sesuaikan settingan COM, baudrate,data bit,parity,stop bit, lalu konek.
  6. Kirim perintah write coil dengan ID 10 dan address 1, pilih ON atau OFF.

     +-------------------+
     |    ESP32 + modul  |
     |    TTL to RS485   |
     +---------+---------+
               ^
               | 
               |
     +---------+---------+
     |   USB to RS485    |
     |   A-A B-B         |
     +---------+---------+
               ^
               | 
               |
     +---------+---------+
     |   Buka Modb Poll  |
     |   Koneksikan      |
     +---------+---------+
               ^
               | 
               |
     +---------+---------+
     | Testing Modb Poll |
     |  Write Coil       |
     +-------------------+
    

Resource:

finish