the arduino - mit esp · warnings •do not connect the arduino to the computer until i have...

40
The Arduino An introduction to the software/hardware interface

Upload: others

Post on 14-Jan-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

The ArduinoAn introduction to the software/hardware interface

Page 2: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Goals:

1. Explain the basics of programming and

circuit design.

2. Describe the hardware/software interface

and the benefits of Arduinos.

3. Build basic circuits using the Arduino system.

Page 3: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

An Initial Question…

What

is a

Computer

Program?

Disclaimer: This is NOT a programming class

Page 4: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Arduino Language

Page 5: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Arduino Language

Check your program for errors Upload program to Arduino

Page 6: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Program I

Page 7: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Program II

Page 8: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Program III

Page 9: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

An Second Question…

What

is a

Circuit?

Page 10: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Circuits

+ -Circuit Elements

+

-

Page 11: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Terminology

• V = Voltage = potential difference• I = Current = flow of charge• R = Resistance = opposition to the flow of current

Page 12: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

A Simple Circuit

5V Gnd

Resistorreduces voltage

LEDLED = light emitting diode

diode: passes current in one direction

Page 13: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

A Simple Circuit

+

-

Page 14: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

A Simple Circuit

Page 15: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

Another Question…

What

is an

Arduino?

Page 16: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

An Example System

Input Output

Page 17: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

An Example System

Input Output

Page 18: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

An Example System

Input Output

Page 19: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

An Example System

Input Output

Page 20: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD I: A Simple Circuit

InputNONE

OutputLED

Page 21: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD I: A Simple Circuit

330 Ω

Page 22: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD I: A Simple Circuit

Page 23: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD I: A Simple Circuit

Page 24: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

WARNINGS

• DO NOT connect the Arduino to the computer until I have verified your circuit.

• DO NOT connect ANYTHING directly to ground.

• DISCONNECT the Arduino from the computer before changing the circuit.

Page 25: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD II: Blink

InputNONE

OutputLED

Page 26: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD II: Blink

330 Ω

Page 27: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD II: Blink

Page 28: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD II: Blink

Check your program for errors Upload program to Arduino

Page 29: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD II: Blink

Page 30: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD III: Sensor Input

InputPHOTORESISTOR

OutputNONE

Page 31: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD III: Sensor Input

+

-

Arduino Input

Page 32: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD III: Sensor Input

10 kΩ

Page 33: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD III: Sensor Input

Page 34: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD III: Sensor Input

Page 35: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD III: Sensor Input

Page 36: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD IV: Sensor LEDs

InputPHOTORESISTOR

OutputLED’s

Page 37: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD IV: Sensor LEDs

x 10

Page 38: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD IV: Sensor LEDs

330 Ω

10 kΩ

Page 39: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD IV: Sensor LEDs

Page 40: The Arduino - MIT ESP · WARNINGS •DO NOT connect the Arduino to the computer until I have verified your circuit. •DO NOT connect ANYTHING directly to ground. •DISCONNECT the

BUILD IV: Sensor LEDs