0% found this document useful (0 votes)
3 views10 pages

Arduino Seminar

Arduino is an open-source electronics platform that combines user-friendly hardware and software, making it accessible for both beginners and advanced users. It is based on microcontrollers, allowing for real-time interaction and low power consumption, and is widely used in various applications such as robotics and scientific instruments. The document also covers the history, types of Arduino boards, the Arduino IDE, and provides a sample project demonstrating its functionality.

Uploaded by

yeyifor920
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)
3 views10 pages

Arduino Seminar

Arduino is an open-source electronics platform that combines user-friendly hardware and software, making it accessible for both beginners and advanced users. It is based on microcontrollers, allowing for real-time interaction and low power consumption, and is widely used in various applications such as robotics and scientific instruments. The document also covers the history, types of Arduino boards, the Arduino IDE, and provides a sample project demonstrating its functionality.

Uploaded by

yeyifor920
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

🕹️

ARDUINO SEMINAR
WHAT IS ARDUINO?
Arduino is an open-source electronics platform that combines easy-to-use hardware and
software.

1. Hardware: Arduino boards are designed to read various inputs, such as light from a sensor, a
button press. These inputs are then processed by a microcontroller on the board.

2. Software: You can program Arduino boards using the Arduino programming language, which
is based on Wiring, and the Arduino Software (IDE), which is built on Processing. With these
tools, you can create instructions for the microcontroller to perform specific tasks.

WHY ARDUINO?
Accessibility: Arduino’s user-friendly experience makes it accessible to beginners, yet flexible
enough for advanced users.

Affordability: Arduino boards are relatively inexpensive compared to other microcontroller


platforms.

Versatility: It’s used in scientific instruments, robotics, interactive prototypes, musical


instruments, and more

HISTORY OF ARDUINO
The Arduino project began in 2005 at the Interaction Design Institute Ivrea in Italy. Its founders,
Massimo Banzi and David Cuartielles, aimed to create an affordable and user-friendly platform
for novices and professionals to build digital devices that interact with their environment using
sensors and actuators.

Inspired by the work of Hernando Barragán, they developed Arduino as an easy-to-use


programmable device for interactive art design projects.

David Mellis contributed to the Arduino software, which was based on Wiring.

Since then, Arduino has become a popular open-source hardware and software platform,
empowering makers, hobbyists, and professionals to create a wide range of projects—from
simple robots to complex scientific instruments. 🚀
IS ARDUINO A MICRO-CONTROLLER OR A MICRO-PROCESSOR?
Arduino is based on a microcontroller, not a microprocessor.

Arduino being a microcontroller:

1. Integrated System: Arduino boards integrate a microcontroller, memory, and I/O interfaces on a
single chip. This compact design simplifies hardware development.

ARDUINO SEMINAR 1
2. Specific Tasks: Microcontrollers are purpose-built for specific tasks, such as reading sensors,
controlling motors, or managing real-time processes.

3. Low Power: Arduino’s microcontrollers are power-efficient, making them suitable for battery-
powered projects.

4. Real-Time Interaction: Arduino emphasizes real-time control, which aligns well with
microcontroller capabilities.

5. Examples: The popular Arduino Uno uses an ATMega328P microcontroller, while other variants
employ different microcontrollers.

TYPES OF ARDUINO
1. Entry-Level Arduino Boards:

Arduino Uno: The most popular choice, powered by an ATMega328P microcontroller. It


offers 14 digital I/O pins (6 with PWM), 6 analog inputs, and communication ports (SPI, I2C,
UART).

Arduino Nano: A compact, breadboard-friendly version of the Uno, suitable for space-
constrained projects.

2. Enhanced Arduino Boards:

Arduino Due: Features a powerful ARM Cortex-M3 SAM3X8E microcontroller, 54 digital I/O
pins, and 12 analog inputs.

Arduino Mega (R3): Offers an extensive 256KB flash memory, 54 digital I/O pins, and 16
analog inputs.

3. IoT Arduino Boards:

Arduino Ethernet: Equipped with an Ethernet controller for network connectivity.

