SlideShare a Scribd company logo
1 of 33
Download to read offline
Lab 2: Arduino
Zhentao Xu
Today’s schedule
• Lecture 1: Arduino
• Install Arduino driver
• Lab 1: use Arduino UNO to control LED.
• Lecture 2: Sensor and Feedback
• Lab 2: use Arduino UNO and ultrasonic distance
sensor to measure distance
• Lecture 3: Minimum system
• Lab 3: Building minimum system using AVR chip.
What is Arduino?
• Official definition: A combination of hardware,
software, development team, design philosophy.
• From Ivrea, Italy.(意大利的艾维里)
• Hardware include Arduino UNO and Arduino Mega,
Software include Arduino IDE.
• Arduino UNO: Development board of AVR chips.
• Arduino UNO is announced in 2011.
• UNO Punto Zero (1.0)
What can Arduino UNO do?
Self-balanced Car
What can Arduino UNO do?
LED-Cubic
Arduino Components
Processor
USB
Ports
Power
Supply power &
Serial Communicate
Connection with outside
world
Supply power
Process information &
Make decision
Real Circuit Diagram
Install Arduino driver
Refer to the PDF file from the announcement on SAKAI.
For Windows 7 Operating Systen:
• Step 1: Download Arduino IDE and unzip it.
• http://arduino.googlecode.com/files/arduino-1.0.5-r2-
windows.zip
• Step 2: Plug in Arduino UNO board.
• Step 3: Right-click This PC  Manage Other
device Right-click Unknown deviceUpdate
driver Scan the driver folder in Arduino IDE.
For Windows 8/8.1, please refer to PDF file.
For Mac OS/Linux, Skip this slides.
Arduino IDE
Arduino IDE
• An integrated development environment designed
for Arduino hardware.
• The language is C++ - like.
• Process of doing Arduino Project:
• Connect hardware with Arduino UNO
• Write program on Arduino IDE.
• Download it onto Arduino UNO.
• Power Arduino UNO on and enjoy it.
Arduino IDE
• Structure: two necessary functions:
1. void setup(){}
2. void loop(){}
• The relationship between Arduino Language and
C++ Language.
• Important sentence:
pinMode (PinNumber,Mode); (general in setup(){};)
digitalWrite (PinNumber, DigitalVoltage);
delay (MiliSeconds);
Lab #1: Light up LED
• Requirement:
• Light up LED and keep 3 seconds, than power it off and
keep 3 seconds.
• Repeat the procedure.
• DIY
Quite easy, right?
void setup()
{
//Connect LED resistor on pin 13.
pinMode(13,OUTPUT);
}
void loop()
{
digitalWrite(13,HIGH);
delay(5000);
digitalWrite(13,LOW);
delay(5000);
}
Quick Review
• You have controlled the On and Off of LED by
control the output voltage of a certain port.
• The voltage on pin 13 is called digital signal, which
can be either 1 (logical-high voltage) or 0 (logical-
low voltage).
• Actually, Arduino UNO can output/input
digital/analog signals.
Sensor(传感器)
• Arduino is like a brain. It also needs ears, eyes, nose,
etc. to measure quantities in outside environment.
• Sensor serves as the connection between Arduino
and the outside environment.
• So called Feed back control
Temp. Sound
Light …
Environment
Velocity Sensor -- Tachometer
Velocity sensor –
Tachometers
Where K is the back EMF
constant.
Every car has a tachometer
so as to measurer to measure
speed.
(t) K (t)t vwV 
Temperature Sensor
• Three classes f temperature sensors:
• Thermometers and bimetallic strips ---- Sensors which
change physical dimension as a function of temperature.
• RTDs and thermistors ----Sensors which change
resistance as a function of temperature.
• RTD:
• Thermistor:
• Thermocouples ----Sensors which work based on
thermoelectric phenomena
0 0(1 (T T ))R R   
0
1 1
( )
0
T T
R R e
 

