loading

Programmable Logic Controllers,are for industrial use mostly.They are robost and expensive because the can be installed in areas with harsh weather conditions and are expected to last for longer periods of time.

Here we look at the use of a PLC in an industrial dye mixer.

Problem description

The problem is to implement an automation of a dye mixing machine.

Dye mixer operation starts by the press of a Start push-button and stops at anytime by Stop push-button press.During the operation green indicator Lamp should light permanently.

The dye from the three basic dye (Green, Red, Blue) tanks goes to the mixing tank through magnetic valves. PLC controls opening / closing of all magnetic valves. The machine has to mix a given color. The red dye is filling to mix tank for 2 s, the green one for 3 s, and the blue one for 4 s. Filling of the dye starts simultaneously with 2 s delay after the press of start push button.

If all necessary dyes are in the mixing tank, then after 3 s the mixing motor starts and mixes dye for 8 s. The motor is a 3-phase asynchronous motor that needs star-delta start up. Start-delta switching time is 3 s.

After mixing the drain magnetic valve is necessary to open immediately. If the tank becomes empty, the magnetic valve i needed to close and the mixing process has finished. The level-switch indicates if the tank is empty.

The dye mixing can be restarted by Start Push button repress.

The first to solving any electrical problem is to know the Number of I/O devices,function block and as well as their address.The program is attached and you can download and walk through and study it,you can run the simulation as well while looking at the description. This program was written using an easysoft coDesys or easy800

Both the easysoft and easy800 programs are attached here.I hope this can help people familiar with this programing environment.

For people who are not, the problem description is really catchy and can also be solved using arduino or raspberry or any other kind of microcontroller. Enjoy.

