SlideShare a Scribd company logo
1 of 24
Download to read offline
ARDUINO PROGRAMMING
SESSION 2
1
Presented By
Amarjeetsingh Thakur
9/28/2020
What is the principle behind variable
output voltage?
PWM Concept
29/28/2020
What is PWM(Pulse width Modulation)?
39/28/2020
PWM power control
49/28/2020
Fan example
You can run the fan at
different speeds
How do you make the choice
of speed?
Table fan button
59/28/2020
Keypad Module
69/28/2020
Keypad Program
79/28/2020
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 4;
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 2};
89/28/2020
Contd..
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins,
ROWS, COLS);
void setup(){
Serial.begin(9600);
}
void loop(){
char customKey = customKeypad.getKey();
if (customKey){
Serial.println(customKey);
}
}
99/28/2020
SENSORS
What is a sensor?
“A sensor is an object whose purpose is to detect events
or changes in its environment, and then provide a
corresponding output”.
Why do we need sensor?
• A sensor is the guy who provides data to the a system
via its input.
• We need sensor to feed data to the system and tells
the controller when to take action
109/28/2020
Most used sensors for Arduino
1. Temperature + Humidity Sensor
This is a temperature/humidity sensor. It
monitors the ambient temperature or
humidity.
119/28/2020
2. IR Sensor:
• This is a multipurpose infrared sensor which can
be used for color detection.The sensor provides a
digital as well as analog output. An on board LED
is used to indicate the presence of an object. This
digital output can be directly connected to an
Arduino, Raspberry Pi or any other
microcontroller to read the sensor output.
129/28/2020
IR sensor Program
139/28/2020
//IR sensor with digital input at pin no. 2
const int IR_Sensor=2;
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED on Arduino boards:
pinMode(13, OUTPUT);
//Pin 2 is connected to the output of IR_Sensor
pinMode(IR_Sensor,INPUT);
}
void loop() {
if(digitalRead(IR_Sensor)==HIGH) //Check the sensor output
{
149/28/2020
digitalWrite(13, HIGH); // set the LED on
}
else
{
digitalWrite(13, LOW); // set the LED off
}
delay(1000); // wait for a second
}
Contd..
159/28/2020
Do you remember which actuator was used in
this Access gate?
Stepper Motor
169/28/2020
Working principle
179/28/2020
• Stepper motors are called as Digital motor
– It takes digital input to move by a step.
• Stepper motor is specified by step angle of say
200 steps per revolution
– 1.8 degree per step
189/28/2020
• To move a step we need to provide a digital
input sequence to windings.
• The sequence for bipolar/unipolar is
1000 // 1st step
0100 // 2nd step
0010 // 3rd step
0001 // 4th step
1000 // repeat of sequence for 5th step
199/28/2020
Activity 2.1
Type : Team of 2 Duration : 30 Minutes
Write a program to run stepper motor in
clockwise direction
209/28/2020
Stepper Motor Speed Control
219/28/2020
/*
Stepper Motor Control - one revolution
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
The motor should revolve one revolution in one direction, then
one revolution in the other direction.
*/
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per
revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
229/28/2020
Contd..
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);//Without delay stepper motor will rotate continuosly
}
239/28/2020
Topic Learning Outcomes
At the end of the topic you should be able to:
1. Interface a sensor/s, device/s with Arduino
for data acquisition and display the data.
2. Interface Actuators with Arduino to Control
motion to build an application.
3. Build a mechatronic system using Arduino,
sensors, actuators and modules.
249/28/2020

More Related Content

What's hot

Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming FamiliarizationAmit Kumer Podder
 
Robotics camp'17 part2
Robotics camp'17 part2Robotics camp'17 part2
Robotics camp'17 part2Mohamed Okasha
 
2D Plotter Presentation
2D Plotter Presentation2D Plotter Presentation
2D Plotter PresentationMahmoud Kandil
 
Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Satoru Tokuhisa
 
Iaetsd vlsi based implementation of a digital
Iaetsd vlsi based implementation of a digitalIaetsd vlsi based implementation of a digital
Iaetsd vlsi based implementation of a digitalIaetsd Iaetsd
 
Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...
Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...
Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...Sayan Seth
 
Easy GPS Tracker using Arduino and Python
Easy GPS Tracker using Arduino and PythonEasy GPS Tracker using Arduino and Python
Easy GPS Tracker using Arduino and PythonNúria Vilanova
 
Embedded systems الانظمة المدمجة
Embedded systems  الانظمة المدمجة Embedded systems  الانظمة المدمجة
Embedded systems الانظمة المدمجة salih mahmod
 