Ultrasonic sensor
• Ultrasonic sensors are used to measure distance.
• An impulse of ultrasonic wave is emitted from the
sensor. The wave will reflect when reaches some
obstacles. The time between emission and
receiving will be calculated.
• Use formula to calculate the
distance.
/ 2L Vt
HC-SR04 ultrasonic sensor
• Four pins (GND, VCC, Trig, Echo)
• GND and VCC is the power supply to this module.
• Arduino UNO send message to Trig, and read
message from Echo.
Serial Ports (COM,串口)
Communication
• Serial is one way in which information is transferred
between computer & Arduino.
• Information can also be transferred using Parallel
Ports.(并口)
• Two important sentence of serial communication.
• Serial.begin(BaudRate); (must be in setup())
• Serial.write(message);
Lab 2: Use ultrasonic sensor to
measure distance
Electronic components Number Note
Arduino UNO 1 With USB wire
HC-SR04 Sensor 1
Wires 4
Arduino UNO HC-SR04 Note
GND GND
VCC VCC
A1 (Pin 15) Trig
A0(Pin 14) Echo
Lab equipment:
Wire connection
Program
void loop()
{
digitalWrite(TrigPin, LOW);
delayMicroseconds(2);
digitalWrite(TrigPin, HIGH);
delayMicroseconds(5);
digitalWrite(TrigPin, LOW);
cm = int(pulseIn(EchoPin, HIGH) / 58.0);
Serial.println(cm);
}
const int TrigPin = 15;
const int EchoPin = 14;
float cm;
void setup()
{
Serial.begin(9600);
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);
}
Quick Review
• Sensor: connection between Arduino and outside
environment.
• Serial: one way in which information is transferred.
AVR
• AVR is a family of MCU chips which are produced
by ATMEL Company.
• The AVR chip on Arduino UNO is Atmega328.
• The AVR chip on Arduino MEGA is Atmega2560
• Working environment:
• Stable 5V power supply
• Time reference input
• (RESET)
Atmega328P-PU
• Pin number and
counting order.
• Significant pin for
working.
• Power supply: PIN7,
PIN8, PIN20, PIN22.
• RESET: PIN1
• Timing: PIN9,
PIN10
• Serial Ports: PIN2,
PIN3
Min. Sys. Of Atmega328P-PU
• Minimum system: MCU chip with simplest
peripheral circuit. (外围电路).
• Below is the circuit for min. sys. of Atmega328P.
Lab 3: Min. Sys. Of Atmega328P
• Step 1 Remove the MCU chip on Arduino.
Step 2. Build the minimum system
Step 3 Connect LED and
download program
• Connect the series of LED and resistor to pin GND
and pin 19.
• Connect the Arduino PCB and your computer as is
done in Lab 1.
• Write exactly the same program as in Lab 1 without
any change.
• Click the Download button.
• See what happen~~^_^
Step 3 Connect LED and
download program
• When the download process has been down, you
can remove the RESET line and RX TX line, just
leaving the VCC and GND so as to give power to the
Atmega328.
A Quick Review
• In the lab 3, we connect the LED to pin GND and Pin
19, but actually in the program we define the Port
13, why?
Reference
• [1] Arduino Internal, Wheat, Dale.
• [2] Slides of Dr. Huang Peisen.
• [3] www.arduino.cc

More Related Content

What's hot

Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYVishnu
 
ESP32 IoT presentation @ dev.bg
ESP32 IoT presentation @ dev.bgESP32 IoT presentation @ dev.bg
ESP32 IoT presentation @ dev.bgMartin Harizanov
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduinoavikdhupar
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCUroadster43
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingEmmanuel Obot
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoVishnu
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
Les peripheriques
Les peripheriquesLes peripheriques
Les peripheriquess12ber
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriGaurav Pandey
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoOmer Kilic
 
Attacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVEAttacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVEAleksandr Timorin
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshopatuline
 
Arduino Introduction Presentation
Arduino Introduction PresentationArduino Introduction Presentation
Arduino Introduction Presentationericholm
 
Arduino : how to get started
Arduino : how to get startedArduino : how to get started
Arduino : how to get started동호 손
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoyeokm1
 
