Browsed by
Etiqueta: Arduino plc

Solar Monitoring System with Ardbox

Solar Monitoring System with Ardbox

Solar panels are popular because they are able to give us energy from light. When the light hits the panel solar conductor, the energy is translated into moving and electrons, creating current. In this newsletter we´ll make a simple monitoring system that you can develop for your home with Open Source Hardware.


Hardware selection depend a lot of your solar panel and its specs (output voltage, power). For this project, we will consider that we have a 5.2 kW solar panel which provides between 0-10V. The required hardware for the project is:

  1. Ardbox PLC.
  2. A Panel PC.
  3. Allegro ACS712: ACS712 chip allows DC and AC current measurement.  The value read from the sensor is proportional to current measured on the sensing terminals. Datasheet can be downloaded here.
  4. A Solar panel! We will use this one from Sparkfun.
  5. A Solar Inverter, which converts the variable direct current (DC) output of a photovoltaic (PV) solar panel into a utility frequency alternating current (AC).
  6. Wires and resistors (for the voltage divider).

On the other hand, to measure Voltage we will use a voltage divider circuit. As the ARDUINO analog pin input voltage is restricted to 5, the output voltage must be less than 5V. See the schematic: Sch   Software and code

Basically, the code measures each 5 seconds current and voltage, and, with these values, calculates the power. Later, sends these three values to the Panel PC.Regarding the voltage measure, Arduino ADC converts Analog signal to corresponding digital approximation.Regarding the current measure, we consider the following points to take into account:

  1. Analog read produces a value of 0-1023, equating to 0v to 5
  2. In our case, Analog read 1 = (5/1024) V =4.89mv, Value = (4.89*Analog Read value)/1000
  3. But as per data sheets offset is 2.5V (When current zero you will get 2.5V from the sensor’s output).

You can download the code in the following link: 2014111_arduino_code   Going Further and key benefits Solar panels come in many varieties. When shopping a solar panel for your system, there are a few specifications you need to follow. Contact us! Do you have a process to be automated? Contact Industrialshields to buy the proper hardware and Opiron to implement the entire solution.

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.


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: 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: 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.

Controller for your installation based on Open Source hardware

Controller for your installation based on Open Source hardware

Leaders from different companies usually agree in Water will be the oil of this century. Today, as populations increase and water supplies are stretched, we are developing more and more systems to make water at a low cost. We are going to develop a basic water treatment system based on Arduino. The water contained in the tank will be used for an irrigation system.

Equipment to be used Water treatment system consists basically of the following elements:

  • An M-Duino PLC: This controller is the heart of the system. It controls the display, generates interrupts, and controls the communication.

·        A Panel PC: Used to read and display the status of the system over the Panel Pc.

  • Turbidimeter: Water clarity is measured in nephelometric turbidity units (NTU). This measurement indicates the level of dirt particles within the water.
  • Ph Analyzer: pH is an indicator of the acid or alkaline condition ofwater. The pH scale ranges from 0-14; 7 indicates the neutral point
  • Level Sensor: The level sensor will indicate us the remaining level of water in the reservoir.

sch   Software and code In this example we will define some threshold alarms:

  • If the level in the water reservoir is less than 120 l, we will send an alarm.
  • If the turbiditmeter returns a value higher than 0.8 NTU, we will send an alarm.
  • Since the normal pH range for irrigationwater is from 6.5 to 8.4, we will send alarms whenever the value is out of the indicated range.

The PLC monitors all the time if an alarm occurs, and in that case, sends the boolean alarm of  each monitored variable: Level / Turbidity / PH to the Panel PC, where we will send print it in the screen. As in other newsletters, we use the Panel PC to read the status of the system efficiently. You can find the code to be uploaded here: 2014111_arduino_code   Key Benefits The main benefits of the Opiron purposed solution are:

  • Flexibility: This application note describes how the IndustrialShields hardware can be used to make an efficient water treatment system.
  • Freedom to modify your software: You aren’t limited to what one company believes you need.
  • East to be integrated: No matter if you already have an automation system. The Arduino hardware is easy to integrate into your system.
Contact us!

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

Labeling machine automation with M-Duino PLC

Labeling machine automation with M-Duino PLC

We will make the automation of a labeling machine based on the M-Duino PLC from Industrialshields. The labeling machine will label bottles of a plant.


