Browsed by
Tag: communication

Serial Communication between Raspberry and MDuino/Ardbox

Serial Communication between Raspberry and MDuino/Ardbox

In this post it will be shown how to communicate using the serial between a MDuino/Ardbox and a Raspberry Pi. It actually exists many ways on communicating between this two devices, but today we will focus on see how to do it using the Serial. Serial communication is actually one of the easiest way to communicate. It only uses two wires to achieve that, Rx & Tx. One wire is to send(Tx) and the other is for receiving(Rx). To stablish…

Read More Read More

How to use RS232 on Industrial Arduino Based PLC

How to use RS232 on Industrial Arduino Based PLC

On this post it’s showed how to use RS232 on an Arduino based PLC of Industrial Shields. To use RS232 is required the next points: Industrial Shields equipment (not any Ardbox HF version) Industrial Shields boards installed, follow this older post to install it. Hardware Configuration The first step is configure the hardware. The right connections between the desired devices are showed below: Industrial Shields PCL RS232 Device RX TX TX RX GND GND   Also it’s important to have…

Read More Read More

How to test / read data from console / RS232

How to test / read data from console / RS232

RS232 commnication is not necessary, but is very useful. You can write some code and you want to switch on a led. The easier way to know what is happening if the led isn’t turning on, is through RS232, and watching what are the values of the vars,…   So, if you have purchased an Ardbox, you’ll need to initialize communications through: Serial.begin(9600); while (!Serial) {} and after that, you’ll be able to send any value to the RS232 port,…

Read More Read More

RS485 Communication

RS485 Communication

Arduino based PLC through RS485 port can connect with other devices which also use RS485 communication port PLC available to use RS485: 20 I/Os PLC: Ardbox Analog Ardbox Relay Ethernet PLC: M-duino 21 M-duino 42 M-duino 58 M-duino 19R M-duino 38R M-duino 57R

I2C Communication

I2C Communication

In order to communicate through I2C, we have to do two type of programs. We have to create some code for the Master device (PLC in our case), and another piece of code for the Slave devices, such as PLC, or any other device (RTC clock, ADC,…, that has an I2C available port). Master Code: #include <Wire.h> void setup() { Wire.begin(); Serial.begin(9600); delay(500); } void loop() { Serial.println(“Initial”); Wire.requestFrom(2, 1); // request 1 byte from device #2 while(Wire.available()) { char c…

Read More Read More

How to Modbus-Ethernet

How to Modbus-Ethernet

Modbus is a Serial communications protocol and it is used for communicating with several industrial devices. It may run over RS485, Ethernet, or whatever hardware interface. If we have an ethernet connection between a lot of devices, we can use this hardware connection (eth), and over it, we can use our own protocol (custom protocol,…), or for instance, Modbus protocol. The way is the same as using RS485, but hardware connections will become much easier, the speed will be higher, and…

Read More Read More