Arduino Bluetooth: Supports wireless communication via Bluetooth.

ARDUINO SIMULATOR
Tinkercad Circuits

[Link]

Wokwi

[Link]

Proteus

[Link]

Fritzing

[Link]

SimulIDE

[Link]

ARDUINO SEMINAR 2
ARDUINO IDE

Donate to Arduino
Open-source electronic prototyping platform enabling users to create interactive
electronic objects.

[Link]

The Arduino Integrated Development Environment (IDE) is a powerful tool for writing and
uploading code to Arduino boards. Here are the key points:

1. Functionality:

Text Editor: The IDE provides a text editor where you write your code.

Message Area: Displays information, warnings, and errors related to your code.

Console: Shows messages during code execution.

Toolbar: Contains buttons for common functions.

Menus: Access various features and settings.

2. Usage:

Write Code: Create your program in the IDE.

Upload to Board: Connect your Arduino board and upload the code to it.

Communication: The IDE communicates with the board for programming and debugging.

The Arduino programming language is a simple and user-friendly version of C++ specifically
designed for programming Arduino microcontroller boards. It provides an easy-to-learn syntax and
a variety of built-in functions, making it accessible for beginners to create Arduino sketches (code
files) and interact with hardware components.

ARDUINO SEMINAR 3
ARDUINO UNO

Digital I/O Pins (0-13):

Purpose: Used for digital input and output. Each pin can be configured as either an input or
an output.

Example: Pin 13 is often used to connect an LED for testing.

Analog Input Pins (A0-A5):

Purpose: Used to read analog signals (0-5V) from sensors.

Example: A potentiometer or temperature sensor can be connected to these pins to read


variable voltages.

PWM Output Pins (3, 5, 6, 9, 10, 11):

ARDUINO SEMINAR 4
Purpose: Digital pins that can output Pulse Width Modulation (PWM) signals, simulating
analog output by varying the duty cycle.

Example: Used to control the brightness of an LED.

Power Pins:

3.3V: Provides 3.3V power supply.

5V: Provides 5V power supply.

GND: Ground connection.

Vin: Provides the input voltage to the Arduino when using an external power source.

Reset Button:

Purpose: Resets the microcontroller, restarting the program.

USB Connection:

Purpose: Connects the Arduino to a computer for programming and serial communication.

ICSP Header:

Purpose: Allows for programming the ATmega328P chip directly, often used for bootloader
programming.

Analog Reference (AREF):

Purpose: Allows you to set an external reference voltage for analog input.

ATmega328 Microcontroller

It is a single-chip microcontroller of the Atmel family. The processor code inside it is 8-bit. It
combines Memory (SRAM, EEPROM, and Flash), Analog-to-Digital Converter, SPI serial ports,
I/O lines, registers, timer, external and internal interrupts, and oscillator.

ICSP Pin

The In-Circuit Serial Programming pin allows the user to program using the firmware of the
Arduino board.

Power LED Indicator

The ON status of the LED shows the power is activated. When the power is OFF, the LED will
not light up.

Digital I/O Pins


The digital pins have the value HIGH or LOW. The pins numbered from D0 to D13 are digital
pins.

TX and RX LEDs

The successful flow of data is represented by the lighting of these LEDs.

AREF
The Analog Reference (AREF) pin is used to feed a reference voltage to the Arduino UNO board
from an external power supply.

Reset Button

It is used to reset the Arduino board.

ARDUINO SEMINAR 5
USB

Allows the board to connect to the computer. It is essential for programming the Arduino UNO
board.

Crystal Oscillator

The Crystal oscillator has a frequency of 16MHz, which makes the Arduino UNO a powerful
board.

Voltage Regulator

The voltage regulator converts the input voltage to 5V.

GND

Ground pins. The ground pin acts as a pin with zero voltage.

Vin

The input voltage.

Analog Pins

The pins numbered from A0 to A5 are analog pins. The function of analog pins is to read the
analog sensor used in the connection. They can also act as GPIO (General Purpose Input
Output) pins.

SAMPLE PROJECT:
SOUNDING ALARM:

#define trigPin 6
#define echoPin 5
#define buzzer 2
float new_delay;

