SlideShare a Scribd company logo
WORKSHOP ON ARDUINO
DAY – 2: ADVANCE ARDUINO
DESIGN INNOVATION CENTRE
Activity 9 : DC Motor Speed & Direction Control
Motor:
An electric motor is an electrical machine that converts electrical
energy into mechanical energy. Most electric motors operate through the
interaction between the motor's magnetic field and electric current in a wire
winding to generate force in the form of rotation of a shaft.
DC Motor
The electric motor operated by direct current is called a DC Motor. This is a
device that converts DC electrical energy into a mechanical energy.
DC Motor Driver
What is Motor Driver?
 A motor driver IC is an integrated circuit chip
which is usually used to control motors in
autonomous robots.
 Motor driver ICs act as an interface between
the microprocessor and the motors in a robot.
 The most commonly used motor driver IC’s
are from the L293 series such as L293D,
L293NE, etc.
Why Motor Driver?
 Most microprocessors operate at low voltages
and require a small amount of current to
operate while the motors require a relatively
higher voltages and current .
 Thus current cannot be supplied to the motors
from the microprocessor.
 This is the primary need for the motor
driver IC.
Circuit Connections
Code & Explanation
/* Code for Dc Motor Speed &
Direction Control */
#define button 8
#define pot 0
#define pwm1 9
#define pwm2 10
boolean motor_dir = 0;
int motor_speed;
void setup() {
pinMode(pot, INPUT);
pinMode(button, INPUT_PULLUP);
pinMode(pwm1, OUTPUT);
pinMode(pwm2, OUTPUT);
Serial.begin(9600);
}
void loop() {
motor_speed = analogRead(pot);
Serial.println(pot);
if(motor_dir)
analogWrite(pwm1,
motor_speed);
else
analogWrite(pwm2,
motor_speed);
if(!digitalRead(button)){
while(!digitalRead(button));
motor_dir = !motor_dir;
if(motor_dir)
digitalWrite(pwm2, 0);
else
digitalWrite(pwm1, 0);
}
}
Activity 10 : Servo Motor
Servo Motor
 A servomotor is a rotary actuator or linear actuator that allows for precise
control of angular or linear position, velocity and acceleration.
 It consists of a suitable motor coupled to a sensor for position feedback.
 It also requires a relatively sophisticated controller, often a dedicated
module designed specifically for use with servomotors.
 Servo motor can be rotated from 0 to 180
degree.
 Servo motors are rated in kg/cm (kilogram per
centimeter) most servo motors are rated at
3kg/cm or 6kg/cm or 12kg/cm.
 This kg/cm tells you how much weight your
