SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
What is Arduino
• A microcontroller board, contains on-board
power supply, usb port to communicate with
pc and an Atmel microcontroller chip.
• It simplify the proces of creating any control
system by providing the standard board that
can be programmed and connected to the
system without the need to any sophisticated
PCB design.
• An OPEN-SOURCE hardware.
Some Arduino boards
Arduino philosophy is to learn by practicing so…
Let’s do what Arduino wants…
Ultrasonic sensor
It is a sensor that work on a principle similar
to radar, which evaulate attributes of a target
by interpreting the echoes from radio or
sound waves respectively.
A simple circuit using this sensor…
Using the code below we can read from Arduino
the distance of different objects
• int echo=9;
• int trig= 10;
• int distance;
void setup()
• {
• Serial.begin (9600);
• pinMode (echo,INPUT);
• pinMode (trig, OUTPUT);
• }
void loop ()
• {
• digitalWrite (trig, LOW);
• delay (2);
• digitalWrite (trig, HIGH);
• delay (2);
• digitalWrite (trig, LOW);
• distance=pulseIn (echo,HIGH);
• distance=distance/58;
•
• Serial.println(distance);
• }
Now that we all know how ultrasonic sensor
works, let’s add a buzzer and modify the code
• int echo=9;
• int trig= 10;
• int distance;
• int buzz= 8;
void setup ()
• {
• Serial.begin (9600);
• pinMode (echo,INPUT);
• pinMode (trig, OUTPUT);
• pinMode ( buzz, OUTPUT);
• }
Void loop ()
• void loop ()
• {
• digitalWrite (trig, LOW);
• delay (2);
• digitalWrite (trig, HIGH);
• delay (2);
• digitalWrite (trig, LOW);
• distance=pulseIn (echo,HIGH);
• distance=distance/58;
• if (distance < 7)
•
• digitalWrite (buzz, HIGH);
• else
• digitalWrite (buzz, LOW );
•
• Serial.println(distance);
• }
Let’s try something else that is called :
Double – Touch Sensor.
You know what comes next:
The Code…
• #include <CapacitiveSensor.h>
• CapacitiveSensor capSensor =
CapacitiveSensor(4,2);
• boolean ledstate=LOW;
• int sensorValue;
• int sensor;
• const int ledPin = 8;
• void setup() {
• Serial.begin(9600);
• pinMode(ledPin, OUTPUT);
• }
• void loop() {
• sensorValue = capSensor.capacitiveSensor(30);
• if(sensorValue > 0) {
• ledstate =!ledstate;
• }
• Serial.println(sensorValue);
•
• digitalWrite(ledPin,ledstate);
• delay(500);
• }
And for desert…
Let’s transform all this to an alarm system
using: Arduino, an ultrasonic sensor, a buzzer
and a rgb led.
• #define TRIGPIN 10
• #define ECHOPIN 9
• int buzz=8;
• int red=7,green=6,blue=5;
void setup ()
• {
• Serial.begin(9600);
• pinMode(ECHOPIN,INPUT);
• pinMode(TRIGPIN,OUTPUT);
• pinMode (buzz,OUTPUT);
• pinMode (red,OUTPUT);
• pinMode (green,OUTPUT);
• pinMode (blue, OUTPUT);
• }
void loop ()
• {
• digitalWrite (buzz,LOW);
• digitalWrite (red,LOW);
• digitalWrite (green,LOW);
• digitalWrite (blue,LOW);
• digitalWrite(TRIGPIN,LOW);
• delayMicroseconds(2);
• digitalWrite(TRIGPIN,HIGH);
• delayMicroseconds(2);
• digitalWrite(TRIGPIN,LOW);
• int distance=pulseIn(ECHOPIN,HIGH);
• distance=distance/58;
• if (distance>20)
• { digitalWrite (green,HIGH);
• digitalWrite (buzz,LOW);
• }
• else if (distance>10 && distance<20)
• {
• digitalWrite (green, LOW);
• digitalWrite ( blue,HIGH);
• digitalWrite (buzz,LOW);
• }
• else if ( distance>0 && distance <10 )
• {
• digitalWrite (green, LOW);
• digitalWrite (blue,LOW);
• digitalWrite (red, HIGH);
• digitalWrite (buzz,HIGH);
• }
•
• Serial.println (distance);
• delay(100);
• }

Mais conteúdo relacionado

Mais procurados

Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Embedded c & working with avr studio
Embedded c & working with avr studioEmbedded c & working with avr studio
Embedded c & working with avr studio
Nitesh Singh
 

Mais procurados (20)

Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
 
Ardui no
Ardui no Ardui no
Ardui no
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Electronics Microcontrollers for IoT applications
Electronics Microcontrollers for IoT applicationsElectronics Microcontrollers for IoT applications
Electronics Microcontrollers for IoT applications
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
 
Embedded systems ppt
Embedded systems pptEmbedded systems ppt
Embedded systems ppt
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
 
1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systems
 
Emerging Technologies - Neuromorphic Engineering / Computing
Emerging Technologies - Neuromorphic Engineering / ComputingEmerging Technologies - Neuromorphic Engineering / Computing
Emerging Technologies - Neuromorphic Engineering / Computing
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino
ArduinoArduino
Arduino
 
Embedded c & working with avr studio
Embedded c & working with avr studioEmbedded c & working with avr studio
Embedded c & working with avr studio
 
