M5Stack offers a wide range of controllers for all kinds of applications—from the ultra-compact Stamp and Atom to the more powerful Core series with stackable modules. However, until recently, there wasn’t a device specifically designed for more demanding environments, such as industrial settings. That’s where the StamPLC comes in: a controller equipped with relay outputs and opto-isolated inputs, ideal for applications that require a rugged and robust design.
In this article, I’ll walk you through the key features of the StamPLC, both in terms of hardware and the programming tools available. We’ll also explore the preinstalled firmware so you can unlock its full potential right from the first boot.
In upcoming posts, I’ll be sharing hands-on examples that showcase the full capabilities of this powerful PLC. Keep reading to discover what you can build with it!
Key FeaturesCPUAt the heart of the StamPLC is the Stamp S3A module, powered by Espressif’s ESP32-S3FN8, featuring a dual-core LX7 32-bit processor running at 240 MHz, with 8 MB of Flash memory.
The StamPLC includes an onboard regulator that supports a wide input voltage range, from 6V to 36V DC.
The main power input is a barrel jack (GND outer, positive inner). A 3-pin terminal block (VIN, GND, and COM) is also available, mainly used to reference voltages for the inputs, as we’ll see later.
The PLC includes four relay outputs (also called dry contact outputs), which means they don’t deliver voltage themselves but instead expose the internal relay contacts (COM, NO, NC).
These relays can handle both AC loads (up to 5A @ 250V) and DC loads (up to 5A @ 28V).
Here’s an example showing how to wire a relay output to control an AC load (a lamp):
There are 8 opto-isolated inputs that accept voltages ranging from 5VDC to 36VDC.
Each input is connected to a terminal marked InX (In1 to In8) and a common terminal COM. Internally, the input circuit uses an optocoupler with two anti-parallel LEDs. This allows the inputs to be triggered by either high or low signals, depending on how the COM terminal is wired.
Here’s an example using a normally open pushbutton connected to IN1 and the positive supply (+). To complete the circuit through the optocoupler (see Fig. 7), the COM (C) terminal is connected to the power supply’s negative (-).
Thanks to the Stamp S3A, the StamPLC includes 2.4 GHz Wi-Fi and Bluetooth Low Energy (BLE).
Expansion PortOn one side of the device, you’ll find an expansion connector for attaching additional I/O modules.
Here’s an example of a StamPLC connected to an I/O expansion module:
On the front panel, the StamPLC features two Grove ports for easy connection to compatible sensors and peripherals.
Additionally, the PLC includes a PWR485 port for RS485 networks and a PWRCAN port for CAN bus communication.
The device comes with a 1.14” color display (135×240 px resolution), three multi-purpose buttons, a reset and boot button, and a buzzer for audio feedback.
A microSD card slot is available on the side for storing non-volatile data.
Internally, the StamPLC includes the following sensors, which can be accessed from your code:
- INA226: voltage and current sensor
- LM75: internal temperature sensor
- RX8130CE: Real-Time Clock (RTC)
Since it's based on the Stamp S3A, the StamPLC is compatible with the same programming tools, offering flexibility depending on your project requirements:
- Arduino
- UIFlow Ver. 2
- MicroPython
- ESP-IDF
- PlatformIO
The StamPLC comes with built-in firmware that includes useful features for initial testing, basic monitoring, and device setup:
- Timer Relay: toggles relay outputs in ON/OFF cycles—great for testing relays.
- Trigger Relay: activates outputs based on input conditions—ideal for quick functional testing.
- Settings Menu: allows you to configure: Modbus slave addres, Buzzer ON/OFF, Timezone for NTP sync and Firmware version info.
- Dashboard: displays real-time input/output status.
- Log Monitor: shows sensor and communication port data—great for debugging.
- EZData Wizard: helps set up Wi-Fi and connect to EZData cloud service, enabling remote monitoring and control.
If you have any questions or suggestions, feel free to leave them in the comment section below.
For more information and projects, you can check out my blog and social media.
See you next time! 🚀
Comments