SlideShare a Scribd company logo
ARDUINO PROGRAMMING
SESSION 1
Presented By
Amarjeetsingh Thakur
9/28/2020 1
What is Arduino?
• Arduino is an open- source computer
hardware and software company, project
and user community that designs and
manufactures microcontroller-based kits for
building systems consisting of digital
devices, interactive objects that can sense
and control in the physical world.
9/28/2020 2
How to program Arduino?
• The Arduino Integrated Development
Environment (IDE) supports
the C and C++ programming languages using
special rules of code organization.
• The Arduino IDE supplies a software library
called "Wiring" from the Wiring project, which
provides many common input and output
procedures.
9/28/2020 3
Arduino Products
9/28/2020 4
Entry Level
9/28/2020 5
Enhanced Features
9/28/2020 6
Official Website:
https://www.arduino.cc/
9/28/2020 7
ARDUINO UNO
9/28/2020 8
Technical specifications:
• Microcontroller: Microchip ATmega328P
• Operating Voltage: 5 Volt
• Input Voltage: 7 to 20 Volts
• Digital I/O Pins: 14 (of which 6 provide PWM output)
• Analog Input Pins: 6
• DC Current per I/O Pin: 20 mA
• DC Current for 3.3V Pin: 50 mA
• Flash Memory: 32 KB of which 0.5 KB used by bootloader
• SRAM: 2 KB
• EEPROM: 1 KB
• Clock Speed: 16 MHz
• Length: 68.6 mm
• Width: 53.4 mm
• Weight: 25 g
9/28/2020 9
Program Structure
Setup( )
{
// A function that runs once at the start of a program and is used to
set //pinMode or initialize serial communication
}
loop( )
{
// This function includes the code to be executed continuously – reading
inputs, //triggering outputs, etc.
// This function is the core of all Arduino programs and does the bulk of
the //work.
}
9/28/2020 10
Activity 1.1
Type : Team of 2 Duration : 15 Minutes
Use LED blink program from example
and upload it on the ARDUINO board
9/28/2020 11
Functions to handle digital I/O
• pinMode (pin, OUTPUT);
// make the digital pin either INPUT or OUTPUT
• digitalRead (pin);
//used to get the content on the pin which is HIGH(1)
or LOW(0)
• digitalWrite(pin, value)
//used to send HIGH(1) or LOW(0) value to a pin
9/28/2020 12
Time Function
• delay(ms)
// waits for milli – seconds
9/28/2020 13
/*….. Program to blink the LED on pin 13 …..*/
void setup( )
{
pinMode(13, OUTPUT); //Initialize the digital pin as output
}
void loop( )
{
digitalWrite(13, HIGH); // Turn the LED ON
delay(1000); // Wait for one second
digitalWrite(13, LOW); // Turn the LED OFF
delay(1000); // Wait for one second
}
9/28/2020 14
Activity 1.2
Type : Team of 2 Duration : 10 Minutes
Modify the program to blink LED every 2 sec
on pin 12.
9/28/2020 15
Circuit for the LED
Cathode of
LED
Anode of LED
9/28/2020 16
/*….. Program to blink the LED every 2 second on pin12*/
void setup( )
{
pinMode(12, OUTPUT); //Initialize the digital pin as output
}
void loop( )
{
digitalWrite(12, HIGH); // Turn the LED ON
delay(2000); // Wait for a two second
digitalWrite(12, LOW); // Turn the LED OFF
delay(2000); // Wait for a two second
}
9/28/2020 17
Activity 1.3
Type : Team of 2 Duration : 15 Minutes
Modify the program to display the LED state
every 2 sec on Serial Monitor.
9/28/2020 18
Serial communication with Arduino
What is serial communication ?
9/28/2020 19
The word serial means "one after the other."
• What is Baud rate ?
Number of symbols transferred per sec
9/28/2020 20
Serial Display Functions
• Serial.begin(baud_rate)
//baud rate(characters per sec) between computer
and board is typically 9600 although you can
work with other speeds by changing settings of
COM Port
• Serial.print(value),
//value could be any data and even string
• Serial.println(value)
//print in new line
9/28/2020 21
Eg. Print INDIA on serial monitor
void setup( )
{
Serial.begin(9600);// 9600 is default baud rate of
serial com port of a computer
}
void loop( )
{
Serial.println(“INDIA”); // Send the value “INDIA”
}
9/28/2020 22
Serial Monitor
9/28/2020 23
/*….. Modify the program to blink on pin12 and display the LED state every 2 sec
on Serial Monitor…..*/
void setup( )
{
pinMode(12, OUTPUT); //Initialize the digital pin as output
Serial.begin(9600);
}
void loop( )
{
digitalWrite(12, HIGH); // Turn the LED ON
Serial.println(“ON”); // Send the value “ON”
delay(2000); // Wait for a second
digitalWrite(12, LOW); // Turn the LED OFF
Serial.println(“OFF”); // Send the value “OFF”
delay(2000); // Wait for a second
}
9/28/2020 24
Activity 1.4
Type : Team of 2 Duration : 25 Minutes
Modify the program to blink 10 times per
loop iteration and display no. of loop
iterations on serial monitor.
9/28/2020 25
Looping Concept
//for loop concept
Syntax –
for(initialization ; condition; increment / decrement)
{
//code which you want to perform
}
Example : to print number from 1 to 10
for(int i=1;i<=10;i++)
{
Serial.println(i);
Serial.println(“INDIA”);
}
9/28/2020 26
long int Count=0;
void setup( )
{
pinMode(12, OUTPUT); //Initialize the digital pin as output
Serial.begin(9600);
Serial.println(“count of iterations running are: “);
}
void loop( )
{
for (int i=1;i<=10;i++)
{
Serial.println(i);
digitalWrite(12, HIGH);
Serial.println(“ON”);
delay(1000); // wait for a second
digitalWrite(12, LOW);
– Serial.println(“OFF”);
delay(1000); // wait for a second
}
Count++;
– Serial.print(“Iteration:”);
Serial.println(Count);
}9/28/2020 27
Condition Statements
if(Condition 1)
{
//Statements
}
if(Condition 2)
{
//Statements
}
else
{
//Statements
}
9/28/2020 28
Topic Learning Outcomes
At the end of the topic the student should be able to
1. Explain the importance of platform based development
2. Use looping, delay and conditioning concepts in developing a
program on Arduino environment.
9/28/2020 29

