Browsed by
Tag: 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

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.

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.

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

Abstract

Variable Frequency Drivers (usually known as VFD´s), are very popular in industry because they can adjust torque and speed of AC motors by varying motor input frequency and voltage. The setpoint can be sent from a PLC and, therefore, from a computer, so this is what we are going to show you in this newsletter: how to send a setpoint to a VFD using a computer connected to an Ardbox PLC from Industrialshields.  Freq Ardbox 1 Hardware and considerations

Before starting the job, we will consider these points:

  • The VFD has an analog input where we can send the setpoint. Therefore, the communication between the VFD and the PLC will be 4-20 mA.
  • The Arduino programming environment has a built in serial reader and writer that makes it easier to debug and develop your Arduino code. This point is important taking into account that we will use the

Software and code

To communicate our Ardbox PLC with our computer we will use Serial communication. Serial communication just means that only one bit of information is sent a time. Most computers don’t have serial ports, but use a USB-to-serial driver to send and receive serial communication over USB So basically, inside loop(), we will check if any serial data has arrived with Serial.available(). If data has arrived and is available, store that data in a variable called setpoint, which we will use to send it to the VFD as an analog output. You can download the code here: 2014111_arduino_code Key Benefits

The main benefits of the Opiron purposed solution are:

  • Easy: Easy is the first word that comes to our mind when we think in this application. Easy to install, easy to program, easy to send commands to the VFD!
  • Open Source: Because open source means flexibility in terms of freedom to modify and integrate your system into more complex systems, and reliability.
  • Useful: This project is useful because VFD´s are everywhere. See an example of VFD´s application in our blog.
Contact us!

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

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
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 is using an ENC28J60 chip in order to connect to Ethernet. You can choose two libraries in order to connect all M-duino family products

  1. UIPEthernet: you can find in Gitub. It uses the same functions as the Official Arduino Ethernet Shield.
  2. EtherCard: You can find this documentation and libraries in the Jeelabs website. You need to import all libraries:
 Sketch / Import Library / Add Library.

And then restart Arduino IDE. It’s important to take into account:

/////
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

filling system v1
Feeding a packaging machine with a frequency driver

In the dairy industry, packaging machines are used to package food in containers such as yogurt, milk, etc. They are usually integrated into more complex systems, and they are fed by a tank that contains the product (usually milk). In this project we will design a system composed of a tank with milk, a packaging machine, a valve to open and close the way to the machine, and a PID formed by a flow meter and a pump controlled by a frequency driver. In addition, the system has a buzzer to alert to operators of the plant in case of alarms. The system is as shown below:    

Read More Read More