Arduino-Workshop-4.pptx
Arduino-Workshop-4.pptxArduino-Workshop-4.pptx
Arduino-Workshop-4.pptxHebaEng
 

What's hot (20)

Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
ESP32 IoT presentation @ dev.bg
ESP32 IoT presentation @ dev.bgESP32 IoT presentation @ dev.bg
ESP32 IoT presentation @ dev.bg
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCU
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Les peripheriques
Les peripheriquesLes peripheriques
Les peripheriques
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Attacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVEAttacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVE
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
 
Arduino Introduction Presentation
Arduino Introduction PresentationArduino Introduction Presentation
Arduino Introduction Presentation
 
Arduino : how to get started
Arduino : how to get startedArduino : how to get started
Arduino : how to get started
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino-Workshop-4.pptx
Arduino-Workshop-4.pptxArduino-Workshop-4.pptx
Arduino-Workshop-4.pptx
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
 
Arduino lcd display
Arduino lcd displayArduino lcd display
Arduino lcd display
 

Viewers also liked

How to measure frequency and duty cycle using arduino
How to measure frequency and duty cycle using  arduinoHow to measure frequency and duty cycle using  arduino
How to measure frequency and duty cycle using arduinoSagar Srivastav
 
Voltage measurement using arduino
Voltage measurement using arduinoVoltage measurement using arduino
Voltage measurement using arduinoChetan Khatri
 
Arduino Introduction by coopermaa
Arduino Introduction by coopermaaArduino Introduction by coopermaa
Arduino Introduction by coopermaa馬 萬圳
 
Gas Leakage Detector using Arduino with SMS Alert - Engineering Project
Gas Leakage Detector using Arduino with SMS Alert - Engineering ProjectGas Leakage Detector using Arduino with SMS Alert - Engineering Project
Gas Leakage Detector using Arduino with SMS Alert - Engineering ProjectCircuitsToday
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoEoin Brazil
 

Viewers also liked (6)

How to measure frequency and duty cycle using arduino
How to measure frequency and duty cycle using  arduinoHow to measure frequency and duty cycle using  arduino
How to measure frequency and duty cycle using arduino
 
Voltage measurement using arduino
Voltage measurement using arduinoVoltage measurement using arduino
Voltage measurement using arduino
 
Arduino Introduction by coopermaa
Arduino Introduction by coopermaaArduino Introduction by coopermaa
Arduino Introduction by coopermaa
 
Project Report
Project ReportProject Report
Project Report
 
Gas Leakage Detector using Arduino with SMS Alert - Engineering Project
Gas Leakage Detector using Arduino with SMS Alert - Engineering ProjectGas Leakage Detector using Arduino with SMS Alert - Engineering Project
Gas Leakage Detector using Arduino with SMS Alert - Engineering Project
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
 

Similar to Lab2ppt

Introduction to Arduino Webinar
Introduction to Arduino WebinarIntroduction to Arduino Webinar
Introduction to Arduino WebinarFragiskos Fourlas
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfAbdErrezakChahoub
 
Getting started with arduino workshop
Getting started with arduino workshopGetting started with arduino workshop
Getting started with arduino workshopSudar Muthu
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxethannguyen1618
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptxaravind Guru
 
Internet of Things Unit 3 notes-Design and Development and Arduino.pptx
Internet of Things Unit 3 notes-Design and Development and Arduino.pptxInternet of Things Unit 3 notes-Design and Development and Arduino.pptx
Internet of Things Unit 3 notes-Design and Development and Arduino.pptxDinola2
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfssusere5db05
 
IOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptxIOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptxSanaMateen7
 

Similar to Lab2ppt (20)

Introduction to Arduino Webinar
Introduction to Arduino WebinarIntroduction to Arduino Webinar
Introduction to Arduino Webinar
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
 
Arduino
ArduinoArduino
Arduino
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
B1_25Jan21.pptx
B1_25Jan21.pptxB1_25Jan21.pptx
B1_25Jan21.pptx
 
