Arduino Lecture for Final Exam
Arduino Lecture for Final Exam
CLARENCE S. ORDONIA
WELCOME TO :
ARDUINO FOR BEGINNERS
Lecture 1.1: Arduino Platform
What is Arduino ?
● Arduino is an open-source platform used for building electronics
projects.
Best Application Desktop prototyping & Low cost, Small High Performance High I/O
use with Arduino profile, Simple prototyping with requirements with
Shields project superior analog I/O more memory
space
DC Power Jack
Voltage Regulator
USB Port
Reset Button
USB Interface chip
Crystal Oscillator
Analog Reference Voltage
Ground
Power Source -
ATmega328 Digital
Pins
Analog pins
Serial Communication
5V ON Indication LED
in -Circuit Serial
Programming Header
USB Port
● Flash memory of 32KB. The program loaded from Arduino IDE is stored
here.
● RAM of 2KB
● CPU: It controls everything that goes on within the device. It fetches the
program instructions from flash memory and runs them with the help of
RAM.
● Electrically Erasable Programmable Read Only Memory (EEPROM) of
1KB. This is a type of nonvolatile memory, and it keeps the data even
after device restart and reset.
The Arduino UNO board has 6 analog input pins, labeled “Analog
Analog input pins: 0 to 5.” These pins can read the signal from an analog sensor
like a temperature sensor and convert it into a digital value so
that the system understands. These pins just measure voltage
and not the current because they have very high internal
these pins.
Although these pins are labeled analog and are analog input by
default, these pins can also be used for digital input or output.
Digital Pins You can find these pins labeled “Digital 0 to 13.” These pins can be
used as either input or output pins.
When used as output: pins act as a power supply source for the
components connected to them. (supply 4 mA of current at 5 V)
When used as input : they read the signals from the component
connected to them.
Some of the digital pins are labeled with
tilde (~) symbol next to the pin numbers (pin
numbers 3, 5, 6, 9, 10, and 11). These pins
act as normal digital pins but can also be
used for Pulse-Width Modulation (PWM),
which simulates analog output like fading
an LED in and out.
A USB interface chip is a component used to
facilitate communication between a USB device
(such as a computer, smartphone, or peripheral)
and another device or system. These chips act
as the bridge between the USB port and the
internal hardware of a device, converting digital
data to the USB protocol and vice versa.
Lecture 1.2:
Arduino Board
Lecture 2
Direct Programming
Lecture 2.1:
Arduino IDE
Lecture 2.2:
Arduino Basic Setup
Lecture 2.3:
Compiling Code
LED Arduino Uno
Hands-on Science
Project
An engaging and interactive project that introduces the world of
electronics and programming using LED technology and an Arduino Uno
microcontroller.
Introduction
Blinking an LED is an introductory Arduino project in which we
control an LED using Arduino. LED blinking refers to the process
of continuously turning an LED (Light Emitting Diode) and off in a
repetitive pattern. It is a simple and common demonstration in
electronics and microcontroller-based projects.
Components and Tools
void loop()
{
digitalWrite(buzzer, HIGH); // (HIGH )
delay(1000); // wait for a second
digitalWrite(buzzer, LOW); // LOW
delay(1000); // wait for a second
}
KNOCK
int ledPin = 13;
int knockSensor = A0;
byte val = 0;
int statePin = LOW;
int THRESHOLD = 70;
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
val = analogRead(knockSensor);
if (val >= THRESHOLD) {
statePin = !statePin;
digitalWrite(ledPin, statePin);
Serial.println("Knock!");
}
delay(100); // we have to make a delay to avoid overloading
}