More Related Content

What's hot (20)

Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
Jawaher Abdulwahab Fadhil
 
Analog to Digital converter in ARM
Analog to Digital converter in ARMAnalog to Digital converter in ARM
Analog to Digital converter in ARM
Aarav Soni
 
Serial Communication Interfaces
Serial Communication InterfacesSerial Communication Interfaces
Serial Communication Interfaces
anishgoel
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
Emmanuel Obot
 
Distance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic SensorDistance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic Sensor
Edgefxkits & Solutions
 
TMS320C5x
TMS320C5xTMS320C5x
TMS320C5x
DeekshithaReddy23
 
Rs232 485 fundamental
Rs232 485 fundamentalRs232 485 fundamental
Rs232 485 fundamental
rounak077
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
soma saikiran
 
Uart
UartUart
Uart
Aditee Apurvaa
 
Presentation on router
Presentation on routerPresentation on router
Presentation on router
Iqra university islamabad
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
anishgoel
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)
Dhaval Kaneria
 
Rs232 protocal
Rs232 protocalRs232 protocal
Rs232 protocal
Dhaka International University
 
RADAR SYSTEM
RADAR SYSTEMRADAR SYSTEM
RADAR SYSTEM
VikashKumar1509
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Bluetooth Controlled Robot Project Report
Bluetooth Controlled Robot Project ReportBluetooth Controlled Robot Project Report
Bluetooth Controlled Robot Project Report
Simarjot Singh Kalsi
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
Eueung Mulyana
 
Raspberry Pi
Raspberry Pi Raspberry Pi
Raspberry Pi
Selvaraj Seerangan
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
creatjet3d labs
 