<p>Hello there, I apologize for the trouble and the timing, but I am curious to know what means did you use to program this project? Is<u> </u>easysoft coDesys a program that works in hand with the programmer easy800? or is it just a simulator. I was working with this code to be able to pull this project together for my final PLC but it is not working so I wondered if you program it with any type of arduino or raspberry. and lastly could you be so kind to send me any material you might have about this project please (julie.gomez001@mymdc.net)?</p><p>LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address</p><p>int keys[] ={ //Stores total keypad input</p><p> 1, 2, 3, 10, 4, 5, 6, 11, 7, 8, 9, 12, -3,0, -2, 14}; //&quot;123A456B789C*0#D&quot;;</p><p>int key; //Stores most recent key pressed</p><p>boolean key_lockout=false;</p><p>int order[4];</p><p>int value=0;</p><p>//Initialize</p><p>const int vodka=3; //Based on 6v clear pump, 13.3 sec/oz (20 sec/1.5 oz)</p><p>const int gin=4; //Based on 12v black pumps, 25.3 sec/oz (38 sec/1.5 oz)</p><p>const int whiskey=5;</p><p>const int tripleSec=6;</p><p>const int tequila=7;</p><p>const int rum=8;</p><p>const int water=9;</p><p>const int simpleSyrup=10;</p><p>void setup(){</p><p> Serial.begin(9600);</p><p> lcd.begin(16,2);</p><p> pinMode(vodka, OUTPUT);</p><p> pinMode(gin, OUTPUT);</p><p> pinMode(whiskey, OUTPUT);</p><p> pinMode(tripleSec, OUTPUT);</p><p> pinMode(tequila, OUTPUT);</p><p> pinMode(rum, OUTPUT);</p><p> pinMode(simpleSyrup, OUTPUT);</p><p> pinMode(water, OUTPUT);</p><p> digitalWrite(vodka, HIGH);</p><p> digitalWrite(gin, HIGH);</p><p> digitalWrite(whiskey, HIGH);</p><p> digitalWrite(tripleSec, HIGH);</p><p> digitalWrite(tequila, HIGH);</p><p> digitalWrite(rum, HIGH);</p><p> digitalWrite(simpleSyrup, HIGH);</p><p> digitalWrite(water, HIGH);</p><p> // ------- 3 blinks of backlight -------------</p><p> for(int i = 0; i&lt; 3; i++)</p><p> {</p><p> lcd.backlight();</p><p> delay(250);</p><p> lcd.noBacklight();</p><p> delay(250);</p><p> }</p><p> lcd.backlight(); // finish with backlight on </p><p>}</p><p>void loop(){</p><p>Beginning:</p><p> {</p><p> //-------- Write characters on the display ------------------</p><p> // NOTE: Cursor Position: (CHAR, LINE) start at 0 </p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Enter your order&quot;);</p><p> delay(500);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot; *-Clr, #-Enter&quot;);</p><p> delay(1000); </p><p> //-----------------------------------------------------------</p><p> value=0;</p><p> for (int x=0; x&lt;4; x++){</p><p> key=getKeypad(); //Get key pressed</p><p> if(key==-1){ //If valid key not pressed restart iteration</p><p> x=x-1;</p><p> }</p><p> else{</p><p> if(key!=14 &amp;&amp; key!=12){ //If not CLEAR or ENTER</p><p> value = (10*(value)) + (keys[key]);</p><p> delay(10);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Item #&quot;);</p><p> delay(10);</p><p> lcd.setCursor(6,0);</p><p> lcd.print(value);</p><p> delay(500);</p><p> }</p><p> else if(key==14){ //If ENTER, exit</p><p> x=4;</p><p> }</p><p> else if (key==12){ //If CLEAR, restart</p><p> x=-1;</p><p> }</p><p> }</p><p> }</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); </p><p> lcd.print(&quot; Press # to&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;Confirm drink&quot;);</p><p> delay(10);</p><p> lcd.setCursor(14,1);</p><p> lcd.print(value);</p><p> do{</p><p> key=getKeypad();</p><p> }</p><p> while(key!=12 &amp;&amp; key!=14);</p><p> if(key==12){ //Restart ordering process</p><p> goto Beginning; //Return to the beginning of loop()</p><p> }</p><p> else if(key==14){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot; Confirmed&quot;);</p><p> delay(1000);</p><p> switch (value) {</p><p> case 1: </p><p> longIslandIcedTea();</p><p> break;</p><p> case 2: </p><p> jackAndCoke();</p><p> break;</p><p> case 3: </p><p> rumAndCoke();</p><p> break;</p><p> case 4: </p><p> capeCod();</p><p> break;</p><p> case 5: </p><p> cosmopolitan();</p><p> break;</p><p> case 6: </p><p> kamikazee();</p><p> break;</p><p> case 7: </p><p> screwdriver;</p><p> break;</p><p> case 8: </p><p> highball();</p><p> break;</p><p> case 9: </p><p> gt();</p><p> break;</p><p> case 10: </p><p> vodkaTonic();</p><p> break;</p><p> case 11: </p><p> margarita();</p><p> break; </p><p> case 12:</p><p> seaBreeze(); </p><p> break; </p><p> } </p><p> delay(5); // delay in between reads for stability</p><p> }</p><p> }</p><p>}</p><p>//--------Functions-----------</p><p>int getKeypad(){ //Returns which key is pressed</p><p> int ret=-1;</p><p> boolean reset_lockout=false;</p><p> if(analogRead(A0)&lt;120)</p><p> key_lockout=false;</p><p> else if(!key_lockout){</p><p> delay(100);</p><p> ret=15.5-(log((analogRead(A0)-183.9)/58.24)/0.1623);//+0.5;</p><p> key_lockout=true;</p><p> }</p><p> return ret;</p><p>}</p><p>// Menu</p><p>//Long Island Iced Tea</p><p>int longIslandIcedTea(){</p><p> digitalWrite(vodka, LOW);</p><p> delay(80);</p><p> digitalWrite(gin, LOW);</p><p> delay(80);</p><p> digitalWrite(tripleSec, LOW);</p><p> delay(80);</p><p> //Serial.println(&quot;In the matrix&quot;);</p><p> digitalWrite(tequila, LOW);</p><p> delay(80);</p><p> digitalWrite(rum, LOW);</p><p> delay(80);</p><p> digitalWrite(water, LOW);</p><p> delay(6600);</p><p> digitalWrite(vodka, HIGH);</p><p> delay(6400);</p><p> digitalWrite(water, HIGH);</p><p> digitalWrite(gin, HIGH);</p><p> digitalWrite(tripleSec, HIGH);</p><p> digitalWrite(tequila, HIGH);</p><p> digitalWrite(rum, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add 1oz Sour Mix&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot; then MIX&quot;);</p><p> delay(5000);</p><p> lcd.clear();</p><p> lcd.print(&quot;Add ice and &quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;top with coke&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Jack and Coke</p><p>int jackAndCoke(){</p><p> //2 oz of whiskey</p><p> Serial.println(&quot;Jack and Coke&quot;);</p><p> digitalWrite(whiskey, LOW);</p><p> delay(10);</p><p> digitalWrite(water, LOW);</p><p> delay(4500);</p><p> digitalWrite(water, HIGH);</p><p> delay(33500);</p><p> digitalWrite(whiskey, HIGH);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add ice and 2-5&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;ounces of Coke&quot;);</p><p> delay(8000);</p><p>}</p><p>//Rum and Coke</p><p>int rumAndCoke(){</p><p> //2 oz of rum</p><p> Serial.println(&quot;Rum and Coke&quot;);</p><p> digitalWrite(rum, LOW);</p><p> delay(10);</p><p> digitalWrite(water, LOW);</p><p> delay(4500);</p><p> digitalWrite(water, HIGH);</p><p> delay(33500);</p><p> digitalWrite(rum, HIGH);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add ice and 2-5&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;ounces of Coke&quot;);</p><p> delay(8000);</p><p>}</p><p>//Cape Cod</p><p>int capeCod(){</p><p> //2 oz of vodka, 3 oz cranberry juice, lime wedge</p><p> Serial.println(&quot;Cape Cod&quot;);</p><p> digitalWrite(vodka, LOW);</p><p> delay(10);</p><p> digitalWrite(water, LOW);</p><p> delay(4500);</p><p> digitalWrite(water, HIGH);</p><p> delay(15500);</p><p> digitalWrite(vodka, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add ice &amp; 2-3 oz&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;Cranberry Juice-&quot;);</p><p> delay(3000);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;and a lime wedge&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Bay Breeze</p><p>int bayBreeze(){</p><p> //2 oz of vodka, 5 oz cranberry juice, 2 oz pineapple juice (or equal parts ~2.5 oz each), lime wedge</p><p> Serial.println(&quot;Bay Breeze&quot;);</p><p> digitalWrite(vodka, LOW);</p><p> delay(10);</p><p> digitalWrite(water, LOW);</p><p> delay(4500);</p><p> digitalWrite(water, HIGH);</p><p> delay(15500);</p><p> digitalWrite(vodka, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add ice &amp; 4-5 oz&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;Cranberry Juice&quot;);</p><p> delay(4000);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;and 2oz of&quot;);</p><p> lcd.setCursor(0,1); </p><p> lcd.print(&quot;Pineapple Juice&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Cosmopolitan </p><p>int cosmopolitan(){</p><p> //1 1/2 ounces vodka or citrus vodka, 1 ounce Cointreau orange liqueur, 1/2 ounce fresh lime juice, 1/4 ounce cranberry juice</p><p> Serial.println(&quot;Cosmopolitan&quot;);</p><p> digitalWrite(tripleSec, LOW);</p><p> delay(10);</p><p> digitalWrite(vodka, LOW);</p><p> delay(10);</p><p> digitalWrite(water, LOW);</p><p> delay(13000);</p><p> digitalWrite(water, HIGH);</p><p> delay(7000);</p><p> digitalWrite(vodka, HIGH);</p><p> delay(5323);</p><p> digitalWrite(tripleSec, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add 1/2 oz lime&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot; Juice and MIX&quot;);</p><p> delay(4000);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot; Top with&quot;);</p><p> lcd.setCursor(0,1); </p><p> lcd.print(&quot;Cranberry Juice&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Kamikazee</p><p>int kamikazee(){</p><p> //1 1/2 -1 ounces vodka, 1 ounce lime juice, 1 ounce triple sec, Lime wedge for garnish</p><p> //shake</p><p> Serial.println(&quot;Kamikazee&quot;);</p><p> digitalWrite(tripleSec, LOW);</p><p> delay(10);</p><p> digitalWrite(vodka, LOW);</p><p> delay(10);</p><p> digitalWrite(water, LOW);</p><p> delay(13000);</p><p> digitalWrite(water, HIGH);</p><p> delay(7000);</p><p> digitalWrite(vodka, HIGH);</p><p> delay(5323);</p><p> digitalWrite(tripleSec, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add 1 oz Lime&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot; Juice and MIX&quot;);</p><p> delay(4000);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot; Add Ice&quot;);</p><p> lcd.setCursor(0,1); </p><p> lcd.print(&quot;and lime wedge&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Screwdriver</p><p>int screwdriver(){</p><p> //1 1/2 -1 ounces vodka, 5 oz orange juice</p><p> Serial.println(&quot;Screwdriver&quot;);</p><p> digitalWrite(vodka, LOW);</p><p> delay(20000);</p><p> digitalWrite(vodka, HIGH);</p><p> for (int x=0; x&lt;2; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add Ice and ~5&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;oz Orange Juice&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Highball</p><p>int highball(){</p><p> //1.5 ounces whiskey, ginger ale</p><p> Serial.println(&quot;Highball&quot;);</p><p> digitalWrite(whiskey, LOW);</p><p> delay(38000);</p><p> digitalWrite(whiskey, HIGH);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot; Add Ice and&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot; Ginger Ale&quot;);</p><p> delay(8000);</p><p>}</p><p>//Gin and Tonic</p><p>int gt(){</p><p> //1.5 ounces gin, 2.25 tonic or 2:3, 1/4 oz lime juice</p><p> Serial.println(&quot;Gin and Tonic&quot;);</p><p> digitalWrite(gin, LOW);</p><p> delay(38000);</p><p> digitalWrite(gin, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add Ice, 2-5 oz&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;of Tonic and...&quot;);</p><p> delay(3000);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot; 1/4 oz&quot;);</p><p> lcd.setCursor(0,1); </p><p> lcd.print(&quot; Lime Juice&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Vodka Tonic</p><p>int vodkaTonic(){</p><p> //1.5 ounces vodka, 3-4.5 tonic, 1/4 oz lime juice</p><p> Serial.println(&quot;Vodka Tonic&quot;);</p><p> digitalWrite(vodka, LOW);</p><p> delay(20000);</p><p> digitalWrite(vodka, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add Ice, 2-5 oz&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;of Tonic and...&quot;);</p><p> delay(3000);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot; 1/4 oz&quot;);</p><p> lcd.setCursor(0,1); </p><p> lcd.print(&quot; Lime Juice&quot;);</p><p> delay(3000);</p><p> }</p><p>}</p><p>//Margarita</p><p>int margarita(){</p><p> digitalWrite(tripleSec, LOW);</p><p> delay(10);</p><p> digitalWrite(tequila, LOW);</p><p> delay(10);</p><p> digitalWrite(water, LOW);</p><p> delay(13000);</p><p> digitalWrite(water, HIGH);</p><p> delay(12700);</p><p> digitalWrite(tripleSec, HIGH);</p><p> delay(12870);</p><p> digitalWrite(tequila, HIGH);</p><p> for (int x=0; x&lt;3; x++){</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot;Add 1/2 oz of&quot;);</p><p> delay(10);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(&quot;Lime Juice &amp;...&quot;);</p><p> delay(3000);</p><p> lcd.clear();</p><p> lcd.setCursor(0,0); //Start at character 4 on line 0</p><p> lcd.print(&quot; MIX&quot;);</p><p> lcd.setCursor(0,1); </p><p> lcd.print(&quot; then add ice &quot;);</p><p> delay(4000);</p><p> }</p><p>}</p><p>//Sea Breeze</p><p>int seaBreeze(){</p><p> //1.35 Vodka, 4 Cranberry juice, 1 Grapefruit juice</p><p> Serial.println(&quot;Sea Breeze&quot;);</p><p> digitalWrite(vodka, LOW);</p><p> delay(18000);</p><p> digitalWrite(vodka, HIGH);</p><p>}</p>
<p>Hi</p><p>I need to do this PLC mixer with arduino for a presentation, any help please</p>
<p>Hey thanks for the upload! but it seems that the software don't recognize some of the files. Might be my software... but anyways thanks for the upload. </p>
<p>Surprising! it should work with <strong>Xsoft.</strong> Please can you check your <strong>PLC configuration </strong>at the <strong>target settings.</strong>? from the Library manger also check the <strong>POU's</strong> and be sure all the necessary <strong>function blocks</strong> are included for the<strong> &quot;standard.lib&quot;</strong>. for the &quot;<strong>FUNCTION SysCallbackRegister : BOOL register&quot;</strong>. if it is not there add it by right clicking and choosing add Library and then search the name after adding a library remember to rebuild all. and see if you have the same problems. please let me know if this solves your problem not. :)</p>

About This Instructable

1,196views

8favorites

License:

Bio: bachelors degree in Electrical Engineering, love developing hardware systems on both microcontrollers and PLC.
More by rmikel:Ardunio Smoke And Gas Sensor(MQ-2) Arduino servo control using Ultrasonic sensor Arduino I2C 
Add instructable to: