Browsed by
Category: General

How to program Arduino based PLC through Ethernet

How to program Arduino based PLC through Ethernet

This post it shows how to install Ariadne bootloader that allows to programming Arduino based PLC’s of Industrial Shields through Ethernet TFTP Client. Then it is also showed an example of how to program it.

The requirements for this example are:

M-Dunio needs the new Ariadne bootloader to be programmed through Ethernet. How to upload the new bootloader? 

Read More Read More

How to create a web server to read a SD card with our PLC’s

How to create a web server to read a SD card with our PLC’s

This is an example it is explain how to read a SD card into the PLC through Ethernet connection. In this post we will see how create a server that when there is a request through a browser, you can see the directories and the files of the SD card in your browser.

The PLC has to be connected the Ethernet connection and the SD card correctly, check this post how to do it.

Read More Read More

Control of soil humidity in an irrigation installation

Control of soil humidity in an irrigation installation

This newsletter is really interesting because control soil humidity in irrigation installations makes saving water, time and money.  Continue reading… sch0   Hardware

Hardware selection is very important when you try to develop projects where sensors, actuators and PLC´s must talk each other. For this project, with chosen the following equipment:

  • PLC: Any PLC from IndustrialShields is a good option. We have chosen the M-Duino PLC Arduino 21 I/Os Analog/Digital because we think it has different communication options to be communicated with other systems (Ethernet, RS232, I2C…).
  • Panel PC: For this project, we are going to visualize and control our installation with the HummTouch 10.1” Linux panel pc.
  • Humidity sensor: Probably, when you try to develop an application like we are trying to, the most important selection is the sensor itself. There are a lot of humidity sensors available around the market completely compatible with Arduino based hardware. We´ve chosen the SHT10 sensor from Adafruit because it includes a temperature sensor as well, it comes with an intermetal mesh encasing, which is weatherproof and because it is designed to be submersible in water.
  •  Others: A relay to activate the irrigation system, a 24Vdc power supply, a good enclosure to protect the equipment and cables are important things to keep in mind too.

Software

To develop the project, the first thing to do is to ensure that we have the proper software and libraries. As we are going to use the SHT10 sensor, we will use the SHT1x library that you can download in the following link: https://github.com/practicalarduino/SHT1x. SHT10 uses a two wire communication interface similar to I2C. As usual, we will use the Arduino IDE to develop the software. You can download it here: http://www.arduino.cc/en/Main/Software. You can see the code in the following file: 2014111_arduino_code   Key benefits   There are a lot of benefits to implement a humidity control in an irrigation system. Let´s see the most important:

  • Saves Time: Automation does the job for you, so you can go on holidays knowing that your flowers will be maintained when you come back.
  •  Saves Money: No more water wasted, automation guarantees efficiency: water is used when is needed.
  •  Improves Growth: An irrigiation system guarantees flowers waterd with proper amount of water. In a reasonable time, you will have a greener garden.

  Contact us!

Do you have a process to be automated? Contact Industrialshields to buy the proper hardware and Opiron to implement the entire solution.

How to read an Analog Input

How to read an Analog Input

You can read the data of an Analog Input through:

...
int myAnalog;
...
void setup() {}

void loop() {
   myAnalog = analogRead(A0);
}

With this piece of code you’ll read the voltage of a sensor. As our analog input works between 0-10V, the read value (myAnalog) will be a value between 0-1023.

If the value of sensor is (3V), myAnalog value is 3*1023/10 = 307.

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, in order to show it, through the Arduino IDE console, minicom,…, or any other Serial Console that you have in your Laptop.

  Serial.println("MyVar value");

If you have an M-Duino, you don’t need the

  while (!Serial) {}  

line.

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 the possible frame errors will be controlled by TCP/IP layers.
  • So, if you know Modbus, you have an easier way to implement it!.