Similar to Arduino programming part1 (20)

Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Introduction To Arduino-converted for s.pptx
Introduction To Arduino-converted for s.pptxIntroduction To Arduino-converted for s.pptx
Introduction To Arduino-converted for s.pptx
rtnmsn
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
Mujahid Hussain
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
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
 
Arduino reference
Arduino referenceArduino reference
Arduino reference
Marcos Henrique
 
01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt
pindi2197
 
Fundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.pptFundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.ppt
ansariparveen06
 
Arduino is an open-source electronics platform that has an easy-to-use physic...
Arduino is an open-source electronics platform that has an easy-to-use physic...Arduino is an open-source electronics platform that has an easy-to-use physic...
Arduino is an open-source electronics platform that has an easy-to-use physic...
ssuseraa8a48
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
rajalakshmi769433
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
Yogendra Tamang
 
Arduino wk2
Arduino wk2Arduino wk2
Arduino wk2
Meriem Jaoued
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
The IOT Academy
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
James Lewis
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
Syed Mustafa
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
SAURABHKUMAR892774
 
Arduino . .
Arduino             .                             .Arduino             .                             .
Arduino . .
dryazhinians
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Arduino-2 (1).ppt
Arduino-2 (1).pptArduino-2 (1).ppt
Arduino-2 (1).ppt
HebaEng
 
Introduction To Arduino-converted for s.pptx
Introduction To Arduino-converted for s.pptxIntroduction To Arduino-converted for s.pptx
Introduction To Arduino-converted for s.pptx
rtnmsn
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
Mujahid Hussain
 
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
 
01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt
pindi2197
 
Fundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.pptFundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.ppt
ansariparveen06
 
Arduino is an open-source electronics platform that has an easy-to-use physic...
Arduino is an open-source electronics platform that has an easy-to-use physic...Arduino is an open-source electronics platform that has an easy-to-use physic...
Arduino is an open-source electronics platform that has an easy-to-use physic...
ssuseraa8a48
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
Yogendra Tamang
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
The IOT Academy
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
James Lewis
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
Syed Mustafa
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
SAURABHKUMAR892774
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Arduino-2 (1).ppt
Arduino-2 (1).pptArduino-2 (1).ppt
Arduino-2 (1).ppt
HebaEng
 
Ad

More from Amarjeetsingh Thakur (19)

“Introduction to MATLAB & SIMULINK”
“Introduction to MATLAB  & SIMULINK”“Introduction to MATLAB  & SIMULINK”
“Introduction to MATLAB & SIMULINK”
Amarjeetsingh Thakur
 
Python code for servo control using Raspberry Pi
Python code for servo control using Raspberry PiPython code for servo control using Raspberry Pi
Python code for servo control using Raspberry Pi
Amarjeetsingh Thakur
 
Python code for Push button using Raspberry Pi
Python code for Push button using Raspberry PiPython code for Push button using Raspberry Pi
Python code for Push button using Raspberry Pi
Amarjeetsingh Thakur
 
Python code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry PiPython code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry Pi
Amarjeetsingh Thakur
 
Arduino programming part 2
Arduino programming part 2Arduino programming part 2
Arduino programming part 2
Amarjeetsingh Thakur
 
Python openCV codes
Python openCV codesPython openCV codes
Python openCV codes
Amarjeetsingh Thakur
 
Python Numpy Source Codes
Python Numpy Source CodesPython Numpy Source Codes
Python Numpy Source Codes
Amarjeetsingh Thakur
 
Steemit html blog
Steemit html blogSteemit html blog
Steemit html blog
Amarjeetsingh Thakur
 
Python OpenCV Real Time projects
Python OpenCV Real Time projectsPython OpenCV Real Time projects
Python OpenCV Real Time projects
Amarjeetsingh Thakur
 
Adafruit_IoT_Platform
Adafruit_IoT_PlatformAdafruit_IoT_Platform
Adafruit_IoT_Platform
Amarjeetsingh Thakur
 
