The ESP-32 PLC is a home and small industry automation solution designed to simplify control and monitoring tasks. With the incorporation of an ESP-32 microcontroller, this PCB offers excellent processing power and IoT capabilities, making it suitable for a wide range of applications such as automation, smart home applications, cloud-based IoT applications, and more.
The inspiration for this project came from the need for a versatile PLC system that can handle both home and small industry applications. To fulfill this need, I decided to design a custom PCB that integrates all the necessary components for efficient control and monitoring.
Check out the full project on Flux (Schematic + PCB layout): https://www.flux.ai/rafalozano/esp32-s3-plc-for-home-and-small-industry
Design and FeaturesThe PCB design of the ESP-32 PLC incorporates essential components to provide a reliable and efficient control and monitoring system. The key features of the PCB design include:
- ESP-32 microcontroller: The heart of the system, the ESP-32 offers powerful processing capabilities and extensive IoT support.
- 8 Solid State Relays: These SSRs enable control of various electrical devices or systems.
- 8 I/O: This provides additional flexibility for connecting external devices or sensors.
- 1 ADC: The analog-to-digital converter allows for precise measurement and monitoring of analog signals.
- USB-C: The inclusion of USB-C allows for easy and convenient connectivity options.
The ESP-32 microcontroller serves as the central processor for the entire system. It is responsible for managing all the input and output functions, as well as communication with other devices. Due to its versatility and affordability, the ESP-32 microcontroller was chosen as the ideal processing unit for this project.
Here are some key features of the ESP32-S3-WROOM-1:
- Dual-core Xtensa LX7 microprocessor with a clock speed of up to 240 MHz.
- 384 KB of ROM and 512 KB of SRAM.
- Up to 16 MB of PSRAM 1.
- 802.11 b/g/n Wi-Fi and Bluetooth 5 (LE) connectivity.
- Up to 36 GPIOs and a rich set of peripherals.
- Built-in PCB antenna.
The PCB incorporates several key features to enhance its functionality. These features include a USB-C port for easy connectivity and compatibility, eight Solid State Relays for controlling various devices, eight I/O ports for additional input and output capabilities, and an ADC for accurate analog measurements.
Challenges in the USB-Serial Converter and Voltage RegulatorHowever, despite the meticulous design process and the incorporation of quality components, the initial version of the ESP-32 PLC faced some unexpected challenges. One of the main challenges encountered was with the USB-Serial converter (CH340E). The CH340E USB-Serial converter posed complications, causing issues with the communication between the PCB and external devices. Additionally, an error was discovered in the voltage regulator responsible for converting the 24V DC input to a stable 12V output. These complications resulted in the project not working as expected.
USB-Serial Converter
The WCH CH340E was chosen because it is the latest version of the previous CH340 chips. I followed the recommended design to enable a one-key download:
Voltage regulator
A major mistake I made was using too many decoupling capacitors, which interfered with the voltage regulators' operation. Additionally, some capacitors were polarized and I installed them with the wrong polarity.
The 74HC14D is, in fact, a high-speed, low-power integrated circuit designed to provide robust signal conditioning functionality in digital environments. Essentially, it comprises six Schmitt-trigger inverters capable of converting standard digital signals into clean and stable ones, which is crucial for the proper operation of control systems. Additionally, its compatibility with a wide range of supply voltages makes it a versatile choice for various applications.
In the context of a PLC based on the ESP32 S3, the 74HC14D plays a vital role in the interface between external sensors and actuators and the main processor. It acts as a reliable intermediary ensuring that input and output signals are correctly interpreted and processed by the microcontroller, thus guaranteeing precise control and a rapid system response.
The SN74HC541PWR IC can be used to transfer data between different parts of a circuit or system, such as LEDs and more. The IC has two output enable inputs (OE1 and OE2) that control the state of the outputs. If either OE1 or OE2 is high, all eight outputs are in the high-impedance state, which means they are disabled. If both OE1 and OE2 are low, the outputs are enabled and provide true data from the inputs.
The SN74HC541PWR IC operates with a wide voltage range of 2 V to 6 V, has low power consumption, high output current, and fast switching speed. The IC also has a data flow-through pinout, which means that the inputs and outputs are on opposite sides of the package, making it easier to design printed circuit boards.
Understanding the Power Requirements: Working with 24V DCThe ESP-32 PLC is designed to work with a 24V DC power supply. This voltage requirement was chosen to ensure compatibility with common industrial power systems and provide sufficient power for the connected devices.
Partnership with PCBWay: Sponsorship and SupportI would like to express my gratitude to PCBWay for their sponsorship and support in bringing this project to life. Their expertise in PCB manufacturing and assembly has been invaluable throughout the development process.
Despite the challenges faced in the initial version, I am excited to announce that a new version of the ESP-32 PLC is already in the works. The upcoming version will address the issues with the USB-Serial converter and voltage regulator to ensure seamless communication and stable power supply.
Adding Functionality: CAN Bus and Integrated SensorsIn addition to the necessary corrections, the new version of the ESP-32 PLC will also include additional features to enhance its usability and speed.
One of the planned improvements is the integration of a CAN Bus, which will enable communication and data exchange between multiple devices within a network.
This will allow for better coordination and control of various devices in home and small industry applications. Furthermore, I plan to incorporate an integrated sensor into the PLC. This sensor will provide valuable data for monitoring and automation purposes, further expanding the capabilities of the PLC.
Future Directions for Small Industry ApplicationsIn the future, I envision the ESP-32 PLC being utilized in a wide range of small industry applications. Its versatility and ability to communicate with various devices make it a powerful tool for automation and control.
Conclusion: Evaluating Success and Lessons LearnedIn conclusion, while the initial version of the ESP-32 PLC faced complications with the USB-Serial converter and voltage regulator, the project has provided valuable insights and learnings. Through the challenges encountered with the USB-Serial converter and voltage regulator, I gained a deeper understanding of the importance of thorough testing and validation in the PCB design process. These obstacles have led to valuable lessons in component selection, compatibility testing, and the critical nature of power regulation in electronic systems.
Moving forward, the upcoming version of the ESP-32 PLC not only aims to rectify the issues experienced but also to incorporate additional features that will further elevate its capabilities. The integration of a CAN Bus and an integrated sensor signifies an important step towards creating a more comprehensive and adaptable solution for automation and control.
With the continual improvement and expansion of features, the ESP-32 PLC is poised to become a reliable and flexible system for various small industry applications.
Also I want to say thanks to the Flux.ai team and user community, which has become an essential platform for my learning and an accessible tool to enhance my capabilities with modern electronic development. I believe that these types of design tools are instrumental in democratizing electronic design and fabrication, making it more inclusive and open to a wider audience.
Finally, I want to thank PCBWay for being an essential part of electronic development. PCB manufacturing is one of the most difficult and costly parts of the process, but thanks to PCBWay, it has become much easier and accessible to a large audience. Additionally, their support for the community of creators and entrepreneurs is truly admirable. Thank you PCBWay for making it possible for our projects to come to life! 🙌
Comments
Please log in or sign up to comment.