2. 2
• Programmers work in the virtual world
• Machinery works in the physical world
• Microcontrollers connect the virtual and
physical world
• The inputs and outputs can be manipulated
by, and can manipulate, the physical world
Microcontrollers
4. 4
Arduino is software
• An Integrated Development
Environment (IDE) for
programming
• Edit code like a word
document
• The platform creates the
“process”, compiles it, and
uploads it to the Arduino
• The language is called
‘wiring’, and is based on C
5. 5
Arduino is a platform
• A physical Input / Output
board (I/O) with a
programmable
Integrated Circuit (IC).
6. 6
Why Arduino?
• Open Source: anyone who wants can improve upon it
• Cheap: anyone can produce them for any price (<$15)
• Common Interface: communicates via USB
• Low Power: from USB or battery pack
• Standalone: memory allows it to run even when not
connected to a computer
18. 18
Concepts: INPUT vs. OUTPUT
•Referenced from the perspective of the
microcontroller (electrical board).
Inputs is a signal / information going
into the board.
Output is any signal exiting the
board.
19. 19
Concepts: INPUT vs. OUTPUT
•Referenced from the perspective of the
microcontroller (electrical board).
Inputs is a signal / information going
into the board.
Output is any signal exiting the
board.
Examples:
Buttons Switches, Light
Sensors, Flex Sensors,
Humidity Sensors,
Temperature Sensors…
Examples:
LEDs, DC motor,
servo motor,
piezo buzzer,
relay, RGB LED
21. 21
• Computers communicate in a digital language
– “ON” or “OFF”, “HIGH” or “LOW”, “1” or “0”, “5V or 0V”
• Our physical world is analog
– “warm”, “37 mph”, “92 degrees”
• So how do we create 2.73 volts if all we have is 0 and 5?
• With a technique called Pulse width Modulation (PWM)
• Imagine turning a fan off and on every second. It would
operate at a “medium” speed.
• The longer the pulses (ON’s), the higher the average
voltage and the actual voltage output.
Analog vs. Digital
25. 25
Components
Push Button Digital Input Switch - Closes or
opens circuit
Potentiometer Analog Input Variable resistor
Photoresistor Analog Input Light Dependent
Resistor (LDR)
Relay Digital Output Switch driven by a
small signal
Temp Sensor Analog Input Temp Dependent
Resistor
Flex Sensor Analog Input Variable resistor
Soft Trimpot Analog Input Variable resistor
RGB LED Dig & Analog
Output
16,777,216 different
colors
Name Image Type Function
Digital Input
Analog Input
Analog Input
Digital Output
Analog Input
Analog Input
Analog Input
Dig & Analog
Output