System-on-Chip Design, Embedded System Design Challenges
System-on-Chip Design, Embedded System Design ChallengesSystem-on-Chip Design, Embedded System Design Challenges
System-on-Chip Design, Embedded System Design Challenges
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 

Semelhante a Arduino

Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduino
Sravanthi Sinha
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
ethannguyen1618
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
ssusere5db05
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
Jayanthi Kannan MK
 

Semelhante a Arduino (20)

Arduino Programming
Arduino ProgrammingArduino Programming
Arduino Programming
 
Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduino
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
LinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentLinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrument
 
Introduction to Arduino Webinar
Introduction to Arduino WebinarIntroduction to Arduino Webinar
Introduction to Arduino Webinar
 
arduino.ppt
arduino.pptarduino.ppt
arduino.ppt
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Arduino course
Arduino courseArduino course
Arduino course
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
Simply arduino
Simply arduinoSimply arduino
Simply arduino
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Arduino.pptx
Arduino.pptxArduino.pptx
Arduino.pptx
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
 

Último

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Arduino

  • 1. What is Arduino • A microcontroller board, contains on-board power supply, usb port to communicate with pc and an Atmel microcontroller chip. • It simplify the proces of creating any control system by providing the standard board that can be programmed and connected to the system without the need to any sophisticated PCB design. • An OPEN-SOURCE hardware.
  • 3.
  • 4. Arduino philosophy is to learn by practicing so… Let’s do what Arduino wants…
  • 5. Ultrasonic sensor It is a sensor that work on a principle similar to radar, which evaulate attributes of a target by interpreting the echoes from radio or sound waves respectively.
  • 6.
  • 7. A simple circuit using this sensor…
  • 8. Using the code below we can read from Arduino the distance of different objects • int echo=9; • int trig= 10; • int distance;
  • 9. void setup() • { • Serial.begin (9600); • pinMode (echo,INPUT); • pinMode (trig, OUTPUT); • }
  • 10. void loop () • { • digitalWrite (trig, LOW); • delay (2); • digitalWrite (trig, HIGH); • delay (2); • digitalWrite (trig, LOW); • distance=pulseIn (echo,HIGH); • distance=distance/58; • • Serial.println(distance); • }
  • 11. Now that we all know how ultrasonic sensor works, let’s add a buzzer and modify the code
  • 12. • int echo=9; • int trig= 10; • int distance; • int buzz= 8;
  • 13. void setup () • { • Serial.begin (9600); • pinMode (echo,INPUT); • pinMode (trig, OUTPUT); • pinMode ( buzz, OUTPUT); • }
  • 14. Void loop () • void loop () • { • digitalWrite (trig, LOW); • delay (2); • digitalWrite (trig, HIGH); • delay (2); • digitalWrite (trig, LOW); • distance=pulseIn (echo,HIGH); • distance=distance/58; • if (distance < 7) •
  • 15. • digitalWrite (buzz, HIGH); • else • digitalWrite (buzz, LOW ); • • Serial.println(distance); • }
  • 16. Let’s try something else that is called : Double – Touch Sensor.
  • 17.
  • 18. You know what comes next: The Code… • #include <CapacitiveSensor.h> • CapacitiveSensor capSensor = CapacitiveSensor(4,2); • boolean ledstate=LOW; • int sensorValue; • int sensor; • const int ledPin = 8;
  • 19. • void setup() { • Serial.begin(9600); • pinMode(ledPin, OUTPUT); • } • void loop() { • sensorValue = capSensor.capacitiveSensor(30); • if(sensorValue > 0) { • ledstate =!ledstate; • } • Serial.println(sensorValue); • • digitalWrite(ledPin,ledstate); • delay(500); • }
  • 20. And for desert… Let’s transform all this to an alarm system using: Arduino, an ultrasonic sensor, a buzzer and a rgb led.
  • 21.
  • 22. • #define TRIGPIN 10 • #define ECHOPIN 9 • int buzz=8; • int red=7,green=6,blue=5;
  • 23. void setup () • { • Serial.begin(9600); • pinMode(ECHOPIN,INPUT); • pinMode(TRIGPIN,OUTPUT); • pinMode (buzz,OUTPUT); • pinMode (red,OUTPUT); • pinMode (green,OUTPUT); • pinMode (blue, OUTPUT); • }
  • 24. void loop () • { • digitalWrite (buzz,LOW); • digitalWrite (red,LOW); • digitalWrite (green,LOW); • digitalWrite (blue,LOW); • digitalWrite(TRIGPIN,LOW); • delayMicroseconds(2); • digitalWrite(TRIGPIN,HIGH); • delayMicroseconds(2); • digitalWrite(TRIGPIN,LOW);
  • 25. • int distance=pulseIn(ECHOPIN,HIGH); • distance=distance/58; • if (distance>20) • { digitalWrite (green,HIGH); • digitalWrite (buzz,LOW); • } • else if (distance>10 && distance<20) • { • digitalWrite (green, LOW); • digitalWrite ( blue,HIGH); • digitalWrite (buzz,LOW); • }
  • 26. • else if ( distance>0 && distance <10 ) • { • digitalWrite (green, LOW); • digitalWrite (blue,LOW); • digitalWrite (red, HIGH); • digitalWrite (buzz,HIGH); • } • • Serial.println (distance); • delay(100); • }