0% found this document useful (0 votes)
6 views

Arduino Lecture for Final Exam

Arduino is an open-source platform for building electronics projects, featuring various boards like Arduino UNO, Nano, Due, and Mega, each with different specifications. The document covers the components of the Arduino boards, including microcontrollers, input/output pins, and programming basics, along with hands-on projects like blinking an LED and using a piezo buzzer. It also discusses the setup, programming environment, and testing methods for Arduino projects.

Uploaded by

conventojose24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Arduino Lecture for Final Exam

Arduino is an open-source platform for building electronics projects, featuring various boards like Arduino UNO, Nano, Due, and Mega, each with different specifications. The document covers the components of the Arduino boards, including microcontrollers, input/output pins, and programming basics, along with hands-on projects like blinking an LED and using a piezo buzzer. It also discusses the setup, programming environment, and testing methods for Arduino projects.

Uploaded by

conventojose24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

ARDUINO

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.

● All Arduino boards have a microcontroller.

● A microcontroller is basically a really


small computer.
Some Popular Arduino Boards
BOARD: Arduino UNO Arduino Nano Arduino Due Arduino Mega

Processor ATmega328P ATmega168 ATSAM3X8E ATmega2560


ATmega328P

Processor 16 MHz 16 MHz 84 MHz 16 MHz

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

This is a printer USB port used to


load a program from the Arduino IDE
onto the Arduino board. The board
can also be powered through this
port.
Power port:
The Arduino board can be powered
through an AC-to-DC adapter or a battery.
The power source can be connected by
plugging in a 2.1mm center-positive plug
into the power jack of the board.

The Arduino UNO board operates at a


voltage of 5 volts, but it can withstand a
maximum voltage of 20 volts. If the board is
supplied with a higher voltage, there is a
voltage regulator (it sits between the power
port and USB connector) that protects the
board from burning out. 2.1mm center-positive plug
Microcontroller

It is brains of your Arduino. The microcontroller used on the UNO board is

Atmega328P by Atmel Atmega328P has the following components in it:

● 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

resistance. Hence, only a small amount of current flows through

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

Arduino Uno LED lights


A small microcontroller board that acts Lights that emit a bright light when
as the brain of the project. electricity passes through them.

Resistors Jumper wires


Components that limit the flow of Wires used to connect the different
electricity and prevent damage to the components together.
LED and Arduino.
Building the Circuit

Circuit Diagram Arduino Board Soldering


We connect the We connected the LED We used a soldering tool
components and create a and resistors to specific to make permanent
functional LED circuit. pins on the Arduino board. connections that ensure
consistency and stability.
Programming the Arduino
1 Programming
The programming was done in
a separate and easily installable
Arduino Language 2 environment called Mblock.
The C/C++ programming
language was used to program
the Arduino. 3 LED Control
We wrote code that controlled
the brightness and color of the
LED lights.
Testing and Troubleshooting
Multimeter Testing Simulation Testing
We used a multimeter to check that We used a software simulation to test
the circuit is working and all and verify our code before running it
components are properly connected. on the physical circuit.
Q&A

1 Questions and Answers


Q&A session to let us address any remaining doubts and questions you may have.
BUZZER
• Piezo buzzer is an electronic device commonly used to
produce sound.
• Light weight, simple construction and low price make it usable
in various applications like car/truck reversing indicator,
computers, call bells etc.
• Piezo buzzer is based on the inverse principle of piezo
electricity . It is the phenomena of generating electricity when
mechanical pressure is applied to certain materials and the vice
versa is also true. Such materials are called piezo electric
materials.
• Piezo electric materials are either naturally available or
manmade. Piezoceramic is class of manmade material, which
poses piezo electric effect and is widely used to make disc, the
heart of piezo buzzer. When subjected to an alternating electric
field they stretch or compress, in accordance with the frequency
of the signal thereby producing sound.
const int buzzer = 9; //buzzer to arduino pin 9
void setup()
{

pinMode(buzzer, OUTPUT); // initializing pin 9 as an output

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
}

You might also like