1. Introduction
The HKL-EA2 is an industrial-grade IoT control module built around the ESP32 chip. It features multiple communication modes and rich peripheral interfaces, offering high stability and cost-effectiveness. This module supports Wi-Fi, Ethernet, and 4G (SIM7600) communication, and includes 4-channel digital inputs, 2-channel relay outputs, RS485, and dual I²C expansion interfaces. It is ideal for various applications such as IoT, industrial automation, home automation, and remote data acquisition, enabling remote device control, data transmission, and status monitoring.

2. Setup Guide
2.1. Hardware Overview and Pin Definitions
The HKL-EA2 board integrates various components and interfaces. Understanding the pin layout is crucial for proper setup and operation.

Key Interfaces:
- Digital Inputs: IN1 (GPIO36), IN2 (GPIO39), TEM1, TEM2
- Power & Ground: 3V3, GND, 5V, 12V
- RS485: A, B terminals (RX: GPIO35, TX: GPIO32)
- Relay Outputs: NO1, COM1, NC1, NO2, COM2, NC2 (Relay01: GPIO2, Relay02: GPIO15)
- IIC Extension Ports: Port01 (5V), Port02 (12V) (SDA: GPIO4, SCL: GPIO16)
- Communication Modules: SIM7600 4G Module, SIM800L 2G Module (GSM_RX: GPIO13, GSM_TX: GPIO5)
- Ethernet: HanRun HR911105A RJ45 port
- Other: Reset button, Download button, Type-C USB port, Buzzer (GPIO12)
2.2. Dimensions and Installation
The HKL-EA2 controller is designed for easy integration, including European distribution box installation due to its 4cm height.

Dimensions:
- Board: 92.5mm x 87mm
- Enclosure: 115mm x 90mm x 40mm
2.3. Power Connection
Connect a 12V DC power adapter to the module. Ensure correct polarity to avoid damage.

Steps:
- Connect the positive pole of the 12V DC power adapter to the +12V terminal.
- Connect the negative pole of the 12V DC power adapter to the GND terminal.
- After power-on, the module's indicator light should illuminate, confirming normal power supply.
2.4. Firmware Download and Driver Installation
To program the HKL-EA2, you need to install the CH340 driver and connect the module via its Type-C USB port.

Driver Download:
- Windows: CH341SER_EXE.html
- macOS: CH34XSER_MAC_ZIP.html
Steps:
- Download and install the appropriate CH340 driver for your operating system.
- Connect the module's Type-C interface to your computer's USB port using a Type-C data cable.
- The module should now be recognized by your computer, allowing for firmware uploads.
2.5. Network Configuration
The HKL-EA2 supports both Wi-Fi and Ethernet for network connectivity.

Wi-Fi Configuration:
- Pre-set the Wi-Fi SSID and password within the module's firmware. The module will automatically connect to the specified Wi-Fi network upon power-on.
- Alternatively, use the module's AP mode to connect your mobile phone to its hotspot, then access the configuration page to set Wi-Fi parameters.
Ethernet Configuration:
- Insert one end of a network cable into the RJ45 interface on the module.
- Connect the other end of the network cable to a router or switch.
- You can configure the module's IP address via a connected computer.
3. Operating Instructions
3.1. Digital Inputs
The HKL-EA2 provides 2 sets of digital input ports (IN1/GPIO36 and IN2/GPIO39). These inputs detect a LOW signal when shorted to GND.

Example: Wired Door Sensor Connection
To detect the state of a door, connect a wired door sensor to the digital inputs:
- Connect the Normally Open (NO) line of the door sensor to Input01 (IN1/GPIO36).
- Connect the Normally Closed (NC) line of the door sensor to Input02 (IN2/GPIO39).
- This setup allows the module to monitor the open/closed state of the gate.
3.2. Temperature Sensor Detection
The EA2 control board supports two DS18B20 temperature sensors using GPIO33 and GPIO14.

