Mecworks
We have several in-house designed relay and sensor boards that we use at my place of work.  They are all driven by the Raspberry Pi and take advantage of some fairly popular I2C GPIO and analog sensors as well as the 1-wire bus on the Raspberry Pi.

In particular use the following:
  •  MCP23017 16 channel GPIO expander (used to drive relays or receive digital inputs) (we support up to 8 of these on an I2C bus giving us up to 128 GPIOs)
  • ADS1115 16-Bit ADC we support up to 4 on a bus giving us up to 16 16bit ADC inputs
  • DS18B20 1-wire temperatures sensors (we support several on a bus)
As you may know, these are very common chips used for automation in the Raspberry Pi and Arduino communities.  Is there a way to drive our current boards using Raspberry Pis with OpenPLC?
Reply 0 0
thiagoralves
OpenPLC doesn't support these natively. You would have to modify the Raspberry Pi driver (/webserver/core/hardware_layers/raspberrypi.cpp) to add support for them
Reply 0 0
pedromorgan
petes asks > ?.
This needs needs to be in manwel, OpenPLC is industrial, so IC2 is unlikely as a machine interface.. ?
(however within a "unit device" ? )

Some people are confused, like me previously about its role...
Reply 0 0
Mecworks

pedromorgan wrote:
petes asks > ?.
This needs needs to be in manwel, OpenPLC is industrial, so IC2 is unlikely as a machine interface.. ?
(however within a "unit device" ? )

Some people are confused, like me previously about its role...

You misunderstand my implementation. Of course, I2C will not be used to connect measuring devices.  I2C would be the data bus INSIDE the PLC which connects its' internal components.  In our case, my company makes a custom board that becomes part of the raspberry Pi.  The new complete PLC = (RPi + custom GPIOs + Relays + Temperature Sensors board).   We would like to configure the custom RPi and extension board to be a PLC controlled by OpenPLC.

This new PLC would then be connected to other industrial sensors, actuators, etc.  What needs to happen is that support for these common chips needs to be added to OpenPLC.

Reply 0 0
thiagoralves
Mecworks wrote:
What needs to happen is that support for these common chips needs to be added to OpenPLC.

If you’re willing to take the task, this shouldn’t be too hard. OpenPLC uses WiringPi to access the Pi’s GPIO. I believe that all these chips are also supported by WiringPi, which means that probably just a few lines of code here and there might be enough to do it all. If you’re creating the hardware, you might then have a customized OpenPLC driver based on the Raspberry Pi driver just for your device.
Reply 1 0
Reply