BASIC
ROBOTICS
Today We’ll learn-
# Microcontroller
# Sensors
# Actuators
Introduction to
Microcontrollers
A microcontroller (MCU) is a small computer on a single integrated
circuit consisting of a relatively simple central processing unit (CPU)
combined with peripheral devices such as memories, I/O devices,
and timers.
◦ By some accounts, more than half of all CPUs sold worldwide are
microcontrollers
Microcontroller VS
Microprocessor
A microcontroller is a small computer on a single integrated circuit
containing a processor core, memory, and programmable
input/output peripherals.
A microprocessor incorporates the functions of a computer’s
central processing unit (CPU) on a single integrated circuit.
Microcontroller VS
Microprocessor
Types of
Microcontrollers
Arduino
What is Arduino!
What can it do?
•Great for prototyping ideas
•Access to multiple I/O
•Drive motors, turn on lights, trigger controls.
•Low Power requirements
•Flexible / Open-source
Arduino
Pin Diagram Of Arduino Uno
Getting Started
Check out: http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino environment (IDE)
2. Connect the board to your computer via the UBS cable
3. If needed, install the drivers (not needed in lab)
4. Launch the Arduino IDE
5. Select your board
6. Select your serial port
7. Open the blink example
8. Upload the program
Try It: Connect the USB Cable
Arduino IDE
Select Serial Port and Board
Our First Program
Add an External LED to pin 13
• LED’s have polarity
– Negative indicated by flat side of the housing and a short leg
Terminology
Digital I/0
pinMode(pin, mode)
◦ Sets pin to either INPUT or OUTPUT
digitalRead(pin)
◦ Reads HIGH or LOW from a pin
digitalWrite(pin, value)
◦ Writes HIGH or LOW to a pin
Electronic stuff
◦ Output pins can provide 40 mA of current
◦ Writing HIGH to an input pin installs a 20KΩ pullup
Arduino Timing
•delay(ms)
–Pauses for a few milliseconds
•delayMicroseconds(us)
–Pauses for a few microseconds
•More commands: arduino.cc/en/Reference/HomePage
What are Sensors?
American National Standards Institute (ANSI) Definition
◦ A device which provides a usable output in response to a specified measurand
Input Signal Output Signal
Sensor
A sensor acquires a physical parameter and converts it into a signal suitable for processing (e.g.
optical, electrical, mechanical)
Detectable Phenomenon
Connection of sensors/actuators
Example - Temperature control
Sense the temperature of a CPU
Control the speed of the fan to keep the temperature constant
Any Questions??