Browsed by
Tag: arduino

Ardbox – MDuino Arduino pin

Ardbox – MDuino Arduino pin

This post describes how to gain direct access to Arduino board pins  inside the  Ardbox and MDuino PLCs. This allows to work with the PLCs in the same way as using an Arduino, in other words,  pins at 5V and configurable as input or outpts.

Also, this  enables usage of  sensors  working at lower voltages than industrial standards 10V dc/24Vdc.  NOTE:Make sure the voltage DOES NOT EXCEED 5VDC!!!!!!!!

Following are listed the connections with direct access to the Arduino board  pins.

Ardbox: DE-D7  // RE-D4 // SDA-PIN2  // SCL-PIN3

MDuino: SCL // SDA // RX0 // TX0 // RX1 // TX1 // Pin3 // Pin2

In order to enable the direct connection to Arduino pins, the configuration switches for these connections must be set to OFF position.

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.

Real time electrical consumption monitoring with M-Duino

Real time electrical consumption monitoring with M-Duino

In this Project, we will show you how to read electrical consumption using Modbus communication. Modbus is an industry standard communications protocol for electronic device Hardware I: Equipment to be used The electrical consumption monitoring 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 on the status of a counter and display the graph of monthly consumption over the Panel Pc. –         Switch: Switch will work as the interface between slaves and Master in our control network.

PanelPc

  • A Power Meter witch Modbus TCP/IP communication capabilities (as TCP is Transmission Control Protocol and IP is Internet Protocol.)
  • Wires and some programming experience J.

Hardware II:  Communication The nice feature of Panel PC we used is that it has many interfaces such as Ethernet, USB  and I²C as well. We´ve expressly chosen Ethernet because our PLC  and our I2C panel have this Ethernet connecitivity. See the following picture to understand it: sch2   Software and code Arduino sketch essentially uses the Modbus TCP library for Arduino  (see the Arduino installer tutorial here).  Some important things to take care when we use this library:

  1. Insert the modbus_update function in the loop, because. takes care of the received modbus commands and will modify the registers accordingly in case of writing or reading requests.
  2. Declare an integer array (named holdingRegs) that stores the modbus registers.
  3. We recommend to review modbus tcp basics at http://www.simplymodbus.ca/

After that, just start sending values to the panel PC through USB  I2C communication. You can find the code to be uploaded to the PLC here: 2014111_arduino_code   You need to download  libraries:

And what about the software to install in our Panel PC to start visualizing graphs? In this case, we recommend to use Tesla Scada, wich is able to work on Android systems . The panel pc will start receiving data and print out data in graphs! Key Benefits The main benefits of the Opiron purposed solution are:

  • Time Saving: Forget to go to view and write values in notebooks, your control system will do this job for you.
  • Real time measurement: System provides reliable data quickly.
  • Digital data analysis: If you can measure it, you can improve it!
Contact us!
Do you have a process to be automated? Contact Opiron to implement the entire solution and Industrialshields to buy the proper hardware.
Chloride Dosing System

Chloride Dosing System

Abstract

Manufacturing drinking water is a process with different steps. The last step is called disinfection, used to destroy microorganisms in water. To achieve it, systems inject chlorine. This technique is called dosing. Dosing is the technique for controlling the addition of a substance to a flowing liquid or gas.  Dosing systems are designed to achieve the required dosing level by maintaining the control signal as a proportion of the fluid flow rate. In this post we are going to develop a chloride dosing system based on Arduino.

Equipment to be used

Dosing control equipment consists basically of the following elements:

  • A controller, in this case we will use an M-Duino PLC.
  • A flowmeter.
  • A dosing pump.
  • A dosing level sensor.nanodac-dosingcontrol

The following figure shows the general arrangement of the dosing control system: The dosing concentration measured by the dosing level sensor is used to stop the pump if a there is high concentration in the tank. The flowmeter provides the input of the control loop, which is connected to the pump (as the output).

Software and code

In this example, dosing level and flowmeter are configured as a 0-10V analog input. The pump works with a frequency driver. As we have to develop a control loop, we have created a PID controller linked to the specified input, output and setpoint. You can find the code to be uploaded here:2014111_arduino_codeKey Benefits

The main benefits of the Opiron – Industrial shields proposed solution are:

  • Flexibility: This application note describes how the Open source based hardware can be used to control the dosing level of a chlorine system. However this same architecture can be used with any liquid or gas using the PID algorithm.
  • Freedom to modify your software: You aren’t limited to what one company believes you need.
  • Easy 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 Industrialshields to implement the entire solution and to buy the proper hardware.

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

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

 

Abstract

HVAC systems usually have an available contactor that will allow us to connect a relay. Connecting the relay to an Ardbox Relay PLC, and the PLC to the Touchberry Pi, we will be able to control climate conditions remotely. In this project, Opiron Electronics proposes to make a basic control system with an interface that will enable us to activate the HVAC system remotely with the Ardbox Relay PLC and the Touchberry Pi HMI, both from IndustrialShields. The purposed SCADA that will run on the Touchberry Pi is the following: http://www.myscadatechnologies.com/