Getting started with arduino workshop
Getting started with arduino workshopGetting started with arduino workshop
Getting started with arduino workshop
 
Neno Project.docx
Neno Project.docxNeno Project.docx
Neno Project.docx
 
publish manual
publish manualpublish manual
publish manual
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptx
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Internet of Things Unit 3 notes-Design and Development and Arduino.pptx
Internet of Things Unit 3 notes-Design and Development and Arduino.pptxInternet of Things Unit 3 notes-Design and Development and Arduino.pptx
Internet of Things Unit 3 notes-Design and Development and Arduino.pptx
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Smart Blind stick by using arduino uno and sensor
 Smart Blind stick  by using arduino  uno  and sensor Smart Blind stick  by using arduino  uno  and sensor
Smart Blind stick by using arduino uno and sensor
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
 
Arduino course
Arduino courseArduino course
Arduino course
 
IOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptxIOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptx
 
Arduino day
Arduino dayArduino day
Arduino day
 

Lab2ppt

  • 2. Today’s schedule • Lecture 1: Arduino • Install Arduino driver • Lab 1: use Arduino UNO to control LED. • Lecture 2: Sensor and Feedback • Lab 2: use Arduino UNO and ultrasonic distance sensor to measure distance • Lecture 3: Minimum system • Lab 3: Building minimum system using AVR chip.
  • 3. What is Arduino? • Official definition: A combination of hardware, software, development team, design philosophy. • From Ivrea, Italy.(意大利的艾维里) • Hardware include Arduino UNO and Arduino Mega, Software include Arduino IDE. • Arduino UNO: Development board of AVR chips. • Arduino UNO is announced in 2011. • UNO Punto Zero (1.0)
  • 4. What can Arduino UNO do? Self-balanced Car
  • 5. What can Arduino UNO do? LED-Cubic
  • 6. Arduino Components Processor USB Ports Power Supply power & Serial Communicate Connection with outside world Supply power Process information & Make decision
  • 8. Install Arduino driver Refer to the PDF file from the announcement on SAKAI. For Windows 7 Operating Systen: • Step 1: Download Arduino IDE and unzip it. • http://arduino.googlecode.com/files/arduino-1.0.5-r2- windows.zip • Step 2: Plug in Arduino UNO board. • Step 3: Right-click This PC  Manage Other device Right-click Unknown deviceUpdate driver Scan the driver folder in Arduino IDE. For Windows 8/8.1, please refer to PDF file. For Mac OS/Linux, Skip this slides.
  • 10. Arduino IDE • An integrated development environment designed for Arduino hardware. • The language is C++ - like. • Process of doing Arduino Project: • Connect hardware with Arduino UNO • Write program on Arduino IDE. • Download it onto Arduino UNO. • Power Arduino UNO on and enjoy it.
  • 11. Arduino IDE • Structure: two necessary functions: 1. void setup(){} 2. void loop(){} • The relationship between Arduino Language and C++ Language. • Important sentence: pinMode (PinNumber,Mode); (general in setup(){};) digitalWrite (PinNumber, DigitalVoltage); delay (MiliSeconds);
  • 12. Lab #1: Light up LED • Requirement: • Light up LED and keep 3 seconds, than power it off and keep 3 seconds. • Repeat the procedure. • DIY
  • 13. Quite easy, right? void setup() { //Connect LED resistor on pin 13. pinMode(13,OUTPUT); } void loop() { digitalWrite(13,HIGH); delay(5000); digitalWrite(13,LOW); delay(5000); }
  • 14. Quick Review • You have controlled the On and Off of LED by control the output voltage of a certain port. • The voltage on pin 13 is called digital signal, which can be either 1 (logical-high voltage) or 0 (logical- low voltage). • Actually, Arduino UNO can output/input digital/analog signals.
  • 15. Sensor(传感器) • Arduino is like a brain. It also needs ears, eyes, nose, etc. to measure quantities in outside environment. • Sensor serves as the connection between Arduino and the outside environment. • So called Feed back control Temp. Sound Light … Environment
  • 16. Velocity Sensor -- Tachometer Velocity sensor – Tachometers Where K is the back EMF constant. Every car has a tachometer so as to measurer to measure speed. (t) K (t)t vwV 
  • 17. Temperature Sensor • Three classes f temperature sensors: • Thermometers and bimetallic strips ---- Sensors which change physical dimension as a function of temperature. • RTDs and thermistors ----Sensors which change resistance as a function of temperature. • RTD: • Thermistor: • Thermocouples ----Sensors which work based on thermoelectric phenomena 0 0(1 (T T ))R R    0 1 1 ( ) 0 T T R R e   
  • 18. Ultrasonic sensor • Ultrasonic sensors are used to measure distance. • An impulse of ultrasonic wave is emitted from the sensor. The wave will reflect when reaches some obstacles. The time between emission and receiving will be calculated. • Use formula to calculate the distance. / 2L Vt
  • 19. HC-SR04 ultrasonic sensor • Four pins (GND, VCC, Trig, Echo) • GND and VCC is the power supply to this module. • Arduino UNO send message to Trig, and read message from Echo.
  • 20. Serial Ports (COM,串口) Communication • Serial is one way in which information is transferred between computer & Arduino. • Information can also be transferred using Parallel Ports.(并口) • Two important sentence of serial communication. • Serial.begin(BaudRate); (must be in setup()) • Serial.write(message);
  • 21. Lab 2: Use ultrasonic sensor to measure distance Electronic components Number Note Arduino UNO 1 With USB wire HC-SR04 Sensor 1 Wires 4 Arduino UNO HC-SR04 Note GND GND VCC VCC A1 (Pin 15) Trig A0(Pin 14) Echo Lab equipment: Wire connection
  • 22. Program void loop() { digitalWrite(TrigPin, LOW); delayMicroseconds(2); digitalWrite(TrigPin, HIGH); delayMicroseconds(5); digitalWrite(TrigPin, LOW); cm = int(pulseIn(EchoPin, HIGH) / 58.0); Serial.println(cm); } const int TrigPin = 15; const int EchoPin = 14; float cm; void setup() { Serial.begin(9600); pinMode(TrigPin, OUTPUT); pinMode(EchoPin, INPUT); }
  • 23. Quick Review • Sensor: connection between Arduino and outside environment. • Serial: one way in which information is transferred.
  • 24. AVR • AVR is a family of MCU chips which are produced by ATMEL Company. • The AVR chip on Arduino UNO is Atmega328. • The AVR chip on Arduino MEGA is Atmega2560 • Working environment: • Stable 5V power supply • Time reference input • (RESET)
  • 25. Atmega328P-PU • Pin number and counting order. • Significant pin for working. • Power supply: PIN7, PIN8, PIN20, PIN22. • RESET: PIN1 • Timing: PIN9, PIN10 • Serial Ports: PIN2, PIN3
  • 26. Min. Sys. Of Atmega328P-PU • Minimum system: MCU chip with simplest peripheral circuit. (外围电路). • Below is the circuit for min. sys. of Atmega328P.
  • 27. Lab 3: Min. Sys. Of Atmega328P • Step 1 Remove the MCU chip on Arduino.
  • 28. Step 2. Build the minimum system
  • 29. Step 3 Connect LED and download program • Connect the series of LED and resistor to pin GND and pin 19. • Connect the Arduino PCB and your computer as is done in Lab 1. • Write exactly the same program as in Lab 1 without any change. • Click the Download button. • See what happen~~^_^
  • 30. Step 3 Connect LED and download program • When the download process has been down, you can remove the RESET line and RX TX line, just leaving the VCC and GND so as to give power to the Atmega328.
  • 31. A Quick Review • In the lab 3, we connect the LED to pin GND and Pin 19, but actually in the program we define the Port 13, why?
  • 32.
  • 33. Reference • [1] Arduino Internal, Wheat, Dale. • [2] Slides of Dr. Huang Peisen. • [3] www.arduino.cc