ควบคุม Pump/Motor จาก ESP32 หรือ Automation ต้องรู้อะไรบ้างก่อนสั่ง ON/OFF.
พื้นฐานการควบคุม Pump และ Motor จาก ESP32, Relay, Contactor และ Automation โดยแยก command, feedback, overload, dry-run, flow/pressure, timeout และ safety interlock ให้ชัด
การทำให้ ESP32 สั่ง ON/OFF ได้เป็นเพียงส่วนเล็กที่สุดของระบบ Pump/Motor Automation จริง
สิ่งที่สำคัญกว่าคือ:
Command
↓
Power switching / drive
↓
Motor / Pump
↓
Physical response
↓
Feedback
↓
Fault / protection / retry policy
ถ้าไม่มี feedback ระบบอาจคิดว่า Pump ทำงาน ทั้งที่ motor ไม่หมุน น้ำไม่ไหล หรือ valve ยังปิดอยู่
ESP32 ไม่ควรขับ Motor โดยตรง
GPIO ของ MCU เป็น logic signal ไม่ใช่ power output สำหรับ Motor/Pump
Architecture ที่พบได้ เช่น:
ESP32
↓
Driver / Relay
↓
Contactor / Motor starter / Drive
↓
Motor / Pump
อุปกรณ์ที่อยู่กลางขึ้นกับ motor type, voltage, current, starting method และ control requirement
อ่านความต่างได้ที่ Relay กับ Contactor ต่างกันอย่างไร
Command ON ไม่เท่ากับ Pump ทำงานจริง
หลังสั่ง Pump ควรมี evidence จาก process เช่น:
- auxiliary contact
- motor current
- pressure increase
- flow detected
- speed feedback จาก drive ในระบบที่รองรับ
ตัวอย่าง:
Command Pump ON
↓
Wait 3–5 s ตามระบบ
↓
Pressure/Flow ต้องเข้าสู่ช่วงที่คาด
↓
ไม่เข้า → fault / stop / alert
เวลาและ threshold ต้องอิงระบบจริง ไม่ควร copy ตัวเลขเดียวกันทุก Pump
Dry-run คืออะไร
Pump บางประเภทอาจเสียหายหรือร้อนผิดปกติเมื่อทำงานโดยไม่มีของเหลวตามเงื่อนไขที่ออกแบบ
Dry-run protection อาจอาศัยหลาย signal เช่น:
- source level
- pressure behavior
- flow
- motor current
- controller-native protection
ไม่ควรพึ่ง Soil Moisture หรือคำสั่ง software เพียงอย่างเดียว
Overload Protection ไม่ใช่หน้าที่ของ ESP32
Software สามารถ detect anomaly และสั่งหยุดได้ แต่ไม่ควรแทน protection ที่ต้องทำงานอิสระเมื่อ controller/network ล้ม
ตัวอย่าง protection layer ที่อาจต้องมีตามระบบ:
- breaker/fuse
- motor overload protection
- phase loss/unbalance protection ในระบบที่เกี่ยวข้อง
- thermal protection
- emergency stop/isolation
- drive-native protection
กฎคือ:
Automation control ≠ Electrical protection
Starting Current สำคัญ
Motor อาจมีกระแสเริ่มต้นสูงกว่ากระแสขณะทำงานปกติ
ผลคือ:
- Relay/Contactor ต้องเลือกตาม motor duty/rating
- cable/protection ต้องออกแบบตามระบบ
- power supply/generator/inverter อาจต้องรับ surge
- current threshold ใน software ต้องไม่ตีความ start transient เป็น fault โดยไม่เข้าใจ profile
Pressure และ Flow ช่วยยืนยัน process
Pump ในระบบน้ำควรดูทั้งสองอย่างเมื่อเหมาะสม:
Pump ON
↓
Pressure rises?
↓
Flow exists?
สถานะต่างกันบอก failure คนละแบบ
อ่านต่อ: Pressure Sensor กับ Flow Meter ต่างกันอย่างไร
Water Level ใช้เป็น Interlock ได้อย่างไร
ถ้า Tank level ต่ำเกินไป:
Low-level condition
↓
Inhibit Pump start
แต่ Sensor เดียวอาจเสียได้ ระบบ critical อาจต้องมี independent low-level switch หรือ controller-native protection เพิ่ม
อ่านต่อ: Water Level Sensor เลือกอย่างไร
Valve Sequence สำคัญ
ใน Irrigation บางระบบไม่ควรสั่ง Pump โดยไม่คิดสถานะ Valve
ตัวอย่าง conceptual sequence:
Check source water
↓
Open target Valve
↓
Confirm opening / wait required time
↓
Start Pump
↓
Verify Flow + Pressure
ตอนหยุดอาจมี sequence ต่างกันตาม hydraulic design เพื่อหลีกเลี่ยง pressure transient
อ่าน Solenoid Valve vs Motorized Valve
Minimum Run Time / Rest Time
Pump หรือ Compressor บางระบบไม่ควร start/stop ถี่เกินไป
Software จึงอาจต้องมี:
- minimum ON time
- minimum OFF time
- maximum starts per period
- cooldown
- timeout
ค่าจริงต้องมาจากอุปกรณ์/process ไม่ใช่กำหนดตามความสะดวกของ Dashboard
Manual Mode และ Local Override
ระบบ Smart Farm ที่พึ่ง Cloud อย่างเดียวเสี่ยงเมื่อ network ล่ม
ควรคิดเรื่อง:
- local manual switch
- maintenance mode
- auto/manual selector
- safe state เมื่อ controller reboot
- fallback เมื่อ Sensor stale
การ override ต้องออกแบบไม่ให้ bypass protection สำคัญ
Variable Speed Pump / VFD
ถ้าใช้ drive/VFD ระบบอาจควบคุม speed เพื่อรักษา Pressure/Flow แทนการ ON/OFF อย่างเดียว
แนวคิด:
Pressure setpoint
↓
Controller
↓
VFD speed command
↓
Pump
↓
Pressure feedback
นี่เป็น closed-loop control ซึ่งต้อง tune และมี protection ตาม drive/motor system
PR25 ยังไม่ลงรายละเอียด wiring/parameter ของ VFD เพราะขึ้นกับรุ่นและมี safety consequence สูง
Fault State ที่ควรคิดตั้งแต่แรก
อย่างน้อย:
- source water low
- no flow after start
- pressure too low/high
- sensor stale
- valve did not respond
- motor overload trip
- communication loss
- controller reboot
ถ้าไม่ออกแบบ fault behavior ระบบ Automation อาจทำงานได้เฉพาะวันที่ทุกอย่างปกติ
สรุป
การควบคุม Pump/Motor ที่ดีต้องแยก 4 ชั้น:
Decision
↓
Control command
↓
Power interface
↓
Physical feedback + independent protection
ESP32/Home Assistant สามารถเป็นส่วนของ Decision และ Control ได้ แต่ ความปลอดภัยและ protection ต้องไม่หายไปเมื่อ software/network มีปัญหา