Upload
denis-conley
View
216
Download
1
Embed Size (px)
Citation preview
2
Microcontrollers• Programmers work in the virtual world.• Machinery works in the physical world.• The microcontroller connects the virtual world
to the physical world• A microcontroller is a small-scale computer
with generalized (and programmable) inputs and outputs.
• The inputs and outputs can be manipulated by, and can manipulate, the physical world.
4
Arduino is software• Including an Integrated
Development Environment (IDE) for programming.
• It’s used to edit code as if editing a word document
• The platform is used to create the “process”, compile it, and then upload it to the microcontroller.
• The language itself is based in C and is called ‘wiring’
5
Arduino is a platform• A physical Input / Output
board (I/O) with a programmable Integrated Circuit (IC).
6
Why Arduino?
• It is Open Source, both in terms of Hardware and Software. Anyone who wants can copy it for free
• It is cheap, the hardware can be built from components or a prefab board can be purchased for as little as $15
• It can communicate with a computer via serial connection over USB (common interfaces)
• It can be powered from USB or standalone DC power.• It can run standalone from a computer (chip is
programmable) and it has memory (a small amount).
7
What can it do?• Sensors ( to sense stuff ) [ INPUTS ]
– Push buttons, touch pads, tilt switches.– Variable resistors (eg. volume knob / sliders)– Photoresistors (sensing light levels)– Thermistors (temperature)– Ultrasound (proximity range finder)
• Actuators ( to do stuff ) [ OUTPUTS ]
– Lights, LED’s– Motors– Speakers– Displays (LCD)
CURRENT LIMITS!!!
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
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
Analog vs. Digital• Computers “naturally” talk in a digital language. Things
are either “ON” or “OFF”, “HIGH” or “LOW”, “1” or “0”, “5V or 0V”
• Our physical world is analog. Things can be “medium”, “warm”, “37 mph”, “92 degrees”
• So how do we create 2.75 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.
25
ComponentsPush 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