Hardware I: Equipment to be used Basically, the labeling machine system consists of:

  • An M-Duino PLC: This controller is the heart of the system. It controls the display, generates interrupts, and controls the communication.
  • A Panel PC: Used to read and display the status of the system over the Panel Pc.
  • A detection Sensor:  We will make use of optical fork sensors based on infrared (non visible) light sources because they are easy to be programmed and they allow us a manual adjustment to the sensitivity via potentiometer.     
  • A motor: The motor is used to fix a constant speed in the conveyor belt. –
  • A relay: Used to activate the labeling piston.

sch Hardware II:  System   Regarding the system, in this section we will explain the interface between the M-Duino PLC and the other elements:

  • We have one detection sensor that we will program it as a Digital Input. Each time a bottle is placed in fornt of the detector, the conveyor belt will stop and wait for label the bottle.
  • The PLC will control the motion of the conveyor belt activating a motor through a relay. This will be programmed as a Digital Output.
  • The PLC will control too the labeling piston. This system will be activated through a relay too, and therefore, programmed as a Digital Output too.
  • As we made in other newsletters, the communication between Panel PC and the M-Duino will be made with I2C.

Furthermore, the system will be able to be stopped through the Panel PC. Let´s see a picture of the system to be automated:   foto       Software and code As we explained before, the system has a Panel PC which will allow us to visualize the system status (not implemented in this code) and stop the system whenever we need. The communication between the PLC and the Panel PC will be with I2C, so we will use the Wire library (you can get more information about the library here). The system will have 3 states:

  1. STOP: When the command is received from the Panel PC. This state will enable us to make maintenance activities on the system and other related tasks.
  2. Running and Bottle detected: When a bottle is detected, the system will stop the motor and activate the labeling piston.
  3. Running: This state activates the motor.

As in other newsletters, we recommend using Tesla Scada, which is able to work on Android systems. You can download the code here: 2014111_arduino_code     Key Benefits The main benefits of the Opiron purposed solution are:

  • Open Hardware: Which reliable, cheap and expandable
  • Real time measurement: Panel PC enable users to visualize the system status and stop it easy.
  • Easy to be integrated: If you plant has already installed an automation system, M-Duino can be integrated using Ethernet.
Contact us!
Do you have a process to be automated? Contact Opiron to implement the entire solution and Industrialshields to buy the proper hardware.


Ardbox PLC Arduino based and VFD (inverter) with USB communication

Ardbox PLC Arduino based and VFD (inverter) with USB communication


Los controladores o drivers de los variadores de frecuencia (conocidos por sus siglas en inglés VFD´s), son muy populares en la industria porqué pueden ajustar el par y la velocidad de un motor eléctrico AC a través de la variación del voltaje de entrada del motor y de la frecuencia. El punto de funcionamiento puede ser enviado desde un PLC y, por lo tanto, desde un ordenador. Esto es justamente lo que vamos a explicar en este post: como enviar el punto de trabajo a un VFD usando un ordenador conectado a un PLC Ardbox de Industrialshields. Freq Ardbox 1 Hardware usado y consideraciones

Antes de empezar a trabajar vamos a considerar varios puntos:

  • El VFD tiene una entrada analógica donde se puede enviar el punto de trabajo. Por lo tanto la comunicación entre el VFD y el PLC será 4-20 mA.
  • El entorno de programación de Arduino tiene integrado de serie un lector i grabador que hace mucho más fácil desarrollar y depurar tu código Arduino. Este punto es importante si tomamos en consideración que vamos a usar las herramientas Arduino para hacerlo todo más fácil.

Software y código

Para comunicar nuestro PLC Ardbox con el ordenador vamos a usar la comunicación serie. La comunicación serie tan sólo significa que sólo un bit de información es enviado a la vez. Hoy en día la mayoría de ordenadores no tienen puertos serie, pero usan un driver USB-to-serial para enviar y recibir comunicación serie a través del USB. Por lo tanto, básicamente, dentro del loop() vamos a comprobar si algún dato serie ha llegado con la función Serial.available(). Si algún dato ha llegado y está disponible, lo almacenaremos en una variable llamada setpoint, la cual vamos a usar para enviar al VFD como salida output. Puedes descargarte el software a continuación:

2014111_arduino_codeVentajas principales

