Está en la página 1de 65

Curso: Tecnología Eléctrica

Prof. O. Ellis / e-mail: ronoscar@yahoo.com

Tema: Arduino ( Resumen )

10%

90%

TRIAC
TRIAC – 2N6071A, 200V. 4A

The Tip of the Iceberg

1 of XX
Para el JG + S_JG – Recordar: En los Informes usar ilustraciones tipo resumen - rotadas
Curso: Tecnología Eléctrica
Prof. O. Ellis / e-mail: ronoscar@yahoo.com

Tema: Arduino ( Proyecto #1b & #3a,b )

INDEX
1. Proyecto Arduino Uno R3, 3
2. Proyecto Arduino Uno R3 ( Basic Test ), 8
3. Proyecto Arduino ( Bare Bone ), 18
4. Proyecto ARDUINO ( “Bootloader” ) , 28
5. Proyecto ARDUINO ( “Information“ ), 30
6. Referencias, 32
_. More Information, 34

Para el JG + S_JG – Recordar: En los Informes crear buenas ilustraciones… antes de escribir

2 of XX
1. Proyecto ARDUINO Uno R3
( #2, 3 ) Hardware & Software ( Open Project )

UART ( Serial Data Interface )

2KB RAM
32KB FLASH
( Working
( Sketches )
Memory )

1KB
Arduino UNO R3 Features
EEPROM CPU
- ATmega328 microcontroller, VCC= 5 V ( nonvolatile
- Input voltage - 7-12V storage )

- 14 Digital I/O Pins: 40ma, 6 PWM outputs


Input / Output Ports
- 6 Analog Inputs
- 32k Flash Memory (2K for Bootloader )
ATMEL - ATmega328 Block Diagram
- 16Mhz Clock Speed

Tarjeta ARDUINO UNO R3 basada en el microcontrolador ( MCU ) de ATMEL ATmega328


3 of XX
1. Proyecto ARDUINO Uno R3
( #2, 3 ) Hardware & Software ( Open Project )

4 of XX
1. Proyecto ARDUINO Uno R3
( #1b,3 ) Hardware & Software: Lenguaje “C”

Structure of an Arduino Program ( “Sketch” )

An Arduino Sketch ( ie. Blink )


must have:
setup ( )
loop ( )

setup ( )
Configures Pin
modes and Registers

loop ( )
runs the main body of
the program forever

Arduino C Programming ( Sketch ) - Examples + Basics + Blink


5 of XX
1. Proyecto ARDUINO Uno R3
( #1b,3 ) Hardware & Software: “MCU” Aspectos Básicos

What is a Microcontroller or MCU …?

ANALOG
INPUTS

MCU - Input & Output ( I/O)


Microcontroller or MCU
6 of XX
What is the difference between a ‘Digital Input’ and an ‘Analog Input’?
1. Proyecto ARDUINO Uno R3
( #1b,3 ) Hardware & Software ( IC “MCU” )

Pin name Pin number

Special function

ATMEL - ATmega328 Microcontroller 7 of XX


1. Proyecto ARDUINO Uno R3
( #1b,3 ) Hardware & Software ( IC “MCU” )

8 of XX
1. Proyecto ARDUINO Uno R3
( #1b,3 ) Hardware & Software ( IC “MCU” )

ATMEL - ATmega328 Microcontroller

ATmega328 data sheet p. 316


9 of XX
Resistor Color Code
2. Proyecto ARDUINO Uno R3 ( “Basic Test“ )
( #1a, 3 ) Hardware & Software ( Magnetic Effects – Application )

Aspectos básicos del funcionamiento de un relevador.


( a ) Electroimán - Desenegizado;
( b ) Electroimán - Energizado

( SPDT )

COIL TERMINALS NC C NO COIL TERMINALS NC C NO

(a) (b)
Nota: En la practica de Laboratorio #4: Verificar las terminales del Relevador
( Coil, NO, C & NC ), con el DMM ( Multímetro Digital ) en la escala de OHM.
11 of XX
¿Cual es la resistencia de la bobina o coil…?
2. Proyecto ARDUINO Uno R3 ( “Basic Test“ )
( #1b,3 ) Hardware & Software ( Servomotor )

Arduino Wiring: I/O 9, VCC & GND

Servomotor HS 311 Conexión Externa del Servomotor

Partes de un Servomotor 0.5ms 1.5ms 2.5ms


Subject: Servomotor ( Basics ) – See“Slide Notes” Ejemplos de Posicionamiento deof
12 unXX
Servo
Stepper motor DATA
2. Proyecto ARDUINO Uno R3 ( “Basic Test“ ) Gear Factor 1:68
( #1b,3 ) Hardware & Software ( Stepper motor ) Step Angle: 5.625 / 64°
Stepper motor ( 28BYJ48 ) Steps per Revolution: 512
Driver board with ULN2003 ( Darlington drivers ) & 4 LEDs
File ( Sketch ) name: StepMotor_Test00a

Arduino Connection

Stepper motor & Drive Board


Driving Motor + Switching Sequence

For clockwise movement

Wiring Diagram

Reference: (1) Arduino DATA - http://www.4tronix.co.uk/arduino/Stepper-Motors.php


(2) Definition - http://en.wikipedia.org/wiki/Stepper_motor 13 of XX
2. Proyecto ARDUINO Uno R3 ( “Basic Test“ )
( #3 ) Hardware & Software ( Bomba de Agua + Compra Local )

14 of XX
2. Proyecto ARDUINO Uno R3 ( “Basic Test“ )
( #3 ) Hardware & Software ( Hall Effect Sensor Test )

Hall Effect Sensor – A1302 KUT by Jameco

PN – 2135881 ( $1.95 )
http://www.learningaboutelectronics.com/Articles/Hall-effect-sensor-circuit.php

15 of XX
2. Proyecto ARDUINO Uno R3 ( “Basic Test“ )
( #1b,3 ) Hardware & Software ( LED RGB Test )

Arduino + LED RGB

LED RGB

Programa: Paint + Paleta de Colores 16 of XX


2. Proyecto ARDUINO Uno R3 ( “Basic Test“ )
( #3 ) Hardware & Software ( Example )

Arduino`s - Master / Slave Architecture …!


Serial Bus A4/A4 – A5/A5 – GND/GND
(27) (28)

ID:01 ID:02 ID:03

One Master, Multiple Slaves

17 of XX
Subject: Master-Slave ( Basics ) – See“Slide Notes”
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( Breadboard Test )

Arduino Bare Bone System ( On Breadboard ) 18 of XX


3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( Breadboard Test )
Nota: No usar los 5 VDC del USB + Usar los 5 VDC del Regulador de Voltaje LM7805

TP3 PIN29 TP2


U2 U1 +5
78L12 +12V +12V 78L05
IN OUT IN OUT
C6 D2
+ COM COM ROJO

+
0.1uF C4 C5
CN1 PCB TP1
22uF 0.1uF R3
- GND
3.3K

J2
6 RESET J1
5 Rx 4 Rx
3 Tx
4 Tx 2 RESET
3 +5
2 1
+5 R2
1 PCB
+
2 1

GND C3 10k
PLANTILLA 1uF RESET 1
Tx PC6PC528
GND 2PD0PC427
Rx 3
4PD1 PC326
SW 5PD2 PC225
PD3 PC124
6PD4 PC023
+5 78VCC GND22
9GND AREF21
C1 PB6 AVC
10PB7 PB5C20
19
+5
22p 11PD5 PB418 C7
12PD6 PB317
13PD7 PB216 D1 22p
14PB0 PB115 VERDE
XTAL1
16 MHZ ATmega328 R1
C2 3.3K
22p
USB to TTL FT232

Adaptador de 12 VDC / 1 Amp

P/N - 2152340
Circuito Básico del MCU – Esquemático “Arduino - Bare Bone”19 of XX
Tarea #__: Para la próxima Sesión de Laboratorio – Armar + Evaluar el “Arduino Bare Bone” + “Blink”
FT232 to ATmega328
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( Breadboard Test )

TP3 PIN29 TP2


U2 U1 +5
78L12 +12V +12V 78L05
IN OUT IN OUT
C6 D2
+ COM COM ROJO

+
0.1uF C4 C5
CN1 PCB TP1 0.1uF
22uF R3
- GND
3.3K

J2
6 GND
5
4 +5
3 Tx +5
2 Rx
1 DTR
R2
C3 10k
1uF
FT232RL +1 2 RESET 1
Rx PC6 PC5 28
2 PD0 PC4 27
Tx 3 PD1
4 PD2 PC3 26
5 PD3 PC2 25
PC1 24
6 PD4 PC0 23
SW +5 7 VCC GND 22
8 GND AREF 21
9 PB6 AVCC 20 +5
C1 10 PB7
22p 11 PD5 PB5 19
PB4 18 C7
12 PD6 PB3 17 22p
13 PD7 D1
14 PB0 PB2 16 VERDE
PB1 15
XTAL1
16 MHZ ATmega328 R1
C2 3.3K
22p
USB to TTL FT232

Adaptador de 12 VDC / 1 Amp

Circuito Básico del MCU – Esquemático “Arduino - Bare Bone”20 of XX


Tarea #__: Para la próxima Sesión de Laboratorio – Armar + Evaluar el “Arduino Bare Bone” + “Blink”
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( Breadboard Test )
LM7805

Circuito Básico del MCU – “Arduino - Bare Bone”

Nota: Usa los 5 VDC del USB o los 5 VDC del Regulador de Voltaje LM7805

21 of XX
Tarea #__: Para la próxima Sesión de Laboratorio – Armar + Evaluar el “Arduino Bare Bone” + “Blink”
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( PCB + Compra en USA )

Arduino Bare Bone System ( PCB Part List ± ) 22 of XX


4. Proyecto ARDUINO ( “Bootloader” )
( #3b ) Hardware & Software ( “Bootloader Programming” )
Tarjeta – Arduino Uno R3

Bootloader Programming ( Ver lamina #29 )


Procedimiento:
1. Programar la Tarjeta:
Archivo (Sketch): Archivos + Ejemplos + Arduino ISP

2. Desconectar la energía Armar e interconectar los Circuitos


Tarjeta: 10, 11, 12, 13 .vs. MCU: 1, 17, 18, 19 + GND, VCC

3. Conectar la Tarjeta + En el menu del IDE:


Seleccionar: Herramientas + Programador + Arduino as ISP
Luego: Herramientas + Grabar secuencia de inicio

4. Al finalizar el proceso ( Duración ±30 Segundos )


En el menú del IDE:
Seleccionar: Herramientas + Programador + AVR ISP
#2 – New MCU
5. Verificar el Bootloader programando el MCU #2:
Archivo (Sketch): Archivos + Ejemplos + 01. Basics + Blink

New ATMEL - ATmega328 Bootloader Programming ( On Breadboard


23 of XX)
4. Proyecto ARDUINO ( “Bootloader” )
( #3b ) Hardware & Software ( “Bootloader Programming” )

New ATMEL - ATmega328 Bootloader Programming ( On Breadboard )


3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( Breadboard Test )
Relay
V1

+12V

+5V
Transistor DC Motor
1N4004 LED
MOTOR
12VDC Cat #112 – Pag. 88 - P/N 2081414
ATmega328 RELAY,DIP,5VDC,DPDT,8PIN
5V 3.3k
1 28 128ohms,125VAC/28VDC,1A/2A
2 27
3 26 3.3k
NPN
4 25 PN2222
5 24
6 23
7 22 1N4004
8 21 RELAY TRIAC
9 20 5V - SPDT
10 19
11 18
12 17 TRIAC – 2N6071A, 200V. 4A
13 16 MOC3010 ( 1= MTI, 2 = MT2, 3 = G )
14 U1 15 3.3k
NPN
ARDUINO UNO R3 PN2222 ( TRIAC OptoIsolator )

Diodo
MOC3010
1 6 G MT1
TRIAC
2 4 2N6071A AC PLUG
MT2 120VAC

470 180
120V
LAMP
Neon Lamp / R=47k
( P/N 2129553 )

Circuito Básico de Control - Motor DC + Relay + Lampara w/ MCU ( ie. Arduino


25 of XX )
Tarea #__: En la próxima Sesión de Laboratorio – Armar + Evaluar con el Arduino
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( PCB )

26 of XX
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( Placa de Cobre: Compra Local )

Placa de Cobre con Fibra de Vidrio


Almacén: Musix Works
Ubicación: Frente al CC El Dorado
Al lado de “ddp”
cerca de “Sol de la India”
Circuito Básico del MCU – PCB “Arduino - Bare Bone” 27 of XX
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware ( PCB ) … Header Installation ( Ref. NT0005 Montaje – Soldadura )

28 of XX
3. Proyecto ARDUINO ( “Bare Bone” )
( #3b ) Hardware & Software ( PCB )

Size:1730 x 2935 mils

Silkscreen Top & Bottom Copper Bottom Copper + E.P.

Circuito Básico del MCU – PCB “Arduino - Bare Bone” 29 of XX


5. Proyecto ARDUINO ( “Information“ )
( #1b,3 ) Hardware & Software ( Reference DATA )

Arduino UNO R3

Sitio WEB: http://panamahitek.com/

Autor: Antony García González <antony.garcia.gonzalez@gmail.com>;


Estudiante de III año de Lic. en Ing. Electromecánica FIE – UTP CR de Azuero
6. Referencias
ARDUINO …

1. Tarjeta ARDUINO UNO R3 (US±$20):. Available at: < http://www.amazon.com >. Accessed: August 06,
2012
2. Software Download: “ARDUINO IDE” Ver. 1.0.5. Available at: < http://arduino.cc/en/Main/Software>.
Accessed: August 06, 2012
3. Articulo de la IEEE – El origen del proyecto ARDUINO ( Ingles ): Available at:
< http://spectrum.ieee.org/geek-life/hands-on/the-making-of-arduino/0 >. Accessed: August 06,
2012
:
4. Video - Massimo Banzi - How Arduino is open-sourcing imagination ( Ingles ): Available at:
< http://www.ted.com/talks/massimo_banzi_how_arduino_is_open_sourcing_imagination.html >.
Accessed: August 06, 2012
5. Book - “Programming Arduino Getting Started with Sketches” (US±$10): Available at:
< http://www.amazon.com >. Accessed: August 06, 2012

6. Para comprar el MCU “ATmega328” ( Sin el Bootloader ) - (US±$3): Available at:


< http://www.digikey.com/product-detail/en/ATMEGA328P-PU/ATMEGA328P-PU-ND/1914589 >
Accessed: August 06, 2012

7. For evaluation & testing: Arduino Bare Bone System ( On Breadboard ): Available at:
< http://www.instructables.com/id/Build-your-own-Arduino-Bare-Bone-System/ >
Accessed: August 06, 2012

Para el JG + S_JG – Recordar: En los Informes crear buenas ilustraciones … antes 31


de of XX
escribir
6. Referencias ( Continuación … )
12. Arduino ( Video ) - Massimo Banzi - How Arduino is open-sourcing imagination:
http://www.ted.com/talks/massimo_banzi_how_arduino_is_open_sourcing_imagination.html
Accessed: March 10, 2012

13. Arduino ( Articulo de la IEEE ) El origen del proyecto ARDUINO; A la fecha, han vendido – a nivel
mundial, mas de 300,000 unidades del producto:
http://spectrum.ieee.org/geek-life/hands-on/the-making-of-arduino/0
( … “Arduino is a low-cost microcontroller board that lets even a novice do really amazing things” … )
Consultado: Septiembre 06, 2012.
14. Arduino ( Sitio WEB ) – (1) Descargar la versión mas reciente del IDE que se usa para programar
el Dispositivo: Ver: http://arduino.cc/en/Main/Software - (2) C Basics – Ver:
http://arduino.cc/en/Reference/HomePage - (3) C Functions – Ver:
http://arduino.cc/en/Reference/FunctionDeclaration - (4) C Libraries - Ver:
http://arduino.cc/en/Hacking/LibraryTutorial - Consultado: March 21, 2013.

15. Arduino ( Amazon ) Para comprar el Arduino en Amazon: La tarjeta de desarrollo Arduino Uno R3
( No incluye el cable USB ) + Fuente de 9 VDC + Cajita para experimentos – Costo: más o menos
US$60

16. Raspberry Pi – Definition by Wikipedia - Available at:


< http://en.wikipedia.org/wiki/Raspberry_Pi >. Accessed: December 16, 2012.

17. Raspberry Pi – project web site: < http://www.raspberrypi.org/ >. Accessed: December 16, 2012.

18. Atube-Catcher – Para descargar videos de la RED - http://atube-catcher.softonic.com/descargar


32 of XX
Power MOSFET
( HEXFET N-Channel )

10%

IRFZ44 90%

The Tip of the Iceberg

¿Como obtener el Mayor Beneficio de este Curso y de la Carrera ...?


( La importancia de Aprender a Aprender )

This subject will continue …! 33 of XX


__. “More Information“ FTDI USB
Hardware & Software ( “Bare Bone” - Compra en USA )

BoArduino Schematic

RESET

ARDUINO USB

34 of XX
BoArduino PCB

USB to TTL FT232


__. “More Information“
Hardware & Software ( Aplicación + Uso Practico )

Como construir una fresadora CNC casera 3 ejes

Arduino UNO R3 – SB uC

Part #1 - http://www.youtube.com/watch?v=2VasRIHSIkA 36 of XX
__. “More Information“
Hardware & Software ( “Arduino” - Compra en USA )
Un poco de actualidad … ( Arduino and Raspberry PI )

- Microcontrolador ATmega328 de ATMEL


- Open Source
- Desarrollado por cinco (5) profesores universitarios
en Italia

- Arduino basics by mr. R. Hassell – See: Mis primeros


pasos con Arduino at: http://labs.robertohassell.com/
- Accessed: 03/20/2013
Arduino UNO R3 – SB uC http://tienda.tdrobotica.co/download/Libro_kit_Basico.pdf

- Single Board Computer (SBC)


-Developed in the UK by the Raspberry Pi Foundation
with the intention of stimulating the teaching of basic
computer science in schools.

-Raspberry Pi basics by mr. R. Hassell – See: Mis


primeras impresiones con la Raspberry Pi at:
http://labs.robertohassell.com/ - Accessed: 03/20/2013

Raspberry Pi SBC
37 of XX
__. “More Information“
Hardware & Software ( Aplicación + Uso Practico )

Build Your Own Portable Raspberry Pi

Raspberry Pi SBC

38 of XX
Part #1 ( Video ) - http://www.youtube.com/watch?v=dUZjzQuTNX4
__. “More Information“
Hardware & Software ( DATA - Compra Local )

http://www.electronicacaribe.com/

- En la electrónica Caribe ya están vendiendo tarjetas Arduino Uno…

- Pronto estarán vendiendo servomotores y sensores…

- Los pedidos se pueden hacer por correo, primero confirman que haya
los componentes requeridos y luego hacer el deposito a una cuenta de
ellos.

- POC: Mr. Román, dueño de la electrónica Caribe.

Referencia: Tienda de Electrónica – FIE, CR de Azuero


POC Mr. Anthony García, III año, FIE, Electromecánica
39 of XX
ASCII Table
Dispensador de Jugo o Café
( Prueba en Plantilla – Ver. 1.1 )
DIO 5 PWM
5V
DIO 3 PWM
3.3k
ATmega328 AIN 3

CAFE JUGO
1 PC6 PC5 28
2 PD0 PC4 27 FotoRes_Vaso
3 PD1 26
1k 4 PD2 PC3
PC2 25
1k 5 PD3 PC1 24
6 PD4 PC0 23
7 VCC GND 22
8 GND AREF 21
9 AVCC 20
10 PB6
PB7 PB5 19
11 PD5 PB4 18 DIO 13
5V 12 PD6 PB3 17
5V 13 PD7 PB2 16
14 PB0 PB1 15
CAFE JUGO
U2

DIO 7
DIO 8
VASO

10k 10k 1k
Control de Dos Tanques
( Prueba en Plantilla – Ver. 1.1 )

Rare Earth Magnets

P/N 2181319
Practical MOSFET Tutorial #6 - DCOI Opto-Isolator Driver

43 of XX
T #XX. MCU + TIP 120 – PWM Testing & Interfacing / Item: Water Pump

PWM 3V

PWM 1V PWM 4V

PWM 2V PWM 5V 44 of XX
T #XX. MCU + TIP 120 – PWM Testing & Interfacing / Item: Water Pump

Discharge

12V / 2A – Pump DC Motor


Power Supply

MCU + PWM + 12V DC Pump Motor


Test Wiring

Discharge + -
Suction

1N4004

12V DC Pump Motor


Test Wiring Windshield Wiper Pump
TIP 120 - Power Darlington Test Piping
Vce=60V, Ic=5A, PN: 32993 45 of XX
Using a N-Channel Power MOSFET to Control a DC Motor

MCU Basic Test Circuit


( Jameco P/N 669943 - $1.10 )

MOTOR,DC,12V,8703RPM,7.43A 753g-cm,79%EFF
46 of XX
( Jameco P/N 2258515 - $3.95 )
DosTanques_Prueba en Plantilla
L298N Motor Drive Controller Board DC Dual H-Bridge
L298N Motor Drive Controller Board DC Dual H-Bridge
L298N Motor Drive Controller Board DC Dual H-Bridge
L298N Motor Drive Controller Board DC Dual H-Bridge
#7

LEDs + Pb + Buzzer
#29

RTC + 20X4 LCD + RFID + Servo

#22

#4

#29
#29

RTC + 20X4 LCD + RFID + Servo


#29

RTC + 20X4 LCD + RFID + Servo


#29

RTC + 20X4 LCD + RFID + Servo


#29

Pb + PhR + LEDs
#29

Pb + PhR + LEDs
#29

Pb + PhR + LEDs
Kit de Arduino

Kit de Arduino by SunFounder


Requirement: One (1) for Group “A” and one (1) for Group “B”
61 of XX
Component list Component List & Test Examples
I2C LCD1602
RFID module 30 Lessons
RFID key ring 1 Controlling LED by Button
RFID White card 2 Controlling LED by PWM
DS1302 clock module 3 Interactive LED Flowing Lights
Voice Sensor 4 I2C LCD1602
Humiture sensor 5 Buzzer
Water level measurement module 6 Tilt-Switch
30 X Jumper wires(male to male) 7 Answer Machine
Breadboard 8 Serial Monitor
13 X Red LED 9 Photoresistor
5 X Yellow LED 10 Controlling Voice by Light
5 X Blue LED 11 Flame Sensor
Resistor Package(1k 10k 220R) 12 Voltmeter
30 X Jumper wires(male to female) 13 Voice Sensor
Potentiometer 14 LM35 Temperature Sensor
Active Buzzer 15 Water Level Sensor
Passive Buzzer 16 One Digit 7-Segment Display
74HC595 17 Stopwatch
Infrared Receiver 18 Dot-matrix Display
LM35 19 RGB LED
Flame Sensor 20 74HC595
2 X Tilt-switch Kit de Arduino by SunFounder 21 Button Switch
2 X Photoresistor 22 Clock Module
Button Switch Component list … 23 Humiture Sensor
Remote controller Servo 24 Relay Module
Four-digit segment display Relay module 25 Stepper Motor
9V Battery Buckle One-digit segment display 26 Servo
RGB module Joystick PS2 27 Joystick PS2
4*4 Keypad module 4 X Button 28 Infrared-Receiver
8*8 Dot-matrix module Small Button 29 RFID Entrance Guard System
Stepper motor USB cable 30 Password62 Lock
of XX
ULN2003 Driver
See“Slide Notes”
Arduino + Evaluación de Elementos de Control
Disipositivos de Entra / Salida

Objetivo / Meta: Librería / Repositorio de Codigo_Reusable

Reference:
1. Book: Embedded Systems Building Blocks – By Jean J. Laborsse - Available at:
63 of XX
http://read.pudn.com/downloads91/ebook/352639/Embedded_Systems_Building_Blocks.pdf -
Accessed: March 20, 2015.
ARDUINO Mega 2560 R3

64 of XX
65 of XX

También podría gustarte