Wiring Method:
- Connect the 3V3 pin of the DS18B20 to the 3V3 terminal on the EA2.
- Connect the GND pin of the DS18B20 to the GND terminal on the EA2.
- Connect the data pin of the first DS18B20 to TEM1 (GPIO33).
- Connect the data pin of the second DS18B20 to TEM2 (GPIO14).
3.3. Relay Outputs
The HKL-EA2 features two relay outputs (Relay01 on GPIO2 and Relay02 on GPIO15) for controlling external devices.

Relay Parameters (JQC-3FF-5VDC-1ZS):
- Current Capacity: 10A at 277VAC, 12A at 125VAC
- Terminals: NO (Normally Open), COM (Common), NC (Normally Closed)
Example: Controlling Valves and Lights
Relays can be used to control DC12V valves and 220VAC/110VAC LED lights. Connect the load to the appropriate COM and NO/NC terminals of the relays.
3.4. RS485 Communication
The RS485 port (RX: GPIO35, TX: GPIO32) enables robust communication for various industrial and distributed control applications.

Applications:
- Distributed Systems: Connect multiple node devices for centralized data management and control.
- Industrial Automation: Transfer control instructions and data between industrial devices.
- Long-distance Communication: Benefit from RS485's anti-interference ability and long transmission distance.
- Smart Device Networking: Integrate and collaborate with other smart devices featuring RS485 interfaces.
Example: Connecting to a PC or PowerMeter
- Use a USB to RS485 converter to connect the EA2 to a PC for serial communication.
- Connect to ModBus-RTU compatible devices like PowerMeters for data acquisition.
3.5. Buzzer Output
The onboard buzzer (GPIO12) provides audible feedback for various system events.

Functions:
- System startup prompts
- Connection success notifications
- Abnormal alarms
- Development and debugging assistance
- Operation confirmation
3.6. IIC Expansion Ports
The HKL-EA2 has two IIC (I²C) expansion ports (SDA: GPIO4, SCL: GPIO16) for connecting additional sensors and modules.

IIC Extension Port1 (12V):
- Provides 12V power for IIC devices.
- Can be connected to modules like the DO8 relay expansion board to increase the number of available relays (e.g., 2 onboard + 8 external = 10 relays).
IIC Extension Port2 (5V):
- Provides 5V power for IIC devices.
- Ideal for connecting sensors such as SHTX temperature and humidity sensors for environmental monitoring.
3.7. 4G/2G Module Communication
The HKL-EA2 supports SIM7600 4G and SIM800L 2G modules (GSM_RX: GPIO13, GSM_TX: GPIO5) for cellular communication.

Functions with 4G/2G Modules:
- Remote Communication: Transmit sensor data (temperature, humidity, pressure) to cloud servers for real-time storage and analysis.
- Remote Control: Send instructions to the EA2 via mobile applications or web pages to control actuators (motors, valves, etc.).
- SMS Notification: Receive SMS alerts for abnormal device conditions or sensor data exceeding thresholds.
- IoT Applications: Facilitate various Internet of Things projects requiring cellular connectivity.
3.8. Ethernet Communication
The Ethernet interface provides a high-speed and stable network connection for the HKL-EA2.

Benefits:
- High-speed and stable network connectivity.
- Convenient for remote access and control.
- Supports interconnection with other network devices.
3.9. MQTT Communication (Wi-Fi & Ethernet)
The HKL-EA2 supports MQTT communication over both Wi-Fi and Ethernet, allowing integration with MQTT brokers for IoT applications and home automation.
You can configure your PC as an MQTT server to realize MQTT communication within your local area network (LAN).
3.10. Programming Examples (Arduino & ESPHome)
The HKL-EA2 is highly versatile and can be programmed using both Arduino IDE and ESPHome.