Las principales ventajas de la solución propuesta son:

  • Fácil: Fácil es la primera palabra que os viene a la cabeza cuando pensamos en esta aplicación. Fácil de instalar, fácil de programar y fácil de enviar ordenes al VFD!!!
  • Open Source: Porqué open source significa flexibilidad en términos de libertad de elegir, modificar e integrar tu sistema con otros más complejos, a la vez que és robusto y fiable.
  • Útil: Este proyecto es útil porqué los VFDs están en todos los sitios. Puedes veer un ejemplo de aplicación con VFDs en nuesto blog blog.
Ponte en contacto con nosotros!!!

Tiene un proceso para ser automatizado. Póngase en contacto con Industrialshields para implementar la solución completa y para comprar el hardware adecuado.

Industrial shields Open Source Hardware Case Study: Air-conditioning system

Industrial shields Open Source Hardware Case Study: Air-conditioning system

Como activar un relé con el PLC basado en Arduino Ardbox Relay a través de una Touchberry Pi


Los sistemas de aire acondicionado por lo general tienen un contactor disponible que nos permitirá conectar un relé. Conectando el relé PLC basado en Arduino Ardbox, y el PLC a la Touchberry Pi, seremos capaces de controlar de forma remota las condiciones climáticas. En este proyecto, Opiron Electronics propone hacer un sistema de control básico con una interfaz que nos permitirá activar el sistema de climatización de forma remota con el relé del PLC Ardbox Relay y el Touchberry Pi como HMI, todo ellos productos basados en Hardware libre que se pueden encontrar en IndustrialShields. El SCADA propuesto que se ejecutará en el Touchberry Pi es la siguiente: http://www.myscadatechnologies.comPICTURE Hardware y comunicación

Vamos a usar el siguiente hardware para la instalación:

  • Un Ardbox Relay PLC que es un PLC basado en Arduino con 18 entradas o salidad digitales que ofrece la posibilidad de comunicación entre dos ordenadores usando I2C. Para más detalles ver el siguiente link.
  • Un Touchberry PI 10.1″. El Touchberry Pi es un Panel PC de 10.1″ diseñado para trabajar en entornos industriales y basado en el popular Raspberry Pi. Para más detalles ver el siguiente link.

Para comunicar ambos aparatos entre si, vamos a hacer uso del protocolo de comunicación I2C. La principal ventaja del mismo es su flexibilidad ya que nos permite conectar facilmente hasta 128 dispositivos como esclavos a la Touchberry Pi. Para más detalles sobre como hacerlo ver dbajo el apartado de Software al respecto.


Software y código

Tal y como se ha mencionado más arriba, el SCADA propuesto está alojado en myscadatechnologies. Hemos escogido este SCADA por varios motivos: es Open Source, está disponible para su descarga immediata y ha sido testeado previamente para Raspberry Pi, que es el procesador de la Touchberry Pi. Desde el punto de vista de la comuniaciones, I2C necesita un Master. El otro aparato debe ser el esclavo. En nuestro caso usaremos el Ardbox PLC Relay como esclavo y el the Touchberry Pi como Master. Por lo que respecta al Ardbox Relay, el código que le tendremos que cargar se puede ver a continuación:


When the command received from the scada is activated, we will activate the relay. Regarding the Touchberry Pi software to be developed, basically, moreover to install the scada on our Touchberry Pi, we have to set the it as a master in the I2C developed network First we need to enable the I2C module on the PI.

  1. As root edit /etc/modprobe.d/raspi-blacklist.conf and comment out the line blacklisting i2c-bcm2708
      $ cat /etc/modprobe.d/raspi-blacklist.conf # blacklist spi and i2c by default (many users don't need them) blacklist spi-bcm2708 #blacklist i2c-bcm2708

Next add i2c-dev to the /etc/modules file so it’s loaded on boot:

              # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. # Parameters can be specified after the module name. snd-bcm2835 ipv6 i2c-dev

Finally install i2c-tools:

  $ sudo apt-get install i2c-tools $ sudo adduser pi i2c

