Download - Lesson sample introduction to arduino
![Page 1: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/1.jpg)
Introduction to Arduino
Seng Kang Secondary School Applied Learning Programme
(ALP)
![Page 2: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/2.jpg)
Lesson Objective
• What is Arduino• Parts of Arduino board• Programming codes / Arduino
Software
![Page 3: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/3.jpg)
What is an Arduino?• Microcontroller board• Arduino can be used to develop interactive
objects, taking INPUTS (eg. Switches or sensors) and controlling physical OUTPUTS (eg. Lights or motors)
• The boards can be assembled by hand or purchased preassembled
![Page 4: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/4.jpg)
Power in
USB (to computer)
Digital I\OPWM(3, 5, 6, 9, 10, 11)RESET
POWER 5V / 3.3V / GND
Analog INPUTS
Arduino
![Page 5: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/5.jpg)
How Arduino works?
Human inputsEyeEar
NoseTongue
Skin
Output examples
Activate armsActivate legs
Activate mouth
Human brain
Output examples
Activate LEDsActivate Servo
Activate buzzer
Arduino inputsLight Sensors
Heart Rate sensors
Temperature sensors
Other inputs
Arduino Board
![Page 6: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/6.jpg)
How Arduino works?
Arduino board blinks
the LED
Computer uploads
blinking LED code to Arduino board
Teacher shows how to connect the Arduino components
Student connects the
Arduino components
Student’s brain
Arduino Board
![Page 7: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/7.jpg)
Digital Pins vs Analog Pins
• Digital Pin– There is two
modes (eg: ON/OFF)
• Analog Pins– Variable range (eg: dimming the light, different intensity)
![Page 8: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/8.jpg)
Arduino Software(Sketch)
![Page 9: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/9.jpg)
Light Emitting Diode (LED)
√ Polarity
![Page 10: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/10.jpg)
Examples of LED
![Page 11: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/11.jpg)
Activity: Blinking LED
![Page 12: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/12.jpg)
Assemble
Negative leg LED GND
Positive leg LED Pin 13
![Page 13: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/13.jpg)
Codes
• Step 1: Double click the icon to OPEN up the IDE
• Step 2: TYPE the code into the space below.
• Step 3: Click on to VERIFY the codes.
• Step 4: Click on to UPLOAD the codes to the board.
![Page 14: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/14.jpg)
What does the codes means?
![Page 15: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/15.jpg)
What do you observe after the
codes are uploaded?
![Page 16: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/16.jpg)
End with a semi-colon ( ; )
const int led = 13;
void setup ()
{
pinMode (led, OUTPUT);
}
void loop ()
{
digitalWrite (led, HIGH);
delay(1000);
digitalWrite (led, LOW);
Delay (1000);
}
Declaration
Setup function(Preparation)
Loop function (Execution)
Open and close with curly brackets { }
Let’s Decode!!!
![Page 17: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/17.jpg)
const int led = 13;
void setup ()
{
pinMode(led, OUTPUT);
}
void loop ()
{
digitalWrite (led, HIGH);
delay(1000);
digitalWrite (led, LOW);
delay(1000);
}
Declare LED as pin 13
Define LED as OUTPUT
HIGH LED On
LOW LED Off
Duration between blinks (In millisecond)
![Page 18: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/18.jpg)
void loop ( )
{
digitalWrite (led, HIGH) ;
delay(1000);
digitalWrite (led, LOW);
delay(1000);
}
void loop ( )
{
digitalWrite (led, HIGH) ;
delay(500);
digitalWrite (led, LOW);
delay(500);
}
What do you observe after the codes are
changed?
![Page 19: Lesson sample introduction to arduino](https://reader033.vdocument.in/reader033/viewer/2022042706/58a891631a28ab68208b5381/html5/thumbnails/19.jpg)
Keywords• Arduino Board: Physical programmable circuit
board (also known as microcontroller)• Sketch: The name that Arduino uses for a
program. It is where the program codes are written.
• LED: Light Emitting Diode. Is an output.