Research and Prototyping Ground Robot Platform
Research and Prototyping Ground Robot PlatformResearch and Prototyping Ground Robot Platform
Research and Prototyping Ground Robot Platformcharlesk
 
DIgital clock using verilog
DIgital clock using verilog DIgital clock using verilog
DIgital clock using verilog Abhishek Sainkar
 
CNC plotter controlled using Android application
CNC plotter controlled using Android applicationCNC plotter controlled using Android application
CNC plotter controlled using Android applicationYuval Yoskovits
 
Controller Implementation in Verilog
Controller Implementation in VerilogController Implementation in Verilog
Controller Implementation in VerilogAnees Akhtar
 
Embedded Systems & Robotics
Embedded Systems  & RoboticsEmbedded Systems  & Robotics
Embedded Systems & Roboticsspoorani
 
Arduino Microcontroller
Arduino Microcontroller Arduino Microcontroller
Arduino Microcontroller creatjet3d labs
 
Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...
Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...
Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...Dien Ha The
 
WCAN mini ActionScript Vol.4
WCAN mini ActionScript Vol.4WCAN mini ActionScript Vol.4
WCAN mini ActionScript Vol.4Shigeru Kobayashi
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 

What's hot (20)

2009 11-17-arduino-basics
2009 11-17-arduino-basics2009 11-17-arduino-basics
2009 11-17-arduino-basics
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
Robotics camp'17 part2
Robotics camp'17 part2Robotics camp'17 part2
Robotics camp'17 part2
 
2D Plotter Presentation
2D Plotter Presentation2D Plotter Presentation
2D Plotter Presentation
 
Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Multi Sensory Communication 2/2
Multi Sensory Communication 2/2
 
Iaetsd vlsi based implementation of a digital
Iaetsd vlsi based implementation of a digitalIaetsd vlsi based implementation of a digital
Iaetsd vlsi based implementation of a digital
 
Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...
Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...
Color Recognition with Matlab Image Processing and Matlab Interfacing with Ar...
 
Easy GPS Tracker using Arduino and Python
Easy GPS Tracker using Arduino and PythonEasy GPS Tracker using Arduino and Python
Easy GPS Tracker using Arduino and Python
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Mini Cnc Printer
Mini Cnc PrinterMini Cnc Printer
Mini Cnc Printer
 
Embedded systems الانظمة المدمجة
Embedded systems  الانظمة المدمجة Embedded systems  الانظمة المدمجة
Embedded systems الانظمة المدمجة
 
Research and Prototyping Ground Robot Platform
Research and Prototyping Ground Robot PlatformResearch and Prototyping Ground Robot Platform
Research and Prototyping Ground Robot Platform
 
DIgital clock using verilog
DIgital clock using verilog DIgital clock using verilog
DIgital clock using verilog
 
CNC plotter controlled using Android application
CNC plotter controlled using Android applicationCNC plotter controlled using Android application
CNC plotter controlled using Android application
 
Controller Implementation in Verilog
Controller Implementation in VerilogController Implementation in Verilog
Controller Implementation in Verilog
 
Embedded Systems & Robotics
Embedded Systems  & RoboticsEmbedded Systems  & Robotics
Embedded Systems & Robotics
 
Arduino Microcontroller
Arduino Microcontroller Arduino Microcontroller
Arduino Microcontroller
 
Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...
Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...
Siemens s7 300-400-s7 graph for s7-300 400 programming sequential control sys...
 
WCAN mini ActionScript Vol.4
WCAN mini ActionScript Vol.4WCAN mini ActionScript Vol.4
WCAN mini ActionScript Vol.4
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 

Similar to Arduino programming part 2

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 motorAmarjeetsingh Thakur
 
FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot IJECEIAES
 
IRJET- Automatic Mini CNC Machine for PCB Drawing using Arduino
IRJET- Automatic Mini CNC Machine for PCB Drawing using ArduinoIRJET- Automatic Mini CNC Machine for PCB Drawing using Arduino
IRJET- Automatic Mini CNC Machine for PCB Drawing using ArduinoIRJET Journal
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoelwalia
 
IRJET - Mobile Application Base Voice Command Wireless CNC Writing Machine
IRJET - Mobile Application Base Voice Command Wireless CNC Writing MachineIRJET - Mobile Application Base Voice Command Wireless CNC Writing Machine
IRJET - Mobile Application Base Voice Command Wireless CNC Writing MachineIRJET Journal
 
Temperature Controlled Fan Report
Temperature Controlled Fan ReportTemperature Controlled Fan Report
Temperature Controlled Fan ReportPeeyush Pashine
 