Finally, reboot the Touchberry Pi. Key Benefits The main benefits of the Opiron purposed solution are: –      Scalable system: The purposed system permits to connect multiple devices to the Touchberry Pi. –      Open Sourcebased: This feature means big flexibility, big availability of resources on the internet in case of failures or change implementations, etc. –      Remote control: Control climate conditions through an HMI panel.

  // Industrial Shields by BOOT & WORK CORP. // Powered by Opiron Electronics // Feb.2015 technical information for newsletter // The sketch demonstrates how to control a relay // with Ardbox Relay PLC and a Toucbberry Pi. // Keywords: Ardbox Relay PLC, Touchberry Pi. ////////////////////////////// //// PLC: ARDBOX RELAY PLC //// //// Number of inputs: 0 //// Number of outputs: 1 //// you need to configurate the correctly switch position for running like digital / analog or PWM mode ////////////////////////////// //// EXTERNAL BOX PIN NUMBERS: //// LEFT SIDE (Where Input Voltage lives). //// Pin 4 (RELAY 1) => (Box Pins: 0 and 1) //// Pin 5 (RELAY 2) => (Box Pins: 2 and 3) //// Pin 6 (RELAY 3) => (Box Pins: 4 and 5) //// Pin 7 (RELAY 4) => (Box Pins: 6 and 7) //// Pin 8 (RELAY 5) => (Box Pins: 8 and 9) //// Pin 9 (RELAY 6) => (Box Pins: 10 and 11) //// Pin 10 (RELAY 7) => (Box Pins: 12 and 13) //// RIGHT SIDE (The other side). //// Pin 11 (RELAY 8) => (Box Pins: 0 and A) //// //// Pin 13 => (Box Pin 1 Arduino Digital => 5Vdc output if pinMode(13,OUTPUT)) //// OR //// (Box Pin 1 Arduino Digital => 5Vdc input if pinMode(13,INPUT)) //// //// Box Pin 2 (GND) //// Box Pin 3 (GND) //// //// Pin 3 => (Box Pin 4) //// Pin 2 => (Box Pin 5) //// //// Pin A0 => (Box Pin 6) //// Pin A1 => (Box Pin 7) //// Pin A2 => (Box Pin 8) //// Pin A3 => (Box Pin 9) //// Pin A4 => (Box Pin 10) //// Pin A5 => (Box Pin 11) //// //// Analog pins 0 to 5. Put the jumper ON in case of digitalRead (24Vdc) otherwise analogRead (10Vdc) //// //Libraries #include //Library for I2C Master & Slave //Pins defintion #define Relay 4 // Relay //I2C Address for the Ardbox Relay PLC #define SLAVE_ADDRESS 0x04 // Variables int number = 0; // Functions void receiveData(int byteCount); void setup() { pinMode(Relay, OUTPUT); Serial.begin(9600); // start serial for output // initialize i2c as slave Wire.begin(SLAVE_ADDRESS); // define callbacks for i2c communication Wire.onReceive(receiveData); Serial.println(“Ready!”); } void loop() { //Nothing } // I2C Slave communication void receiveData(int byteCount){ while(Wire.available()) { number =; if (number == 1) { digitalWrite(Relay, HIGH); // Switch on the Relay } else if (number == 0) { digitalWrite(Relay, LOW); // Switch off the Relay } } }
Ethernet Arduino PLC. How to connect M-duino PLC to Ethernet

Ethernet Arduino PLC. How to connect M-duino PLC to Ethernet

M-duino PLC usa un chip ENC28J60 para conectar mediante Ethernet. Puedes escoger dos bibliotecas para poder conectar todos los productos de la família M-Duino:

  1. UIPEthernet: los puedes encontrar en Gitub, que usa las misma funciones que el Shield de Ethernet oficial de Arduino. 
  2. EtherCard: en este caso puedes encontrar la documentación y bibliotecas en Jeelabs. Necesitarás importar totas la bibliotecas:
 Sketch / Import Library / Add Library.

I después reiniciar Arduino IDE. Es muy important tener en cuenta:

///// static byte mymac[] = {0xFF,…,0xFF}; // Valor de la MAC del ethernet. if (ether.begin(sizeof Ethernet::buffer, mymac, 53) == 0) Serial.println(“Failed to access Ethernet controller”); ////

Feeding a packaging machine with a frequency driver with Arduino

Feeding a packaging machine with a frequency driver with Arduino

En la industria lechera, las máquinas de envasado se utilizan para envasar los alimentos en recipientes tales como yogur, leche, etc. Por lo general se integran en sistemas más complejos, y están alimentados por un tanque que contiene el producto (por lo general la leche). En este proyecto vamos a diseñar un sistema compuesto de un tanque con leche, una máquina de envasado, una válvula para abrir y cerrar el camino a la máquina, y un PID formado por un medidor de flujo y una bomba controlada por un controlador de frecuencia. Además, el sistema tiene un timbre para alertar a los operadores de la planta en caso de alarmas. El sistema es como se muestra a continuación (clicar en la imágen para ampliar):

filling system v1

Read More Read More