Core python programming tutorial
Core python programming tutorialCore python programming tutorial
Core python programming tutorial
Amarjeetsingh Thakur
 
Python openpyxl
Python openpyxlPython openpyxl
Python openpyxl
Amarjeetsingh Thakur
 
Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)
Amarjeetsingh Thakur
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
Amarjeetsingh Thakur
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)
Amarjeetsingh Thakur
 
Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)
Amarjeetsingh Thakur
 
Arduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motorArduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motor
Amarjeetsingh Thakur
 
Image processing in MATLAB
Image processing in MATLABImage processing in MATLAB
Image processing in MATLAB
Amarjeetsingh Thakur
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
Amarjeetsingh Thakur
 
“Introduction to MATLAB & SIMULINK”
“Introduction to MATLAB  & SIMULINK”“Introduction to MATLAB  & SIMULINK”
“Introduction to MATLAB & SIMULINK”
Amarjeetsingh Thakur
 
Python code for servo control using Raspberry Pi
Python code for servo control using Raspberry PiPython code for servo control using Raspberry Pi
Python code for servo control using Raspberry Pi
Amarjeetsingh Thakur
 
Python code for Push button using Raspberry Pi
Python code for Push button using Raspberry PiPython code for Push button using Raspberry Pi
Python code for Push button using Raspberry Pi
Amarjeetsingh Thakur
 
Python code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry PiPython code for Buzzer Control using Raspberry Pi
Python code for Buzzer Control using Raspberry Pi
Amarjeetsingh Thakur
 
Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)
Amarjeetsingh Thakur
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)
Amarjeetsingh Thakur
 
Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)
Amarjeetsingh Thakur
 
Arduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motorArduino Interfacing with different sensors and motor
Arduino Interfacing with different sensors and motor
Amarjeetsingh Thakur
 
Ad

Recently uploaded (20)

362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
Semi-Conductor ppt ShubhamSeSemi-Con.pptx
Semi-Conductor ppt ShubhamSeSemi-Con.pptxSemi-Conductor ppt ShubhamSeSemi-Con.pptx
Semi-Conductor ppt ShubhamSeSemi-Con.pptx
studyshubham18
 
Pavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible PavementsPavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible Pavements
Sakthivel M
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbbTree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)
pelumiadigun2006
 
New Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docxNew Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docx
misheetasah
 
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
SharinAbGhani1
 
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
ijfcstjournal
 
ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025
Rahul
 
Research_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptxResearch_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptx
niranjancse
 
IntroSlides-June-GDG-Cloud-Munich community [email protected]
IntroSlides-June-GDG-Cloud-Munich community gathering@Netlight.pdfIntroSlides-June-GDG-Cloud-Munich community gathering@Netlight.pdf
IntroSlides-June-GDG-Cloud-Munich community [email protected]
Luiz Carneiro
 
May 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information TechnologyMay 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
Third Review PPT that consists of the project d etails like abstract.
Third Review PPT that consists of the project d etails like abstract.Third Review PPT that consists of the project d etails like abstract.
Third Review PPT that consists of the project d etails like abstract.
Sowndarya6
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
chemistry investigatory project for class 12
chemistry investigatory project for class 12chemistry investigatory project for class 12
chemistry investigatory project for class 12
Susis10
 
The first edition of the AIAG-VDA FMEA.pptx
The first edition of the AIAG-VDA FMEA.pptxThe first edition of the AIAG-VDA FMEA.pptx
The first edition of the AIAG-VDA FMEA.pptx
Mayank Mathur
 
Computer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdfComputer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdf
kumarprem6767merp
 
fHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghj
fHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghjfHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghj
fHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghj
yadavshivank2006
 
Introduction to AI agent development with MCP
Introduction to AI agent development with MCPIntroduction to AI agent development with MCP
Introduction to AI agent development with MCP
Dori Waldman
 
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptxWeek 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
dayananda54
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
Semi-Conductor ppt ShubhamSeSemi-Con.pptx
Semi-Conductor ppt ShubhamSeSemi-Con.pptxSemi-Conductor ppt ShubhamSeSemi-Con.pptx
Semi-Conductor ppt ShubhamSeSemi-Con.pptx
studyshubham18
 
Pavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible PavementsPavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible Pavements
Sakthivel M
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbbTree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)
pelumiadigun2006
 
New Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docxNew Microsoft Office Word Documentfrf.docx
New Microsoft Office Word Documentfrf.docx
misheetasah
 
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
02 - Ethics & Professionalism - BEM, IEM, MySET.PPT
SharinAbGhani1
 
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
A DECISION SUPPORT SYSTEM FOR ESTIMATING COST OF SOFTWARE PROJECTS USING A HY...
ijfcstjournal
 
ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025
Rahul
 
Research_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptxResearch_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptx
niranjancse
 
May 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information TechnologyMay 2025: Top 10 Read Articles Advanced Information Technology
May 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
Third Review PPT that consists of the project d etails like abstract.
Third Review PPT that consists of the project d etails like abstract.Third Review PPT that consists of the project d etails like abstract.
Third Review PPT that consists of the project d etails like abstract.
Sowndarya6
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
chemistry investigatory project for class 12
chemistry investigatory project for class 12chemistry investigatory project for class 12
chemistry investigatory project for class 12
Susis10
 
The first edition of the AIAG-VDA FMEA.pptx
The first edition of the AIAG-VDA FMEA.pptxThe first edition of the AIAG-VDA FMEA.pptx
The first edition of the AIAG-VDA FMEA.pptx
Mayank Mathur
 
Computer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdfComputer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdf
kumarprem6767merp
 
fHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghj
fHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghjfHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghj
fHUINhKG5lM1WBBk608.pptxfhjjhhjffhiuhhghj
yadavshivank2006
 
Introduction to AI agent development with MCP
Introduction to AI agent development with MCPIntroduction to AI agent development with MCP
Introduction to AI agent development with MCP
Dori Waldman
 
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptxWeek 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
dayananda54
 