servo motor can lift at a particular distance.
For example: A 6kg/cm Servo motor should be
able to lift 6kg if load is suspended 1cm away
from the motors shaft, the greater the distance
the lesser the weight carrying capacity.
Circuit Connections
Code & Explanation
/* Program to control Servo Motor*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Activity 11 : DHT11 Temperature & Humidity Sensor
Temperature & Humidity
 The degree or intensity of heat present in a substance or object is its
temperature.
 Humidity is the concentration of water vapour present in air.
 The temperature is measured with the
help of a NTC thermistor or negative
temperature coefficient thermistor.
 These thermistors are usually made with
semiconductors, ceramic and polymers.
 The humidity is sensed using a moisture
dependent resistor. It has two electrodes
and in between them there exist a
moisture holding substrate which holds
moisture.
 The conductance and hence resistance
changes with changing humidity.
PCB Size 22.0mm X 20.5mm X 1.6mm
Working Voltage 3.3 or 5V DC
Operating
Voltage
3.3 or 5V DC
Measure Range 20-95%RH;0-50℃
Resolution
8bit(temperature),
8bit(humidity)
Circuit Connections
Code & Explanation
// Program for DHT11
#include "dht.h"
#define dht_apin A0
// Pin sensor is connected to
dht DHT;
void setup(){
Serial.begin(9600);
delay(500); //Delay to let system boot
Serial.println("DHT11 Humidity &
temperature Sensornn");
delay(1000);
//Wait before accessing Sensor
} //end
void loop(){
//Start of Program
DHT.read11(dht_apin);
Serial.print("Current Humidity = ");
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("Temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");
delay(2000);
//Wait 2 seconds before accessing
sensor again.
//Fastest should be once every two
seconds.
} // end loop()
Activity 12 : Infrared Sensor
Infrared (IR) Communication
 Infrared (IR) is a wireless technology used for device communication over
short ranges. IR transceivers are quite cheap and serve as short-range
communication solution.
 Infrared band of the electromagnet corresponds to 430THz to 300GHz and a
wavelength of 980nm.
IR Sensor Module
 An IR sensor is a device which
detects IR radiation falling on it.
Applications:
Night Vision, Surveillance,
Thermography, Short – range
communication, Astronomy, etc.
Circuit Connections
Code & Explanation
// Program for IR Sensor to detect the
obstacle and indicate on the serial monitor
int LED = 13; // Use the onboard Uno LED
int obstaclePin = 7; // This is our input pin
int hasObstacle = HIGH;
// High Means No Obstacle
void setup() {
pinMode(LED, OUTPUT);
pinMode(obstaclePin, INPUT);
Serial.begin(9600);
}
void loop() {
hasObstacle = digitalRead(obstaclePin);
//Reads the output of the obstacle sensor
from the 7th PIN of the Digital section of
the arduino
if (hasObstacle == HIGH) {
//High means something is ahead, so
illuminates the 13th Port connected LED
Serial.println("Stop something is
ahead!!");
digitalWrite(LED, HIGH);
//Illuminates the 13th Port LED
}
else{
Serial.println("Path is clear");
digitalWrite(LED, LOW);
}
delay(200);
}
Activity 13 : Ultrasonic Sensor
Ultrasound
 Ultrasound is sound waves with frequencies higher than the upper audible
limit of human hearing.
Ultrasonic Sensor
 The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels
in air and when it gets objected by any material it gets reflected back
toward the sensor this reflected wave is observed by the Ultrasonic
receiver.
Circuit Connections
Code & Explanation
// Program for Ultrasonic Sensor
const int trigPin = 9;
// defines pins numbers
const int echoPin = 10;
long duration; // defines variables
int distance;
void setup() {
pinMode(trigPin, OUTPUT);
// Sets the trigPin as an Output
pinMode(echoPin, INPUT);
// Sets the echoPin as an Input
Serial.begin(9600);
// Starts the serial communication
}
void loop() {
digitalWrite(trigPin, LOW);
// Clears the trigPin
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
// Sets the trigPin to HIGH for 10 µS
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
// Reads the echoPin, returns the sound
wave travel time in microseconds
distance= duration*0.034/2;
// Calculating the distance
Serial.print("Distance: "); // Prints the
distance on the Serial Monitor
Serial.println(distance);
delay(500);
}
Ultrasonic Distance Calculation
Do It Yourself - Line Follower
Line Follower
 Line follower is an autonomous robot which follows either black line in white
are or white line in black area.
Robot must be able to detect particular line and keep following it.
Concepts of Line Follower
 Concept of working of line follower is related to light.
 When light fall on a white surface it is almost fully reflected and in case of
black surface, light is completely absorbed. This behaviour of light is used
in building a line follower robot.
IR Sensor Principle
Block Diagram of Line Follower
Line Follower Working
Components
Line Follower Robot
Code & Explanation
//Arduino Line Follower
Code
void setup()
{
pinMode(8, INPUT);
pinMode(9, INPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
}
void loop()
{
if(digitalRead(8) &&
digitalRead(9)) // Move
Forward
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
if(!(digitalRead(8)) &&
digitalRead(9)) // Turn
right
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
if(digitalRead(8) &&
!(digitalRead(9))) // turn
left
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
if(!(digitalRead(8)) &&
!(digitalRead(9))) // stop
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
}
Do It Yourself – Light Follower
Light Follower
A light follower robot is a light-seeking robot that moves toward areas of bright
light.
Light Dependent Resistor
An LDR is a component that has a (variable) resistance that changes with the
light intensity that falls upon it. This allows them to be used in light sensing
circuits.
Code & Explanation
//Light Follower Code
void setup() {
pinMode(A0,INPUT); //Right
Sensor output to arduino input
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
Serial.begin(9600);
}
void loop() {
int sensor=analogRead(A0);
delay(100);
Serial.println(sensor);
if (sensor >= 200){
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
}
else{
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
}
}
Do It Yourself – Obstacle Avoider
Obstacle Avoider
 This obstacle avoidance robot changes its path left or right depending on the
point of obstacles in its way.
 Here an Ultrasonic sensor is used to sense the obstacles in the path by
calculating the distance between the robot and obstacle. If robot finds any
obstacle it changes the direction and continue moving.
Applications:
 Mobile Robot Navigation
Systems,
 Automatic Vacuum Cleaning,
 Unmanned Aerial Vehicles,
etc.
Code & Explanation
const int trigPin = 9;
const int echoPin = 10;
void setup()
{
pinMode(trigPin,
OUTPUT);
pinMode(echoPin,
INPUT);
pinMode (2, OUTPUT);
pinMode (3, OUTPUT);
pinMode (4, OUTPUT);
pinMode (5, OUTPUT);
Serial.begin(9600);
}
long duration, distance;
void loop()
{
digitalWrite(trigPin,
LOW);
delayMicroseconds(3);
digitalWrite(trigPin,
HIGH);
delayMicroseconds(12);
digitalWrite(trigPin,
LOW);
duration =
pulseIn(echoPin, HIGH);
distance = duration/58.2;
Serial.print(distance);
Serial.println("CM");
delay(10);
if(distance<20)
{
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
else
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
delay(90);
}
Recommended Books
Additional Resources
1. https://www.arduino.cc/ - Arduino.cc is the home of Arduino platform. It
has extensive learning materials such as Tutorials, References, code for
using Arduino, Forum where you can post questions on issues/problems
you have in your projects, etc.
2. http://makezine.com/ - Online page of Maker magazine, with lots of
information on innovative technology projects including Arduino.
3. http://www.instructables.com/ - Lots of projects on technology and arts
(including cooking), with step-by-instructions, photographs, and videos
4. http://appinventor.mit.edu/ - It allows the budding computer
programmers to build their own apps that can be run on Android devices. It
used a user-friendly graphical user-interface that allows drag-and-drop
technique to build applications that impacts the world.
5. http://fritzing.org/ - Fritzing is open source computer aided design (CAD)
software for electronic circuit design and printed circuit board (PCB)
fabrication, especially with Arduino prototyping. It is an electronic design
automation (EDA) tool for circuit designers.
Desgin Innovation Centre,
Indian Institute of Information Technology, Design &
Manufacturing, Kancheepuram, Chennai – 600127
E-mail: designinnovationcentre@gmail.com
Ad

More Related Content

What's hot (20)

Ardui no
Ardui no Ardui no
Ardui no
Amol Sakhalkar
 
Arduino
ArduinoArduino
Arduino
Jerin John
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Arduino
ArduinoArduino
Arduino
vipin7vj
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Green Moon Solutions
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
Betsy Eng
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
atuline
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Yong Heui Cho
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
Ravi Phadtare
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the Arduino
Charles A B Jr
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Omer Kilic
 
What are the different types of arduino boards
What are the different types of arduino boardsWhat are the different types of arduino boards
What are the different types of arduino boards
elprocus
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
soma saikiran
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
Md. Nahidul Islam
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
James Lewis
 
Arduino
ArduinoArduino
Arduino
Paras Bhanot
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
Betsy Eng
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
atuline
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Yong Heui Cho
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
sdcharle
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the Arduino
Charles A B Jr
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Omer Kilic
 
What are the different types of arduino boards
What are the different types of arduino boardsWhat are the different types of arduino boards
What are the different types of arduino boards
elprocus
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
soma saikiran
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
James Lewis
 

Similar to Arduino Workshop Day 2 - Advance Arduino & DIY (20)

Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
KUNJBIHARISINGH5
 
INTELIGENT RAILWAY SYSTEM
INTELIGENT RAILWAY SYSTEMINTELIGENT RAILWAY SYSTEM
INTELIGENT RAILWAY SYSTEM
Ghanshyam Dusane
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CAR
Harshit Jain
 
Automatic railway gate control using arduino uno
Automatic railway gate control using arduino unoAutomatic railway gate control using arduino uno
Automatic railway gate control using arduino uno
selvalakshmi24
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning System
Madhav Reddy Chintapalli
 
Interfacing with Atmega 16
Interfacing with Atmega 16Interfacing with Atmega 16
Interfacing with Atmega 16
Ramadan Ramadan
 
Computer networks unit III CHAPTER of frameworks
Computer networks unit III CHAPTER of frameworksComputer networks unit III CHAPTER of frameworks
Computer networks unit III CHAPTER of frameworks
manforlover7
 
AUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEM
AUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEMAUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEM
AUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEM
BiprajitSarkar
 
Multi-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for ArduinoMulti-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for Arduino
Wanita Long
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
Tony Olsson.
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
Tony Olsson.
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
Electric&elctronics&engineeering
 
Accident detection management system project report II.pdf
Accident detection management system project report II.pdfAccident detection management system project report II.pdf
Accident detection management system project report II.pdf
Kamal Acharya
 
Rangefinder ppt
Rangefinder pptRangefinder ppt
Rangefinder ppt
KaushlendraSingh44
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
VenuVenupk1431
 
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.
 
A project report on Remote Monitoring of a Power Station using GSM and Arduino
A project report on Remote Monitoring of a Power Station using GSM and ArduinoA project report on Remote Monitoring of a Power Station using GSM and Arduino
A project report on Remote Monitoring of a Power Station using GSM and Arduino
Jawwad Sadiq Ayon
 
POSITION ANALYSIS OF DIGITAL SYSTEM
POSITION ANALYSIS OF DIGITAL SYSTEMPOSITION ANALYSIS OF DIGITAL SYSTEM
POSITION ANALYSIS OF DIGITAL SYSTEM
KEVSER CARPET
 
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
Tawsif Rahman Chowdhury
 
Metal Detector Robotic Vehicle
Metal Detector Robotic VehicleMetal Detector Robotic Vehicle
Metal Detector Robotic Vehicle
Edgefxkits & Solutions
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
KUNJBIHARISINGH5
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CAR
Harshit Jain
 
Automatic railway gate control using arduino uno
Automatic railway gate control using arduino unoAutomatic railway gate control using arduino uno
Automatic railway gate control using arduino uno
selvalakshmi24
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning System
Madhav Reddy Chintapalli
 
Interfacing with Atmega 16
Interfacing with Atmega 16Interfacing with Atmega 16
Interfacing with Atmega 16
Ramadan Ramadan
 
Computer networks unit III CHAPTER of frameworks
Computer networks unit III CHAPTER of frameworksComputer networks unit III CHAPTER of frameworks
Computer networks unit III CHAPTER of frameworks
manforlover7
 
AUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEM
AUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEMAUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEM
AUTOMATIC RAILWAY GATE AND SIGNALLING SYSTEM
BiprajitSarkar
 
Multi-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for ArduinoMulti-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for Arduino
Wanita Long
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
Tony Olsson.
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
Tony Olsson.
 
Accident detection management system project report II.pdf
Accident detection management system project report II.pdfAccident detection management system project report II.pdf
Accident detection management system project report II.pdf
Kamal Acharya
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
VenuVenupk1431
 
A project report on Remote Monitoring of a Power Station using GSM and Arduino
A project report on Remote Monitoring of a Power Station using GSM and ArduinoA project report on Remote Monitoring of a Power Station using GSM and Arduino
A project report on Remote Monitoring of a Power Station using GSM and Arduino
Jawwad Sadiq Ayon
 
POSITION ANALYSIS OF DIGITAL SYSTEM
POSITION ANALYSIS OF DIGITAL SYSTEMPOSITION ANALYSIS OF DIGITAL SYSTEM
POSITION ANALYSIS OF DIGITAL SYSTEM
KEVSER CARPET
 
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
Tawsif Rahman Chowdhury
 
Ad

Recently uploaded (20)

Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
TrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token ListingTrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token Listing
Trs Labs
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
Unlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive GuideUnlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive Guide
vikasascentbpo
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
Mastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdfMastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdf
Spiral Mantra
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
TrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token ListingTrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token Listing
Trs Labs
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
Unlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive GuideUnlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive Guide
vikasascentbpo
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
Mastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdfMastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdf
Spiral Mantra
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
Ad

Arduino Workshop Day 2 - Advance Arduino & DIY

  • 1. WORKSHOP ON ARDUINO DAY – 2: ADVANCE ARDUINO DESIGN INNOVATION CENTRE
  • 2. Activity 9 : DC Motor Speed & Direction Control Motor: An electric motor is an electrical machine that converts electrical energy into mechanical energy. Most electric motors operate through the interaction between the motor's magnetic field and electric current in a wire winding to generate force in the form of rotation of a shaft. DC Motor The electric motor operated by direct current is called a DC Motor. This is a device that converts DC electrical energy into a mechanical energy.
  • 3. DC Motor Driver What is Motor Driver?  A motor driver IC is an integrated circuit chip which is usually used to control motors in autonomous robots.  Motor driver ICs act as an interface between the microprocessor and the motors in a robot.  The most commonly used motor driver IC’s are from the L293 series such as L293D, L293NE, etc. Why Motor Driver?  Most microprocessors operate at low voltages and require a small amount of current to operate while the motors require a relatively higher voltages and current .  Thus current cannot be supplied to the motors from the microprocessor.  This is the primary need for the motor driver IC.
  • 5. Code & Explanation /* Code for Dc Motor Speed & Direction Control */ #define button 8 #define pot 0 #define pwm1 9 #define pwm2 10 boolean motor_dir = 0; int motor_speed; void setup() { pinMode(pot, INPUT); pinMode(button, INPUT_PULLUP); pinMode(pwm1, OUTPUT); pinMode(pwm2, OUTPUT); Serial.begin(9600); } void loop() { motor_speed = analogRead(pot); Serial.println(pot); if(motor_dir) analogWrite(pwm1, motor_speed); else analogWrite(pwm2, motor_speed); if(!digitalRead(button)){ while(!digitalRead(button)); motor_dir = !motor_dir; if(motor_dir) digitalWrite(pwm2, 0); else digitalWrite(pwm1, 0); } }
  • 6. Activity 10 : Servo Motor Servo Motor  A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration.  It consists of a suitable motor coupled to a sensor for position feedback.  It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors.  Servo motor can be rotated from 0 to 180 degree.  Servo motors are rated in kg/cm (kilogram per centimeter) most servo motors are rated at 3kg/cm or 6kg/cm or 12kg/cm.  This kg/cm tells you how much weight your servo motor can lift at a particular distance. For example: A 6kg/cm Servo motor should be able to lift 6kg if load is suspended 1cm away from the motors shaft, the greater the distance the lesser the weight carrying capacity.
  • 8. Code & Explanation /* Program to control Servo Motor*/ #include <Servo.h> Servo myservo; // create servo object to control a servo int pos = 0; // variable to store the servo position void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } }
  • 9. Activity 11 : DHT11 Temperature & Humidity Sensor Temperature & Humidity  The degree or intensity of heat present in a substance or object is its temperature.  Humidity is the concentration of water vapour present in air.  The temperature is measured with the help of a NTC thermistor or negative temperature coefficient thermistor.  These thermistors are usually made with semiconductors, ceramic and polymers.  The humidity is sensed using a moisture dependent resistor. It has two electrodes and in between them there exist a moisture holding substrate which holds moisture.  The conductance and hence resistance changes with changing humidity. PCB Size 22.0mm X 20.5mm X 1.6mm Working Voltage 3.3 or 5V DC Operating Voltage 3.3 or 5V DC Measure Range 20-95%RH;0-50℃ Resolution 8bit(temperature), 8bit(humidity)
  • 11. Code & Explanation // Program for DHT11 #include "dht.h" #define dht_apin A0 // Pin sensor is connected to dht DHT; void setup(){ Serial.begin(9600); delay(500); //Delay to let system boot Serial.println("DHT11 Humidity & temperature Sensornn"); delay(1000); //Wait before accessing Sensor } //end void loop(){ //Start of Program DHT.read11(dht_apin); Serial.print("Current Humidity = "); Serial.print(DHT.humidity); Serial.print("% "); Serial.print("Temperature = "); Serial.print(DHT.temperature); Serial.println("C "); delay(2000); //Wait 2 seconds before accessing sensor again. //Fastest should be once every two seconds. } // end loop()
  • 12. Activity 12 : Infrared Sensor Infrared (IR) Communication  Infrared (IR) is a wireless technology used for device communication over short ranges. IR transceivers are quite cheap and serve as short-range communication solution.  Infrared band of the electromagnet corresponds to 430THz to 300GHz and a wavelength of 980nm. IR Sensor Module  An IR sensor is a device which detects IR radiation falling on it. Applications: Night Vision, Surveillance, Thermography, Short – range communication, Astronomy, etc.
  • 14. Code & Explanation // Program for IR Sensor to detect the obstacle and indicate on the serial monitor int LED = 13; // Use the onboard Uno LED int obstaclePin = 7; // This is our input pin int hasObstacle = HIGH; // High Means No Obstacle void setup() { pinMode(LED, OUTPUT); pinMode(obstaclePin, INPUT); Serial.begin(9600); } void loop() { hasObstacle = digitalRead(obstaclePin); //Reads the output of the obstacle sensor from the 7th PIN of the Digital section of the arduino if (hasObstacle == HIGH) { //High means something is ahead, so illuminates the 13th Port connected LED Serial.println("Stop something is ahead!!"); digitalWrite(LED, HIGH); //Illuminates the 13th Port LED } else{ Serial.println("Path is clear"); digitalWrite(LED, LOW); } delay(200); }
  • 15. Activity 13 : Ultrasonic Sensor Ultrasound  Ultrasound is sound waves with frequencies higher than the upper audible limit of human hearing. Ultrasonic Sensor  The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air and when it gets objected by any material it gets reflected back toward the sensor this reflected wave is observed by the Ultrasonic receiver.
  • 17. Code & Explanation // Program for Ultrasonic Sensor const int trigPin = 9; // defines pins numbers const int echoPin = 10; long duration; // defines variables int distance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input Serial.begin(9600); // Starts the serial communication } void loop() { digitalWrite(trigPin, LOW); // Clears the trigPin delayMicroseconds(2); digitalWrite(trigPin, HIGH); // Sets the trigPin to HIGH for 10 µS delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); // Reads the echoPin, returns the sound wave travel time in microseconds distance= duration*0.034/2; // Calculating the distance Serial.print("Distance: "); // Prints the distance on the Serial Monitor Serial.println(distance); delay(500); }
  • 19. Do It Yourself - Line Follower Line Follower  Line follower is an autonomous robot which follows either black line in white are or white line in black area. Robot must be able to detect particular line and keep following it. Concepts of Line Follower  Concept of working of line follower is related to light.  When light fall on a white surface it is almost fully reflected and in case of black surface, light is completely absorbed. This behaviour of light is used in building a line follower robot.
  • 21. Block Diagram of Line Follower
  • 25. Code & Explanation //Arduino Line Follower Code void setup() { pinMode(8, INPUT); pinMode(9, INPUT); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); } void loop() { if(digitalRead(8) && digitalRead(9)) // Move Forward { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); } if(!(digitalRead(8)) && digitalRead(9)) // Turn right { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); } if(digitalRead(8) && !(digitalRead(9))) // turn left { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); } if(!(digitalRead(8)) && !(digitalRead(9))) // stop { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); } }
  • 26. Do It Yourself – Light Follower Light Follower A light follower robot is a light-seeking robot that moves toward areas of bright light. Light Dependent Resistor An LDR is a component that has a (variable) resistance that changes with the light intensity that falls upon it. This allows them to be used in light sensing circuits.
  • 27. Code & Explanation //Light Follower Code void setup() { pinMode(A0,INPUT); //Right Sensor output to arduino input pinMode(2,OUTPUT); pinMode(3,OUTPUT); pinMode(4,OUTPUT); pinMode(5,OUTPUT); Serial.begin(9600); } void loop() { int sensor=analogRead(A0); delay(100); Serial.println(sensor); if (sensor >= 200){ digitalWrite(2,HIGH); digitalWrite(3,LOW); digitalWrite(4,HIGH); digitalWrite(5,LOW); } else{ digitalWrite(2,LOW); digitalWrite(3,LOW); digitalWrite(4,LOW); digitalWrite(5,LOW); } }
  • 28. Do It Yourself – Obstacle Avoider Obstacle Avoider  This obstacle avoidance robot changes its path left or right depending on the point of obstacles in its way.  Here an Ultrasonic sensor is used to sense the obstacles in the path by calculating the distance between the robot and obstacle. If robot finds any obstacle it changes the direction and continue moving. Applications:  Mobile Robot Navigation Systems,  Automatic Vacuum Cleaning,  Unmanned Aerial Vehicles, etc.
  • 29. Code & Explanation const int trigPin = 9; const int echoPin = 10; void setup() { pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode (2, OUTPUT); pinMode (3, OUTPUT); pinMode (4, OUTPUT); pinMode (5, OUTPUT); Serial.begin(9600); } long duration, distance; void loop() { digitalWrite(trigPin, LOW); delayMicroseconds(3); digitalWrite(trigPin, HIGH); delayMicroseconds(12); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = duration/58.2; Serial.print(distance); Serial.println("CM"); delay(10); if(distance<20) { digitalWrite(2, LOW); digitalWrite(3, HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); } else { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); } delay(90); }
  • 31. Additional Resources 1. https://www.arduino.cc/ - Arduino.cc is the home of Arduino platform. It has extensive learning materials such as Tutorials, References, code for using Arduino, Forum where you can post questions on issues/problems you have in your projects, etc. 2. http://makezine.com/ - Online page of Maker magazine, with lots of information on innovative technology projects including Arduino. 3. http://www.instructables.com/ - Lots of projects on technology and arts (including cooking), with step-by-instructions, photographs, and videos 4. http://appinventor.mit.edu/ - It allows the budding computer programmers to build their own apps that can be run on Android devices. It used a user-friendly graphical user-interface that allows drag-and-drop technique to build applications that impacts the world. 5. http://fritzing.org/ - Fritzing is open source computer aided design (CAD) software for electronic circuit design and printed circuit board (PCB) fabrication, especially with Arduino prototyping. It is an electronic design automation (EDA) tool for circuit designers.
  • 32. Desgin Innovation Centre, Indian Institute of Information Technology, Design & Manufacturing, Kancheepuram, Chennai – 600127 E-mail: [email protected]