Demo Code:
Example code for various functionalities is available on GitHub:
- Download Link: https://github.com/hankerila-MA/HKL-EA2.git
- Unzip Code:
8846768
ESPHome Integration:
The EA2 seamlessly integrates with Home Assistant via ESPHome. By editing YAML configuration files, you can achieve precise control over hardware resources. Detailed screenshots and YAML code examples are provided in the official documentation (see Section 6).
4. Maintenance
- Keep the module in a dry, dust-free environment.
- Avoid exposing the module to extreme temperatures or humidity.
- Ensure proper ventilation if operating in an enclosed space.
- Regularly check wiring connections for looseness or corrosion.
- Clean the board gently with a soft, dry brush if dust accumulates.
- Do not attempt to repair the module yourself if you are not qualified.
5. Troubleshooting
- Module not powering on: Verify 12V DC power supply connection and polarity. Check the power indicator LED.
- Firmware upload failure: Ensure CH340 drivers are correctly installed and the Type-C cable is functional. Try a different USB port or cable.
- Wi-Fi connection issues: Double-check SSID and password in firmware. Ensure the module is within Wi-Fi range. Try configuring via AP mode.
- Ethernet not connecting: Verify network cable connection to both module and router/switch. Check router settings for IP assignment.
- Sensor readings incorrect: Check sensor wiring (VCC, GND, SDA, SCL/Data). Ensure correct GPIO pins are configured in your code.
- Relays not activating: Verify power supply to the relays. Check control signals (GPIO2, GPIO15) in your code. Ensure load is correctly wired to COM and NO/NC terminals.
- Communication (RS485, 4G/2G) issues: Check wiring for RS485 A/B lines. For cellular modules, ensure SIM card is correctly inserted and activated, and antenna is connected. Verify GPIO assignments for GSM_RX/TX.
For more detailed troubleshooting, refer to the official documentation or community forums for ESP32 and related components.
6. Specifications
| Feature | Detail |
|---|---|
| Model | HKL-EA2 |
| Brand | hankerila |
| Type | Control Systems |
| Origin | Mainland China |
| Main Control Chip | ESP32-WROOM-32E-N4 (Dual-core, 2.4GHz Wi-Fi 802.11 b/g/n, Bluetooth 4.2, 16MB Flash) |
| Digital Inputs | 2 sets (IN1/GPIO36, IN2/GPIO39) |
| Temperature Sensor Ports | 2 sets for DS18B20 (GPIO33, GPIO14) |
| Relay Outputs | 2 channels (Relay01/GPIO2, Relay02/GPIO15), JQC-3FF-5VDC-1ZS, 10A/277VAC, 12A/125VAC |
| RS485 Port | Yes (RX: GPIO35, TX: GPIO32) |
| IIC Expansion Ports | 2 (12V & 5V, SDA: GPIO4, SCL: GPIO16) |
| Buzzer | Yes (GPIO12) |
| 4G Module Support | SIM7600 (GSM_RX: GPIO13, GSM_TX: GPIO5) |
| 2G Module Support | SIM800L (GSM_RX: GPIO13, GSM_TX: GPIO5) |
| Ethernet | Yes (HanRun HR911105A) |
| Dimensions (Board) | 92.5mm x 87mm |
| Dimensions (Enclosure) | 115mm x 90mm x 40mm |
| Package Weight | 0.32 kg |
| Package Dimensions | 15cm x 15cm x 6cm |
7. User Tips
- If you are downloading the demo code from the provided GitHub link, remember that the unzip password is
8846768. - When working with ESPHome, ensure your YAML configuration accurately reflects the GPIO pins and desired functionalities to avoid unexpected behavior.
- For initial setup and testing, start with simple functionalities (e.g., blinking an LED or reading a single sensor) before moving to complex integrations.
8. Warranty and Support
For detailed warranty information, please refer to the seller's terms and conditions at the time of purchase. Technical support may be available through the manufacturer or seller's designated channels.
An additional user manual in PDF format is available for download: View User Manual (PDF)