PICTURE

Hardware and communication

We are going to use:

  • An Ardbox Relay PLC: This is a 18 digital inputs / outputs Arduino based PLC that offers the possibility of communication between two computers using I2C. For more details, see the following link.
  • A Touchberry PI 10.1″: The Touchberry Pi is a 10.1″ panel PC designed to work in industrial environments and based on the popular Raspberry Pi.  For more details, see the following link.

To communicate both devices, we will make use of the I2C communication. The main advantage to use this protocol is its flexibility as you can easily connect up to 128 slaves to the Touchberry Pi. See below the Software explanation for more details on how to do it. 

air-conditioner-room2

Software and code

As mentioned above, the purposed SCADA is owned by myscadatechnologies. We’ve chosen this SCADA because it is open source, available to be downloaded and tested on Raspberry Pi, which is Touchberry Pi processor based. Since the communication point of view, I2C needs one Master. The other device will be the slave. The Ardbox PLC Relay will be the slave and the Touchberry Pi the master. Regarding the Ardbox Relay, the code to be uploaded is the next one:

2014111_arduino_code

When the command received from the scada is activated, we will activate the relay. Regarding the Touchberry Pi software to be developed, basically, as well as installing the scada on our Touchberry Pi, we have to set it as a master in the I2C developed network, but before 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 -www.opiron.com- // 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 = Wire.read(); if (number == 1) { digitalWrite(Relay, HIGH); // Switch on the Relay } else if (number == 0) { digitalWrite(Relay, LOW); // Switch off the Relay } } }
POWERED BY OPIRON ELECTRONICS
Controlling the level of a tank for sewage treatment with an Arduino base PLC

Controlling the level of a tank for sewage treatment with an Arduino base PLC

10 Inputs / 10 Outputs
PLC Arduino ARDBOX 20 I/Os Analog
visit www.industrialshields.com

This project was undertaken to ensure the supply of a treatment plant for waste water purification. This required the correct filling of the tank that was responsible for providing the Dirty water. 2014111_Tratamiento_de_aguas

scheme_pictures
scheme_pictures

Ardbox is an easy, compact and economical way to automate your installation

10 Inputs / 10 Outputs
PLC Arduino ARDBOX 20 I/Os Analog

Signals configuration:

  • IN:                                                                                                                Ardbox Analog Signal
    • Full level Gravity filling tank (Digital input “24Vdc”)                          I0.1
    • Minimum level of Gravity filling tank (Digital input “24Vdc”)          I0.2
    • Level of storage tank (Analog input “0-10Vdc”)                                 I0.9
    • Auto/Manual Selector (Digital input “24Vdc”)                                   I0.3
    • Regulator quantity of Acid (Analog input “0-10Vdc”)                       I0.8
    • Regulator quantity of Flocculant (Analog input “0-10Vdc”)            I0.7
    • Ok water into processing plant ( Digital input “24Vdc”)                   I0.4
  • OUT:
    • Grinder pump (Digital output “ 24Vdc”)                                Q0.5
    • Acid dosing PUMP (Analog output “0-10Vdc”)                                   Q0.6
    • Filling pump to processing machine (Digital output “24Vdc”)         Q0.4
    • Flocculant dosing PUMP (PWM output “24Vdc”)                Q0.3
    • Full level Gravity filling tank (Digital output “24Vdc”)                       Q0.2
    • Air Electrovalve (Digital input “24Vdc”)                                               Q0.7
    • Red Light (Manual MODE)                                                                      Q0.8
    • Green Light (Auto MODE)                                                                       Q0.9

_2014111_water_treatment_V1_0 2014111_arduino_code

10 Inputs / 10 Outputs
PLC Arduino ARDBOX 20 I/Os Analog
Arduino Applications – Using Arduino as an Industrial PLC

Arduino Applications – Using Arduino as an Industrial PLC

Ardbox is an Arduino based PLC for Industrial use.  Most of the industry sensors work at 24 Vdc. As the standard ARDUINO works at a voltage of 5Vdc and 3.3Vdc depending on the different devices this in principle makes impossible its usage on industrial environments. This is the main reason why Industrial Shields has adapted the Arduino Industrial original electronic in order to let them work at 24Vdc and it has also has made sure that it meets all the requirements and industrial regulations.

The initial Arduino PLC developed by Industrial Shields are:

Each one of these devices looks for the maximum Arduino performance, being possible to be used as an industrial machine controller, automation processes, control systems, etc… Furthermore, if there is a need of a combination of the different Arduino PLCs, it is possible to use them in Master – Slave mode as the whole Ardbox family is prepared in order to offer a better and optimized control and communication with the machinery.