Arduino programming part1

  • 1. ARDUINO PROGRAMMING SESSION 1 Presented By Amarjeetsingh Thakur 9/28/2020 1
  • 2. What is Arduino? • Arduino is an open- source computer hardware and software company, project and user community that designs and manufactures microcontroller-based kits for building systems consisting of digital devices, interactive objects that can sense and control in the physical world. 9/28/2020 2
  • 3. How to program Arduino? • The Arduino Integrated Development Environment (IDE) supports the C and C++ programming languages using special rules of code organization. • The Arduino IDE supplies a software library called "Wiring" from the Wiring project, which provides many common input and output procedures. 9/28/2020 3
  • 9. Technical specifications: • Microcontroller: Microchip ATmega328P • Operating Voltage: 5 Volt • Input Voltage: 7 to 20 Volts • Digital I/O Pins: 14 (of which 6 provide PWM output) • Analog Input Pins: 6 • DC Current per I/O Pin: 20 mA • DC Current for 3.3V Pin: 50 mA • Flash Memory: 32 KB of which 0.5 KB used by bootloader • SRAM: 2 KB • EEPROM: 1 KB • Clock Speed: 16 MHz • Length: 68.6 mm • Width: 53.4 mm • Weight: 25 g 9/28/2020 9
  • 10. Program Structure Setup( ) { // A function that runs once at the start of a program and is used to set //pinMode or initialize serial communication } loop( ) { // This function includes the code to be executed continuously – reading inputs, //triggering outputs, etc. // This function is the core of all Arduino programs and does the bulk of the //work. } 9/28/2020 10
  • 11. Activity 1.1 Type : Team of 2 Duration : 15 Minutes Use LED blink program from example and upload it on the ARDUINO board 9/28/2020 11
  • 12. Functions to handle digital I/O • pinMode (pin, OUTPUT); // make the digital pin either INPUT or OUTPUT • digitalRead (pin); //used to get the content on the pin which is HIGH(1) or LOW(0) • digitalWrite(pin, value) //used to send HIGH(1) or LOW(0) value to a pin 9/28/2020 12
  • 13. Time Function • delay(ms) // waits for milli – seconds 9/28/2020 13
  • 14. /*….. Program to blink the LED on pin 13 …..*/ void setup( ) { pinMode(13, OUTPUT); //Initialize the digital pin as output } void loop( ) { digitalWrite(13, HIGH); // Turn the LED ON delay(1000); // Wait for one second digitalWrite(13, LOW); // Turn the LED OFF delay(1000); // Wait for one second } 9/28/2020 14
  • 15. Activity 1.2 Type : Team of 2 Duration : 10 Minutes Modify the program to blink LED every 2 sec on pin 12. 9/28/2020 15
  • 16. Circuit for the LED Cathode of LED Anode of LED 9/28/2020 16
  • 17. /*….. Program to blink the LED every 2 second on pin12*/ void setup( ) { pinMode(12, OUTPUT); //Initialize the digital pin as output } void loop( ) { digitalWrite(12, HIGH); // Turn the LED ON delay(2000); // Wait for a two second digitalWrite(12, LOW); // Turn the LED OFF delay(2000); // Wait for a two second } 9/28/2020 17
  • 18. Activity 1.3 Type : Team of 2 Duration : 15 Minutes Modify the program to display the LED state every 2 sec on Serial Monitor. 9/28/2020 18
  • 19. Serial communication with Arduino What is serial communication ? 9/28/2020 19
  • 20. The word serial means "one after the other." • What is Baud rate ? Number of symbols transferred per sec 9/28/2020 20
  • 21. Serial Display Functions • Serial.begin(baud_rate) //baud rate(characters per sec) between computer and board is typically 9600 although you can work with other speeds by changing settings of COM Port • Serial.print(value), //value could be any data and even string • Serial.println(value) //print in new line 9/28/2020 21
  • 22. Eg. Print INDIA on serial monitor void setup( ) { Serial.begin(9600);// 9600 is default baud rate of serial com port of a computer } void loop( ) { Serial.println(“INDIA”); // Send the value “INDIA” } 9/28/2020 22
  • 24. /*….. Modify the program to blink on pin12 and display the LED state every 2 sec on Serial Monitor…..*/ void setup( ) { pinMode(12, OUTPUT); //Initialize the digital pin as output Serial.begin(9600); } void loop( ) { digitalWrite(12, HIGH); // Turn the LED ON Serial.println(“ON”); // Send the value “ON” delay(2000); // Wait for a second digitalWrite(12, LOW); // Turn the LED OFF Serial.println(“OFF”); // Send the value “OFF” delay(2000); // Wait for a second } 9/28/2020 24
  • 25. Activity 1.4 Type : Team of 2 Duration : 25 Minutes Modify the program to blink 10 times per loop iteration and display no. of loop iterations on serial monitor. 9/28/2020 25
  • 26. Looping Concept //for loop concept Syntax – for(initialization ; condition; increment / decrement) { //code which you want to perform } Example : to print number from 1 to 10 for(int i=1;i<=10;i++) { Serial.println(i); Serial.println(“INDIA”); } 9/28/2020 26
  • 27. long int Count=0; void setup( ) { pinMode(12, OUTPUT); //Initialize the digital pin as output Serial.begin(9600); Serial.println(“count of iterations running are: “); } void loop( ) { for (int i=1;i<=10;i++) { Serial.println(i); digitalWrite(12, HIGH); Serial.println(“ON”); delay(1000); // wait for a second digitalWrite(12, LOW); – Serial.println(“OFF”); delay(1000); // wait for a second } Count++; – Serial.print(“Iteration:”); Serial.println(Count); }9/28/2020 27
  • 28. Condition Statements if(Condition 1) { //Statements } if(Condition 2) { //Statements } else { //Statements } 9/28/2020 28
  • 29. Topic Learning Outcomes At the end of the topic the student should be able to 1. Explain the importance of platform based development 2. Use looping, delay and conditioning concepts in developing a program on Arduino environment. 9/28/2020 29