Thanks for all thoughts! I have done some thinking about hardware and code. About the hardware:
the Railduino and Controllino setup makes me somewhat uncomfortable. The devices are directly connected to 230 Volts. Through relays, but still... I prefer using seperate DIN-rail mounted relays like Wago, Finder, Siemens... Is this why your channels are 3-18v as well, @Gordon ?
These use 12V/24V for inputs (pretty standard, PLC-wise), which a GPIO does not supply. I'll go for Darlington-transistors switching a 12V-line.
No matter the board, the number of GPIO's is always a limitation for a PLC. I'll use shift registers for outputs (to drive the Darlington-transistors).
I've been looking into i2c-port expanders, but in my experience, these work too slow for high speed inputs like rotary encoders.
For inputs I'll use opto-couplers, to prevent blowing up the microcontroller with 12V :)
I'm planning on doing 0-10V outputs for dimmable LED-drivers, I guess using an op-amp is the way (not familiar with those yet).
As for as the actual javascript, I'm using several classes (* = not started yet, waiting for parts):
PLC (container);
PLC_Display_128x64 (oled);
PLC_Input_Digital*;
PLC_Output_Digital*;
PLC_Output_Analog*;
PLC_Bridge (which creates an input and output, and simply mirrors output on input).
The 128x64 oled was a tad too small, a 320x240 LCD is in the mail. By using a seperate class with standard functions (mainly .bootscreen() and .update() ), changing the screen should be fairly easy. Hell, you could connect different screens at the same time, if you want to.
About the modular setup, mentioned before... Let's see how a single unit works out first ;)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks for all thoughts! I have done some thinking about hardware and code. About the hardware:
the Railduino and Controllino setup makes me somewhat uncomfortable. The devices are directly connected to 230 Volts. Through relays, but still... I prefer using seperate DIN-rail mounted relays like Wago, Finder, Siemens... Is this why your channels are 3-18v as well, @Gordon ?
These use 12V/24V for inputs (pretty standard, PLC-wise), which a GPIO does not supply. I'll go for Darlington-transistors switching a 12V-line.
No matter the board, the number of GPIO's is always a limitation for a PLC. I'll use shift registers for outputs (to drive the Darlington-transistors).
I've been looking into i2c-port expanders, but in my experience, these work too slow for high speed inputs like rotary encoders.
For inputs I'll use opto-couplers, to prevent blowing up the microcontroller with 12V :)
I'm planning on doing 0-10V outputs for dimmable LED-drivers, I guess using an op-amp is the way (not familiar with those yet).
As for as the actual javascript, I'm using several classes (* = not started yet, waiting for parts):
The 128x64 oled was a tad too small, a 320x240 LCD is in the mail. By using a seperate class with standard functions (mainly .bootscreen() and .update() ), changing the screen should be fairly easy. Hell, you could connect different screens at the same time, if you want to.
About the modular setup, mentioned before... Let's see how a single unit works out first ;)