1. Introduction
The M5Stack StamPLC is an IoT-enabled Programmable Logic Controller (PLC) development board designed for industrial automation and remote control applications. It integrates an ESP32 S3FN8 microcontroller, various input/output interfaces, and communication protocols to provide a versatile solution for monitoring and controlling industrial processes. Its compact design and DIN-rail mounting capability make it ideal for integration into existing control systems.
2. Product Features
- Integrated ESP32 S3FN8 microcontroller for powerful processing and wireless connectivity.
- IPS 1.14" LCD display (135x240px) for local status monitoring and configuration.
- Multiple input/output interfaces:
- 8x Optocoupler Isolated Digital Inputs (DC 5-36V)
- 4x Relay Outputs (5A@250VAC, 5A@28VDC)
- 3x Programmable User Buttons
- Communication interfaces:
- PWR485 (RS485)
- PWRCAN (CAN Bus)
- GPIO.EXT (2x8 Pin expansion header)
- Grove x2 compatible ports
- Additional features: Micro SD card slot for data storage, Buzzer for audible alerts, RTC (RX8130CE) for timekeeping, LM75 temperature sensor.
- DIN-rail mountable design for easy integration into industrial control cabinets.
- Supports remote control and monitoring via the Ezdata platform.
3. Components Overview
Familiarize yourself with the main components and interfaces of the StamPLC:
- Power Input: 5.5x2.1mm barrel jack, accepts DC 6-36V/1A.
- IPS 1.14" LCD: Small color display for user interface and data visualization.
- User Buttons (A, B, C): Three tactile buttons for navigation and control.
- LED: General purpose status indicator.
- PRESS:RST HOLD:BOOT: Buttons for device reset and entering bootloader mode.
- PWR485: Terminal block for RS485 serial communication.
- PWRCAN: Terminal block for CAN bus communication.
- Isolation Inputs (1-8): Eight screw terminals for digital inputs, optocoupler isolated, DC 5-36V compatible.
- Relay Outputs (1-4): Four sets of screw terminals for relay outputs, supporting up to 5A at 250VAC or 28VDC.
- GPIO.EXT: 2x8 pin header for extending general-purpose input/output.
- Micro SD: Slot for inserting a Micro SD card for data logging or program storage.
- Ports A, C: Grove compatible connectors for easy integration with M5Stack Grove modules.
- RTC: Real-Time Clock module (RX8130CE) for accurate timekeeping.
- LM75: Integrated temperature sensor.
- DIN-rail Holder: Integrated mechanism on the bottom for mounting onto standard DIN rails.
4. Setup and Installation
4.1 Power Connection
Connect a DC power supply (rated 6-36V, with a minimum current of 1A) to the 5.5x2.1mm barrel jack located on the side of the StamPLC. Ensure that the power supply's polarity matches the device's requirements.
4.2 DIN-rail Mounting
The StamPLC features an integrated DIN-rail holder for convenient installation in industrial environments. To mount, align the holder with a standard 35mm DIN rail and push the device firmly until it securely clips into place. To remove, use a flat screwdriver to gently pry open the locking mechanism on the holder and lift the device off the rail.
4.3 Input Wiring
The 8 isolation input channels are designed to support both high-level and low-level signals within a DC voltage range of 5 to 36V. These inputs are optocoupler isolated to protect the internal circuitry from external electrical noise and voltage spikes. Use a flat screwdriver for secure terminal connections.
- High-level signal input: Connect the negative pole of the sensor power supply to the 'COM' terminal. Connect the sensor's output signal to the corresponding 'INPUT' terminal.
- Low-level signal input: Connect the positive pole of the sensor power supply to the 'COM' terminal. Connect the sensor's output signal to the corresponding 'INPUT' terminal.
4.4 Wi-Fi Configuration for Remote Control (Ezdata)
To enable remote monitoring and control via the Ezdata platform, follow these steps to configure the Wi-Fi settings:
- Power on the StamPLC.
- Navigate to the Wi-Fi configuration mode on the device's IPS LCD screen using the user buttons.
- On your mobile device or computer, connect to the Wi-Fi Access Point (AP) broadcast by the StamPLC, typically named "M5StampPLC-WiFi-Config".
- Open your web browser and access the IP address
192.168.4.1. - On the web interface, configure the Wi-Fi information (SSID and password) for your local network and save the settings.
- After the device restarts and connects to your network, navigate to the "Monitor Link" page on the StamPLC's LCD.
- Scan the displayed QR code with your mobile device to access the remote control page and log in to your M5Stack account.
5. Operating Instructions
5.1 Local Operation
- LCD Display: The 1.14" IPS LCD provides real-time feedback on device status, sensor readings, and allows navigation through configuration menus.
- User Buttons (A, B, C): These buttons are typically used for menu navigation, selection, and triggering programmed functions. Their specific functionality depends on the loaded firmware.
- Reset Button: A short press of the "PRESS:RST" button will restart the StamPLC.
- Boot Button: Holding the "HOLD:BOOT" button during power-up will place the device into bootloader mode, which is necessary for flashing new firmware.
5.2 Remote Monitoring and Control (Ezdata)
Once successfully configured with Wi-Fi and linked to your M5Stack account, you can remotely monitor input statuses and control relay outputs from anywhere with an internet connection:
- Access the Ezdata remote control page via the QR code or direct URL on your mobile device or computer.
- The dashboard will display the real-time status of all 8 digital inputs (Input 1-8).
- You can toggle the state of the 4 relay outputs (Relay 1-4) directly from the Ezdata interface.
- The platform also provides essential device information such as device ID, Micro SD card status, status light color, external current, power voltage, and device temperature.
5.3 Advanced Interactions (API)
The StamPLC offers robust API interfaces for more complex interactions and seamless integration with custom software or other automation systems. These APIs allow programmatic access to read input statuses, control relay states, and retrieve various device information.
For detailed API specifications, documentation, and programming examples, please refer to the official M5Stack development resources and Ezdata platform guides.
6. Maintenance
- Cleaning: Use a soft, dry, anti-static cloth to clean the device's exterior. Avoid using liquid cleaners, solvents, or abrasive materials, as these can damage the casing or electronic components.
- Firmware Updates: Regularly check the official M5Stack website for the latest firmware updates. Firmware updates often include bug fixes, performance improvements, and new features. Follow the specific instructions provided with each firmware release for a safe update process.
- Storage: When not in use, store the StamPLC in a dry, cool, and dust-free environment. Protect it from direct sunlight, extreme temperatures, and high humidity to prolong its lifespan.
- Micro SD Card Management: If using a Micro SD card for data logging or configuration, ensure it is properly inserted and formatted. Periodically back up any critical data stored on the card.
7. Troubleshooting
- Device not powering on:
- Verify that the power supply is correctly connected to the 5.5x2.1mm barrel jack.
- Ensure the power supply provides the specified DC voltage (6-36V) and sufficient current (minimum 1A).
- Test the power adapter with another device if possible to confirm it is functioning.
- Wi-Fi connection issues:
- Confirm the StamPLC is in Wi-Fi configuration mode when attempting to connect to its AP.
- Double-check the SSID and password entered during the Wi-Fi configuration process for your local network.
- Ensure your Wi-Fi network is operating on the 2.4GHz band, as the ESP32 S3FN8 typically supports this frequency.
- Restart the StamPLC and your router, then attempt the Wi-Fi configuration again.
- Inputs not responding:
- Review the input wiring diagrams (Figure 4) and ensure your sensors are connected correctly for either high-level or low-level signals.
- Verify that the input signal voltage is within the acceptable DC 5-36V range.
- Check if the external sensors are properly powered and functioning as expected.
- Relays not activating:
- Ensure the load connected to the relay is within the specified current and voltage limits (5A@250VAC or 5A@28VDC).
- Inspect the wiring of the relay outputs for any loose connections or incorrect terminals.
- Confirm that the control signal (from local buttons or remote commands via Ezdata) is being sent correctly.
- LCD display blank or frozen:
- Attempt to reset the device by pressing the "PRESS:RST" button.
- If the issue persists, it may indicate a software problem; consider reflashing the device's firmware.
8. Specifications
| Feature | Specification |
|---|---|
| Microcontroller | ESP32 S3FN8 |
| Display | IPS 1.14" LCD, 135x240px |
| Power Input | DC 6-36V / 1A (5.5x2.1mm barrel jack) |
| Isolation Inputs | 8 channels, DC 5-36V |
| Relay Outputs | 4 channels, 5A@250VAC / 5A@28VDC |
| User Buttons | 3 (A, B, C) |
| Communication Interfaces | PWR485 (RS485), PWRCAN (CAN Bus), GPIO.EXT (2x8 Pin), Grove x2 |
| Storage | Micro SD card slot |
| Real-Time Clock (RTC) | RX8130CE |
| Temperature Sensor | LM75 |
| Mounting | DIN-rail mountable |
9. User Tips
- For stable remote control and monitoring, ensure your Wi-Fi network has a strong and consistent signal in the area where the StamPLC is installed.
- When connecting external components to the inputs and outputs, always double-check your wiring against the provided diagrams to prevent potential damage to the device or connected equipment.
- Utilize the Micro SD card slot for logging critical operational data from sensors or for storing custom configurations and programs, enhancing the device's functionality and data retention capabilities.
- Explore the extensive M5Stack community forums and official documentation for advanced programming examples, project ideas, and troubleshooting tips from other users and developers.
- Regularly back up your custom firmware and configurations to prevent data loss during updates or unexpected issues.
10. Warranty and Support
This M5Stack product is covered by a standard manufacturer's warranty against defects in materials and workmanship. The warranty period typically begins from the date of purchase. For specific warranty terms and conditions, please refer to the official M5Stack website or the documentation provided with your purchase.
For technical support, access to the latest documentation, firmware downloads, and community resources, please visit the official M5Stack website. You may also contact their customer service directly for assistance with product-related inquiries or issues.
Please retain your proof of purchase (e.g., invoice, receipt) as it will be required for any warranty claims or support requests.