Manuale Instatore User Manual
Manuale Instatore User ManualManuale Instatore User Manual
Manuale Instatore User Manualconwaychris
 
Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µ...
Program, Code of Program and  Screen Shot of Output (UNIVERSAL DRIVER USING µ...Program, Code of Program and  Screen Shot of Output (UNIVERSAL DRIVER USING µ...
Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µ...Er. Ashish Pandey
 
Work Hour Measurement System for Tractor
Work Hour Measurement System for TractorWork Hour Measurement System for Tractor
Work Hour Measurement System for TractorIRJET Journal
 
Micro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsMicro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsAmit Kumer Podder
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 ReportPARNIKA GUPTA
 
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORTRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORSubash Sambath Kumar
 
Joystick Controlled Wheelchair
Joystick Controlled WheelchairJoystick Controlled Wheelchair
Joystick Controlled WheelchairIRJET Journal
 
Automatic mini CNC machine for PCB drawing and drilling
Automatic mini CNC machine for PCB drawing and drillingAutomatic mini CNC machine for PCB drawing and drilling
Automatic mini CNC machine for PCB drawing and drillingIRJET Journal
 
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...IRJET Journal
 

Similar to Arduino programming part 2 (20)

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
 
FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot FPGA based synchronous multi-channel PWM generator for humanoid robot
FPGA based synchronous multi-channel PWM generator for humanoid robot
 
Edge_AI_Assignment_3.pdf
Edge_AI_Assignment_3.pdfEdge_AI_Assignment_3.pdf
Edge_AI_Assignment_3.pdf
 
IRJET- Automatic Mini CNC Machine for PCB Drawing using Arduino
IRJET- Automatic Mini CNC Machine for PCB Drawing using ArduinoIRJET- Automatic Mini CNC Machine for PCB Drawing using Arduino
IRJET- Automatic Mini CNC Machine for PCB Drawing using Arduino
 
Hexapod ppt
Hexapod pptHexapod ppt
Hexapod ppt
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
IRJET - Mobile Application Base Voice Command Wireless CNC Writing Machine
IRJET - Mobile Application Base Voice Command Wireless CNC Writing MachineIRJET - Mobile Application Base Voice Command Wireless CNC Writing Machine
IRJET - Mobile Application Base Voice Command Wireless CNC Writing Machine
 
Temperature Controlled Fan Report
Temperature Controlled Fan ReportTemperature Controlled Fan Report
Temperature Controlled Fan Report
 
Manuale Instatore User Manual
Manuale Instatore User ManualManuale Instatore User Manual
Manuale Instatore User Manual
 
Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µ...
Program, Code of Program and  Screen Shot of Output (UNIVERSAL DRIVER USING µ...Program, Code of Program and  Screen Shot of Output (UNIVERSAL DRIVER USING µ...
Program, Code of Program and Screen Shot of Output (UNIVERSAL DRIVER USING µ...
 
Work Hour Measurement System for Tractor
Work Hour Measurement System for TractorWork Hour Measurement System for Tractor
Work Hour Measurement System for Tractor
 
Micro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsMicro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and Peripherals
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 Report
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORTRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
 
Joystick Controlled Wheelchair
Joystick Controlled WheelchairJoystick Controlled Wheelchair
Joystick Controlled Wheelchair
 
Automatic mini CNC machine for PCB drawing and drilling
Automatic mini CNC machine for PCB drawing and drillingAutomatic mini CNC machine for PCB drawing and drilling
Automatic mini CNC machine for PCB drawing and drilling
 
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...
 
presentation_28 (1).pptx
presentation_28 (1).pptxpresentation_28 (1).pptx
presentation_28 (1).pptx
 

More from 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 PiAmarjeetsingh 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 PiAmarjeetsingh 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 PiAmarjeetsingh 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
 

More from Amarjeetsingh Thakur (17)

“Introduction to MATLAB & SIMULINK”
“Introduction to MATLAB  & SIMULINK”“Introduction to MATLAB  & SIMULINK”
“Introduction to MATLAB & SIMULINK”
 
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
 
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
 
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
 
Python openCV codes
Python openCV codesPython openCV codes
Python openCV codes
 
Python Numpy Source Codes
Python Numpy Source CodesPython Numpy Source Codes
Python Numpy Source Codes
 
Steemit html blog
Steemit html blogSteemit html blog
Steemit html blog
 
Python OpenCV Real Time projects
Python OpenCV Real Time projectsPython OpenCV Real Time projects
Python OpenCV Real Time projects
 
Adafruit_IoT_Platform
Adafruit_IoT_PlatformAdafruit_IoT_Platform
Adafruit_IoT_Platform
 
Core python programming tutorial
Core python programming tutorialCore python programming tutorial
Core python programming tutorial
 
Python openpyxl
Python openpyxlPython openpyxl
Python openpyxl
 
Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)Introduction to Internet of Things (IoT)
Introduction to Internet of Things (IoT)
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
 
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)
 
Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)Introduction to MQ Telemetry Transport (MQTT)
Introduction to MQ Telemetry Transport (MQTT)
 
Image processing in MATLAB
Image processing in MATLABImage processing in MATLAB
Image processing in MATLAB
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
 

Recently uploaded

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Arduino programming part 2

  • 1. ARDUINO PROGRAMMING SESSION 2 1 Presented By Amarjeetsingh Thakur 9/28/2020
  • 2. What is the principle behind variable output voltage? PWM Concept 29/28/2020
  • 3. What is PWM(Pulse width Modulation)? 39/28/2020
  • 5. Fan example You can run the fan at different speeds How do you make the choice of speed? Table fan button 59/28/2020
  • 8. #include <Keypad.h> const byte ROWS = 4; const byte COLS = 4; char hexaKeys[ROWS][COLS] = { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; byte rowPins[ROWS] = {9, 8, 7, 6}; byte colPins[COLS] = {5, 4, 3, 2}; 89/28/2020
  • 9. Contd.. Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); void setup(){ Serial.begin(9600); } void loop(){ char customKey = customKeypad.getKey(); if (customKey){ Serial.println(customKey); } } 99/28/2020
  • 10. SENSORS What is a sensor? “A sensor is an object whose purpose is to detect events or changes in its environment, and then provide a corresponding output”. Why do we need sensor? • A sensor is the guy who provides data to the a system via its input. • We need sensor to feed data to the system and tells the controller when to take action 109/28/2020
  • 11. Most used sensors for Arduino 1. Temperature + Humidity Sensor This is a temperature/humidity sensor. It monitors the ambient temperature or humidity. 119/28/2020
  • 12. 2. IR Sensor: • This is a multipurpose infrared sensor which can be used for color detection.The sensor provides a digital as well as analog output. An on board LED is used to indicate the presence of an object. This digital output can be directly connected to an Arduino, Raspberry Pi or any other microcontroller to read the sensor output. 129/28/2020
  • 14. //IR sensor with digital input at pin no. 2 const int IR_Sensor=2; void setup() { // initialize the digital pin as an output. // Pin 13 has an LED on Arduino boards: pinMode(13, OUTPUT); //Pin 2 is connected to the output of IR_Sensor pinMode(IR_Sensor,INPUT); } void loop() { if(digitalRead(IR_Sensor)==HIGH) //Check the sensor output { 149/28/2020
  • 15. digitalWrite(13, HIGH); // set the LED on } else { digitalWrite(13, LOW); // set the LED off } delay(1000); // wait for a second } Contd.. 159/28/2020
  • 16. Do you remember which actuator was used in this Access gate? Stepper Motor 169/28/2020
  • 18. • Stepper motors are called as Digital motor – It takes digital input to move by a step. • Stepper motor is specified by step angle of say 200 steps per revolution – 1.8 degree per step 189/28/2020
  • 19. • To move a step we need to provide a digital input sequence to windings. • The sequence for bipolar/unipolar is 1000 // 1st step 0100 // 2nd step 0010 // 3rd step 0001 // 4th step 1000 // repeat of sequence for 5th step 199/28/2020
  • 20. Activity 2.1 Type : Team of 2 Duration : 30 Minutes Write a program to run stepper motor in clockwise direction 209/28/2020
  • 21. Stepper Motor Speed Control 219/28/2020
  • 22. /* Stepper Motor Control - one revolution This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. The motor should revolve one revolution in one direction, then one revolution in the other direction. */ #include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); 229/28/2020
  • 23. Contd.. void setup() { // set the speed at 60 rpm: myStepper.setSpeed(60); // initialize the serial port: Serial.begin(9600); } void loop() { // step one revolution in one direction: Serial.println("clockwise"); myStepper.step(stepsPerRevolution); delay(500);//Without delay stepper motor will rotate continuosly } 239/28/2020
  • 24. Topic Learning Outcomes At the end of the topic you should be able to: 1. Interface a sensor/s, device/s with Arduino for data acquisition and display the data. 2. Interface Actuators with Arduino to Control motion to build an application. 3. Build a mechatronic system using Arduino, sensors, actuators and modules. 249/28/2020