Arduino as an embedded industrial controller

2,406 views
2,195 views

Published on

Published in: Engineering, Technology, Business

Arduino as an embedded industrial controller

  1. 1. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Jose-Luis Poza-Luján Arduino as embedded industrial controller An introduction to the Arduino as control system
  2. 2. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project The teacher • Ph D. Jose-Luis Poza-Luján – Professor • University: Technical University of Valencia- Spain (www.upv.es) • Research: University Institute of Control Systems and Industrial Computing (www.ai2.upv.es) • Reaching: School of Informatics (www.inf.upv.es) • Management: Dept. of Computer Engineering (www.disca.upv.es) – Contact • Web: http://jopolu.webs.upv.es • Mail: jopolu@disca.upv.es • Facebook, Twitter, LinkedIn, Google+ jopolu 2
  3. 3. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Aims • How Arduino can work as platform to develop simple control systems – What’s a Control System? – What’s Arduino? • What I can do with an Arduino? – Sensors? – Actuators? – Software? • Where I can find documents? 3
  4. 4. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Aims • Experiences with Arduino? • What do you think can be done with Arduino? 4
  5. 5. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Open hardware • Open hardware – Inspired on the free software? not, open software – It’s not a new concept, first open hardware: early 70s (XX century) • Definitions – Hardware device whose specifications and schematics can be accessed publically (free or not free charges) • Open Hardware Specification Program – Limited form of free hardware. – Enough information that allows a programmer to make a driver. 5
  6. 6. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Project based on open hardware – OpenSPARC (http://www.opensparc.net/) • Sun Microsystems (Oracle) • Complete 64 bits processor – Openmoko (http://wiki.openmoko.org/wiki/Main_Page) • Open Mobile Phones (Free Hw and SW) – Raspberry Pi (http://www.raspberrypi.org/) • Complete embedded PC – RepRap (http://reprap.org/wiki/RepRap) • Free Hw and SW 3D printer – Arduino (http://www.arduino.cc/es/) • Free Microcontroller: analog/digital input/output oriented. 6
  7. 7. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino background • Origin of Name – Its name comes from "Bar di Re Arduino" where Massimo Banzi spent a few hours (is the name of an ancient European king (year 1002) • History – IEEE: The Making of Arduino – Arduino: The documentary (2010) (http://vimeo.com/18539129) 7
  8. 8. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Fundamentals of Arduino project • Collaborative work(credits) – David Cuartielles – Gianluca Martino – Tom Igoe – David Mellis – Massimo Banzi • Motivations – In 2005, a group of students, and professors of the Institute of Interactive Design of (Ivrea) in Italy started to develop a Hardware platform because commercial platforms are expensive and closed systems. – Made entirely in Italy – Target: price < 30 € – Philosophy: DIY (Do It Yourself)8
  9. 9. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino: Present and future • Evolution – Web • Source: Arduino – Software • Sorce: Gource 9
  10. 10. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Where Arduino is placed in Industrial Systems? 10 Field bus Redes de planta LAN & WAN Production Network Fourth floor: Business Third floor: Management (Warehouses) Second floor: Field level (PC) First floor: Control level (PLC/CNC) Ground: devices (Sensors and actuators)
  11. 11. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Where Arduino is placed in REAL Industrial Systems? • Bus integration Source: Siemens 201311
  12. 12. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Where to place Arduino? 12 Arduino Intel Galileo Raspberry PI PLC Reliability (and price) Computing
  13. 13. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Where to place Arduino? 13 • Do you know any of the above systems (PLC, Arduino, Intel Galileo, Raspberry PI)?
  14. 14. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Overview 14 The programming environment allows you to write, compile and load the code that controls the system. The Arduino runs the code through a control loop (infinite loop), without using the programming environment for normal operation From your home to the factory
  15. 15. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Hardware • No hardware…. No software – So that… It is important to know the hardware on which the software will run. 15 Arduino ADK R3 10.16 cm 5.3cm 6.8 cm 5.3cm Arduino Uno Arduino Mega 1.8 cm 4.3cm Arduino Diecimila Arduino Duemilanove 5.0cm Arduino LilyPad Arduino Nano Arduino Leonardo Arduino Ethernet http://arduino.cc/en/Main/Boards
  16. 16. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Models & characteristics Model Processor Speed Power (V) Memory I/O (A) ADK ATMEGA2560 16 MHz 7-12 (5) 256 KB 54 (16) BT ATMEGA328 16 MHz 1.2-5.5 (5) 32 KB 14 (6) Diecimila ATMEGA168 16 MHz 7-12 (5) 16 KB 14 (6) Duemilanove ATMEGA168 16 MHz 7-12 (5) 16/32 KB 14 (6) Ethernet ATMEGA328 16 MHz 7-12 (5) 32 KB 14 (6) Fio ATMEGA328p 8 MHz 3.3-12 (3.3) 32 KB 14 (8) Leonardo ATMEGA32U4 16 MHz 7-12 (5) 32 KB 20 (12) LilyPad ATmega268V 8 MHz 2.7-5.5 16 KB 14 (6) Mega ATMEGA1280 16 MHz 7-12 (5) 128 KB 54 (16) Mega2560 ATMEGA2560 16 MHz 7-12 (5) 256 KB 54 (16) Mini ATMEGA168 16 MHz 7-9 (5) 32 KB 14 (8) Nano ATMEGA328 16 MHz 7-12 (5) 16 KB 14 (8) Uno ATMEGA328p 16 MHz 7-12 (5) 32 KB 14 (6)16
  17. 17. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Programming environments • Arduino IDE – Depending on the Operative System, needs a driver installation (Guide) – Based on Processing language • Part of the project “Design by numbers”, from the MIT, to bring computer science to “no programmers”. • Processing is similar al C, but it is possible to program Arduino in other languages • Aimed at users who do not need to know high level languages • Oriented to programmers unfamiliar with the hardware. • Conditions GNU LGPL 17
  18. 18. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Programming environments • Arduino IDE • Google Code 18
  19. 19. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Programming environments • It is possible to program Arduino by means other estándar platforms – Eclipse • PlayGround (alternativas) – VisualMicro • Microsoft environment – Atmel Studio • Classic microprocessors programing environment – Minibloc, Compilador online • More environments on Arduino site 19
  20. 20. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino simulators • SFA – Simulator for Arduino – Windows • VBBExpress – Virtual Bread Board – Windows • Simuino – Linux (Written on C) • Arduino Simulator – IOS • Ardusim – Working project • Fritzing – Arduino Design environment20 Simulator for Arduino Virtual Bread Broad
  21. 21. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Mobile device software 21 Eight Control Arduino Ardumote Arduino Commander Domotic Home with Arduino Arduino Reference Arduino Uno Communicator Arduino meets Android Arduino GR Arduino Control Free Arduino simulator Hotkeys for Arduino And more…
  22. 22. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project References – Arduino Programming Notebook. • Brian Evans. 2011. (www.lulu.com) 22 arduino "creative commons" filetype:pdf arduino "cheat sheet" filetype:pdf
  23. 23. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project References – Arduino Cookbook • Michael Margolis. • 2012 – Getting Started with Arduino • Massimo Banzi. 2011 – Make: Arduino Bots and Gadgets • Tero Karvinen, Kimmo Karvinen • 2011 – Environmental Monitoring with Arduino • Emily Gertz , Patrick Di Justo. 2012 23
  24. 24. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project References • Arduino Playground http://arduino.cc/playground/Main/HomePage http://arduino.cc/en/Tutorial/HomePage http://arduino.cc/playground/Es/Guias/ • Web sites http://www.arduinobooks.com/ http://www.arduinodev.com/ And more… http://en.wikipedia.org/wiki/Arduino http://tronixstuff.wordpress.com/tutorials/ 24
  25. 25. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project References • Distributors list – http://arduino.cc/es/Main/Buy • Arduino oriented distributors – Seedstudio • http://www.seeedstudio.com – RS • http://nl.rs-online.com/web/ 25
  26. 26. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project • Photoduino. http://photoduino.com/ – Photoduino is anOpen camera Controller based on Arduino. Used for taking pictures Automatically. • PolarPlotter. http://roxen.github.io/polar-plotter/ – Plotter based on a single arm robot. With greater performance area that traditional plotters. • ArduPilot. http://ardupilot.com/ – Arduino based drone. Arduino based projects 26 http://makezine.com/http://www.instructables.com/ http://hacknmod.com/
  27. 27. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino based projects 27
  28. 28. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino based projects 28 • You think it's possible for you to learn to do things with Arduino?
  29. 29. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino uno: connections • Pin mapping 29
  30. 30. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino uno: communications • Programming and communications pin 30
  31. 31. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Pin functionality 31 Pin (Link ) Functionality [0,13] Digital Input/Output 0, 1 RX, TX. Serial TTL (ATmega8U2 USB-to-TTL chip) 2, 3 Extern interruptions (high or low level, and signalled rising or falling) 3,5,6,9,10,11 Analogic outputs PWM (pulse-width modulation). 10,11,12,13 Communications SPI (Serial Peripheral Interface) GND Ground AREF Analogic reference [A0,A5] Analogical inputs 10 bits = from 0 to 1023 A4,A5 Communications TWI/I2C (Two Wire Interface) Vin Extern power(combined with GND) 5V 5 V output (combined with GND) 3V3 3.3V, 50mA output (combined with GND) RESET Restart the board ICSP In Chip/Circuit Serial Programmer (to direct access to ATMega)
  32. 32. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Power supply • USB – 5V • Extern – Range • Work: 7-12V • Limits: 6-20V – Connectors • 2.1mm (+ centro)s • Pins Vin, GND • The selection of the power supply is automatically 32
  33. 33. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Connecting components • Breadboard • Buses – Carried on the same cable the sensor / actuator signal and the power supply 33
  34. 34. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Danger • Some ways to destroy an Arduino – #1 Short circuit a I/O pin with GND – #2 Short circuit two I/O pins – #3 Apply overvoltage on I/O pins – #4 Interchange polarity between Vin y GND – #5 Short circuit Vin y GND – #6 Apply voltage to output voltage pins (5V y 3V3) – #7 Apply more than 12 V to reset pin de reset – #8 Over charge the Arduino (connect to Arduino a great amount of components without additional power supply) 34 http://ruggedcircuits.com/html/ancp01.html
  35. 35. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Caution • Hardware – Assemble the circuits with the Arduino offline – Review connections before connect the Arduino – No force conectors – In case of failure: Test every component individually – Do not desperate: it is difficult for a run at the first assembly • Software – Save code frequently – Comment the code – One change… one test 35
  36. 36. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Programing • Arduino programs are known as “sketches • References – http://arduino.cc/es/Reference/HomePage – http://arduino.cc/es/Reference/Extended 36
  37. 37. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Expectations • Is Arduino a Powerful device? 37
  38. 38. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Digital output • Examples Basics  Blink 38 int pinLed = 13; void setup() { pinMode(pinLed, OUTPUT); } void loop() { digitalWrite(pinLed,HIGH); delay(1000); digitalWrite(pinLed,LOW); delay(1000); }
  39. 39. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Digital output & Digital input • Examples Basics  Blink • Examples  Basics  DigitalReadSerial 39 Pin 13 220R Led GND Pin 13 220R Led GND Pin 6 10KR GND 5V switch
  40. 40. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Digital input-output • Simple control loop 40 int pinSwitch = 6; int pinLed = 13; void setup() { pinMode(pinSwitch, INPUT); pinMode(pinLed, OUTPUT); } void loop() { digitalWrite(pinLed,LOW); if(digitalRead(pinSwitch)==HIGH){ digitalWrite(pinLed,HIGH); } } Pin 13 220R Led GND Pin 6 10KR GND 5V switch
  41. 41. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Analogical output & Analogical input • Examples Basics  Fade • Examples Basics  AnalogReadSerial 41 Pin 9 220R Led GND (PWM mode) A0 10KR Pin 13 220R Led GND 5V GND
  42. 42. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Analogical input-output • Examples Basics  Fade • Examples Basics  AnalogReadSerial 42 Pin 9 220R Led GND (PWM mode) A0 10KR Pin 13 220R Led GND 5V GND
  43. 43. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Analogical sensor • LDR (Light Dependent Resistor) 43 5V 10KR LDR A0 GND int sensorPin = 0; int value = 0; void setup(){ Serial.begin(9600); } void loop(){ value = analogRead(sensorPin); Serial.println(value); delay(100); }
  44. 44. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Analogical actuator • Speaker • Controller speaker 44 Pin 8 100R Speaker 8R GND void setup() { } void loop() { tone(8, 1000, 100); delay(1000); noTone(8); delay(1000); } Pin 8 100R Altavoz 8R GND A0 10KR 5V GND
  45. 45. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Analogical actuator • Mapping data 45 void setup() { Serial.begin(9600); } void loop() { int sensorReading = analogRead(A0); int thisPitch = map(sensorReading, 0, 1023, 120, 1500); tone(8, thisPitch, 10); Serial.print(sensorReading); Serial.print(":"); Serial.println(thisPitch); delay(1); }
  46. 46. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Conclusions • Arduino is born of the need to provide a platform for the control that is open and accessible • Free Hardware philosophy has made Arduino extends at high speed • There are a wide variety of models, consequently there is a wide variety of applications • There are also a wide variety of programming environments and simulation • In addition, more documentation can be founded.46
  47. 47. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino projects • Youtube test: search “Arduino”+… – Led cube – Quadcopter – 3d printer – Robot – Rocket – Telescope – … – Your interest 47
  48. 48. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino projects • Test the examples that Arduino IDE offers (asks the teacher the necessary components) • Propose a circuit – A semaphore? – A “Mini” Piano? – Ask the teacher… 48
  49. 49. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Design your own project 49
  50. 50. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Design your own project • Arduino oriented sensors and actuators 50 http://www.cooking-hacks.com/
  51. 51. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino in real world? • Arduino as PLC 51 www.controllino.cc www.winkhel.com www.industrialshields.com/plc- arduino-ardbox-20ios-rele
  52. 52. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Arduino in real world? • Looking for a job – Arduino vs PLC 52
  53. 53. Arduino as an embedded industrial controller Jose-Luis Poza -Luján Introduction Overview Hardware Software References Connections Programming Conclusions Project Jose-Luis Poza-Luján Thanks For your attention and for your patient

×