ARDUINO SEMINAR 6
void setup()
{
[Link] (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzer,OUTPUT);

void loop()
{
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
new_delay= (distance *3) +30;
[Link](distance);
[Link](" cm");
if (distance < 50)
{
digitalWrite(buzzer,HIGH);
delay(new_delay);
digitalWrite(buzzer,LOW);

}
else
{
digitalWrite(buzzer,LOW);

delay(200);
}

Definitions

#define trigPin 6
#define echoPin 5
#define buzzer 2

ARDUINO SEMINAR 7
#define : These lines define constants for the pin numbers.

trigPin is the pin connected to the trigger of the ultrasonic sensor.

echoPin is the pin connected to the echo of the ultrasonic sensor.

buzzer is the pin connected to the buzzer.

Global Variables

float new_delay;

: A global variable to store the delay time for the buzzer based on the measured
new_delay

distance.

setup() Function

void setup()
{
[Link](9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzer, OUTPUT);
}

: Initializes serial communication at a bit rate of 9600. This allows you to send
[Link](9600);

data to the Serial Monitor.

pinMode(trigPin, OUTPUT); : Sets trigPin as an output. This pin will be used to send the trigger pulse to
the ultrasonic sensor.

pinMode(echoPin, INPUT); : Sets echoPin as an input. This pin will receive the echo signal from the
ultrasonic sensor.

pinMode(buzzer, OUTPUT); : Sets buzzer as an output. This pin will control the buzzer.

loop() Function

void loop()
{
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
new_delay = (distance * 3) + 30;
[Link](distance);
[Link](" cm");
if (distance < 50)

ARDUINO SEMINAR 8
{
digitalWrite(buzzer, HIGH);
delay(new_delay);
digitalWrite(buzzer, LOW);
}
else
{
digitalWrite(buzzer, LOW);
}

delay(200);
}

long duration, distance; : Declares variables to store the duration of the pulse and the calculated
distance.

digitalWrite(trigPin, LOW); : Sets the trigPin to LOW to ensure it's at a known state before sending a
new pulse.

delayMicroseconds(2); : Waits for 2 microseconds to ensure the pulse timing is correct.

digitalWrite(trigPin, HIGH); : Sets the trigPin to HIGH to send a pulse to the ultrasonic sensor.

delayMicroseconds(10); : Keeps the trigPin HIGH for 10 microseconds to generate a pulse.

digitalWrite(trigPin, LOW); : Sets the trigPin back to LOW to end the pulse.

duration = pulseIn(echoPin, HIGH); : Measures the duration of the echo pulse on the echoPin . The pulseIn

function waits for the pin to go HIGH and then measures how long it stays HIGH.

: Calculates the distance in centimeters. The duration is divided by 2


distance = (duration/2) / 29.1;

because the pulse travels to the object and back, and then divided by 29.1, the speed of sound
in air (cm/µs) to get the distance.

new_delay = (distance * 3) + 30; : Calculates the delay time for the buzzer based on the distance. This
formula can be adjusted depending on how you want the delay to vary with distance.

[Link](distance); : Sends the distance value to the Serial Monitor.

[Link](" cm"); : Sends "cm" to the Serial Monitor to indicate the unit of distance.

if (distance < 50) : Checks if the distance is less than 50 cm.

digitalWrite(buzzer, HIGH); : Turns on the buzzer if the distance is less than 50 cm.

delay(new_delay); : Keeps the buzzer on for the calculated delay time.

digitalWrite(buzzer, LOW); : Turns off the buzzer.

else : If the distance is 50 cm or more:

digitalWrite(buzzer, LOW); : Ensures the buzzer is off.

delay(200); : Waits for 200 milliseconds before the next loop iteration to avoid rapid toggling of
the buzzer.

This code continuously measures the distance from the ultrasonic sensor, calculates the buzzer
delay based on this distance, and activates the buzzer if the object is within 50 cm.

ARDUINO SEMINAR 9
DIFFERENCE BETWEEN ARDUINO AND RASPBERRY PI

ARDUINO SEMINAR 10

You might also like