I work in Industrial Automation as a Software Engineer and I work on projects which include a PLC, basically a controller to operate the machines. At work we talk about having such controllers for automation at home and this project is the result of it. A affordable solution which resembles a PLC and is easily programmed using the Arduino / PlatformIO software.
The idea that started all this was to make a garage door a.k.a the 'Famous Portal' controlled easily. So some sort of remote control device and a logic controller for the rest.
Building the ESP PLCAs I started making it, it turned out to be easily scaled to effectively use all pins of the controller. In the picture above the resulting controller, I didn't have the relays yet.... Alright, here is the controller with the relays:
I have prepared certain routines so that the actual programming, the part that makes the controller unique for its purpose, has become very easy.
So if you took the gerber and produced the PCB, grabbed a couple of components and soldered them on the PCB and then downloaded the sketch...... your very close to automating something cool. Essentially making weeks of gathering info in to a weekend project.
Side note: the ESP32-Dekitc-32U is what I used in this project, the pins don't align with directly with the PCB, So I made an adapter board. If anyone finds the right chip let me know. For now I'm satisfied with the workaround.What about the remote control?
As for now I have implemented the communications protocol to WifiAP, Bluetooth serial, Uart serial, Uart serial to a nextion device and Husarnet. For remote control of the ESP PLC you could use WifiAP, Bluetooth or Husarnet.My preference went out to using Husarnet as it makes the PLC globally accessible and within reach.
What about the 'Famous Portal'?The software for controlling the garage door basically takes a tiny part of the full set of options. It uses Husarnet and is accessible on your phone or computer via a webpage. For now it assumes that enabling digital output 1 opens it and that it closes as the output is turned off. More interesting logic will be written as the project gets tested on the door, one day.
Here I'm testing the basic peripheral functions of the PLC, like digital in- and outputs, analog in- and outputs and the nextion display. The PLC is powered with 24VDC and digital IO works at the same voltage.
Results: all functions work and power circuit can only handle the onboard equipment. I tried to power the nextion HMI with the board and the circuit can fry an egg. Recommended setup is to use an additional usb power supply and simply plug it into the esp32, that keeps things cool!
As you can see I joined a competition, unfortunately for me the PLC wasn't considered fun. However I moved on and introduced Husarnet to it, and the next video is about it:
In this video you also see a reference to the 'Famous Portal', this is it in action!
Note: The sketch on github is the one from the video and this is amazing! However for true PLC functionality a stable clock cycle is recommended, this can still be done by applying a task for a specific core. When the communication isn't blocking the main code, this could essentially become a powerful beast.What do I need it for?
Ever thought about checking your room temperature, treating your cat and/or dog to sweets while your not at home, checking your plants health, turning on the coffee machine, changing the lights, turning on the ac. How about your own little factory at home? If that doesn't tick the box, how about just the challenge of building the device!
Hardware Specs:- 8x 24VDC Digital inputs
- 8x 24VDC Digital output relays
- 4x 5VDC Analog inputs (can also take 0-10V using a divider)
- 2x Analog outputs with adjustable maximum voltage up to 24VDC
- 1x I2C port
- 1x Uart serial port
- 1x 'Shift register' port for extending multiple external digital inputs and outputs using shift registers of the type 74HC595 and 74HC165
Yesss!!!! You are going to build it! Or I guess you are still here. If you need the details, gerber, code, schematic, etc. find it on the github repository:https://github.com/SinkroniusMaximus/ESP32_Comm
Comments