Sie sind auf Seite 1von 79

A

Report on

WALL CLIMBING SURVEILLANCE ROBOT

Submitted by

SHIPRA SINGH

16900314099

SHIWANY PAREEK

16900314100

MONOMITA MANDAL

16900314063

NEHA GUPTA

16900314067

A report submitted in partial fulfilment of the requirement of FINAL YEAR

PROJECT

for the award of the degree of

BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING

from

ACADEMY OF TECHNOLOGY

Under the guidance of

PROF. SANJIB MITRA

A Report on WALL CLIMBING SURVEILLANCE ROBOT Submitted by SHIPRA SINGH 16900314099 SHIWANY PAREEK 16900314100 MONOMITA

Academy of Technology

Aedconagar, Hooghly712121

1

ACKNOWLEDGEMENT

I take this opportunity to express my profound gratitude and deep regards to my faculty Prof. Sanjib Mitra for his exemplary guidance, monitoring and constant encouragement throughout the course of this project. The blessing, help and guidance given by him time to time shall carry me a long way in the journey of life on which I am about to embark.

Finally I must say that no height is ever achieved without some sacrifices made

at some point of time and it

is

here

I

owe my

special debt to my parents

and family members for showing their love and constant support throughout this period of time.

Prof. Sanjib Mitra (Assistant Professor) Academy Of Technology

Shipra Singh Shiwany Pareek Monomita Mandal Neha Gupta

2

ABSTRACT

This is a report on Wall Climbing Surveillance Robot using Arduino, motor board, ducted fan, LIPO battery, voltage divider, ESC, LED, micro motor, voltage regulator e.t.c . It contains basic working of Arduino UNO board and its programming environment, that is, to understand the pin configuration of Arduino UNO board and how to execute basic instructions to develop your own program and interfacing of few sensors as given in the content.

The main objective of this project .

3

TABLE OF CONTENTS

Certificate...............................................................................................(2)

Acknowledgement..................................................................................(3)

Abstract..................................................................................................(5)

Introduction on Wall Climbing Robot......................................................(6-7) Introduction on Arduino......................................................................(8-9)

Benefits of

(12)

............................................................................... Applications of Arduino........................................................................(13) Programs using Arduino..................................................................(14-53) Sensor design Projects.....................................................................(54-66) Mini Projects...................................................................................(67-75) Advantages of Embedded System.........................................................(76) Disadvantages of Embedded System.....................................................(77) Future Scope of Arduino.......................................................................(78)

Conclusion............................................................................................(79)

References/ Bibliography......................................................................(80)

4

INTRODUCTION ON WALL CLIMBING ROBOT

An embedded system is some combination of computer hardware and software, either fixed in capability or programmable, that is specifically designed for a particular kind of application device.

An embedded system is a dedicated computer system designed for one or two specific functions. This system is embedded as a part of a complete device system that includes hardware, such as electrical and mechanical components. The embedded system is unlike the general-purpose computer, which is engineered to manage a wide range of processing tasks.

Industrial machines, automobiles, medical equipment, cameras, household appliances, airplanes, vending machines and toys (as well as the more obvious cellular phone and PDA) are among the myriad possible hosts of an embedded system.

Modern embedded systems are often based on microcontrollers (i.e. CPUs with integrated memory or peripheral interfaces), but ordinary microprocessors (using external chips for memory and peripheral interface circuits) are also common, especially in more-complex systems. In either case, the processor(s) used may be types ranging from general purpose to those specialised in certain class of computations, or even custom designed for the application at hand.

Since the embedded system is dedicated to specific tasks, design engineers can optimize it to reduce the size and cost of the product and increase the reliability and performance. Some embedded systems are mass-produced, benefiting from economies of scale. Properties typical of embedded computers when compared with general-purpose ones are low power consumption, small size, rugged operating ranges and low per-unit cost.

Because an embedded system is engineered to perform certain tasks only, design engineers may optimize size, cost, power consumption, reliability and performance. Embedded systems are typically produced on broad scales and share functionalities across a variety of environments and applications.

5

Embedded systems are managed by single or multiple processing cores in the form of microcontrollers or digital signal processors (DSP), field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC) and gate arrays. These processing components are integrated with components dedicated to handling electric and/or mechanical interfacing.

An embedded system's key feature is dedication to specific functions that typically require strong general-purpose processors. For example, router and switch systems are embedded systems, whereas a general-purpose computer uses a proper OS for routing functionality. However, embedded routers function more efficiently than OS-based computers for routing functionalities.

Commercial embedded systems range from digital watches and MP3 players to giant routers and switches. Complexities vary from single processor chips to advanced units with multiple processing chips.

Embedded systems are managed by single or multiple processing cores in the form of microcontrollers or

6

INTRODUCTION ON ARDUINO

Arduino

is

an

open-source

prototyping

platform

based

on easy-to-use

hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming

and

the

based

on

Arduino is a hardware and software company, project, and user community that designs and manufactures computer open-source hardware, open-source software, and microcontroller-based kits for building digital devices and interactive objects that can sense and control physical devices.

The project is based on microcontroller board designs, produced by several vendors, using various microcontrollers. These systems provide sets of digital and analog Input/output (I/O) pins that can interface to various expansion boards (termed shields) and other circuits. The boards feature serial communication interfaces, including Universal Serial Bus (USB) on some models, for loading programs from personal computers. For programming the microcontrollers, the Arduino project provides an integrated development environment (IDE) based on a programming language named Processing, which also supports the languages C and C++.

The first Arduino was introduced in 2005, aiming to provide a low cost, easy way for novices and professionals to create devices that interact with their environment using sensors and actuators. Common examples of such devices intended for beginner hobbyists include simple robots, thermostats, and motion detectors.

Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open-source platform, their contributions have added up

7

to an incredible amount of accessible knowledge that can be of great help to novices and experts alike.

Arduino Uno:

to an incredible amount of <a href=accessible knowledge that can be of great help to novices and experts alike. Arduino Uno: Pin Diagram : 8 " id="pdf-obj-7-9" src="pdf-obj-7-9.jpg">

Pin Diagram :

to an incredible amount of <a href=accessible knowledge that can be of great help to novices and experts alike. Arduino Uno: Pin Diagram : 8 " id="pdf-obj-7-13" src="pdf-obj-7-13.jpg">

8

INTRODUCTION ON ATMEGA-328

The ATmega328 is a single-chip microcontroller created by Atmel and belongs to the megaAVR series.

Specifications:

The Atmel 8-bit AVR RISC-based microcontroller combines 32 kB ISP flash memory with read-while-write capabilities, 1 kB EEPROM, 2 kB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6- channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8-5.5 volts. The device achieves throughput approaching 1 MIPS per MHz.

ATmega328 is commonly used in many projects and autonomous systems where a simple, low-powered, low-cost micro-controller is needed. Perhaps the most common implementation of this chip is on the popular Arduino development platform, namely the Arduino Uno and Arduino Nano models.

Features:

Microcontroller ATmega-328

Operating Voltage 5V

Input Voltage(recommended) 7-12V

Input Voltage(limits) 6-20V

Digital I/O Pins 14

(of which 6 provide PWM pins)

Analog Input Pins 8

DC Current per I/O Pin 40mA

DC Current for 3.3V pins 50mA

Flash Memory 32KB (of which 2KB used for bootloader)

SRAM 2KB

EEPROM 1KB

Clock Speed 16 MHz

9

Pin Diagram:

Pin Diagram: 10

10

BENEFITS OF ARDUINO-UNO

There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard, and many others offer similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers. Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than $50 Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows. Simple, clear programming environment - The Arduino Software (IDE) is easy-to-use for beginners, yet flexible enough for advanced users to take advantage of as well. For teachers, it's conveniently based on the Processing programming environment, so students learning to program in that environment will be familiar with how the Arduino IDE works. Open source and extensible software - The Arduino software is published as open source tools, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AVR C programming language on which it's based. Similarly, you can add AVR-C code directly into your Arduino programs if you want to. Open source and extensible hardware - The plans of the Arduino boards are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the breadboard version of the module in order to understand how it works and save money.

11

APPLICATIONS OF ARDUINO

Light Control

 

Home Automation

Robotics

Networking

Xoscillo, an open-source oscilloscope

Scientific equipment such as the Chemduino

Arduinome, a MIDI controller device that mimics the Monome

a trip

computer that

uses

the on-board

diagnostics interface

found in most modern cars Ardupilot, drone software and hardware

ArduinoPhone, a do-it-yourself cellphone

GertDuino, an Arduino mate for the Raspberry Pi

Water quality testing platform

Homemade CNC using Arduino and DC motors with close loop control by

Homofaciens DC motor control using Arduino and H-Bridge.

12

Circuit to blink the Default LED present in Arduino 13

Circuit to blink the Default LED present in Arduino

13

PROGRAMS

01. Program to blink the Default LED present in Arduino

void setup()

{

pinMode(13,OUTPUT);

}

void loop()

{

digitalWrite(13,HIGH);

delay(1000);

digitalWrite(13,LOW);

delay(1000);

}

14

Circuit to glow multiple LEDs present in the breadboard using arduino 02.Program to glow multiple LEDs

Circuit to glow multiple LEDs present in the breadboard using arduino

02.Program to glow multiple LEDs present in the breadboard using Arduino

int red=11,green=10,blue=9; void setup() {

pinMode(red,OUTPUT);

pinMode(green,OUTPUT);

pinMode(blue,OUTPUT);

}

void loop()

{

digitalWrite(red,HIGH);

delay(500);

digitalWrite(red,LOW);

15

delay(500);

digitalWrite(green,HIGH);

delay(500);

digitalWrite(green,LOW);

delay(500);

digitalWrite(blue,HIGH);

delay(500);

digitalWrite(blue,LOW);

delay(500);

digitalWrite(green,HIGH);

delay(500);

digitalWrite(green,LOW);

}

16

Circuit to glow multiple LEDs using switch(button) as input 03.Program to glow multiple LEDs using switch(button)

Circuit to glow multiple LEDs using switch(button) as input

03.Program to glow multiple LEDs using switch(button) as input

int red=11,green=10,blue=9,switch=12; void setup() {

pinMode(red,OUTPUT); pinMode(green,OUTPUT); pinMode(blue,OUTPUT); pinMode(switch,INPUT);

Serial.begin(9600);

}

17

void loop() { int value=digitalRead(switch); Serial.println(value);

if(value==1)

{

digitalWrite(red,HIGH);

delay(500);

digitalWrite(red,LOW); digitalWrite(green,HIGH);

delay(500);

digitalWrite(green,LOW); digitalWrite(blue,HIGH);

delay(500);

digitalWrite(blue,LOW); digitalWrite(green,HIGH);

delay(500);

digitalWrite(green,LOW);

}

else

{

digitalWrite(red,LOW);

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

}

}

18

Circuit to turn on multiple LEDs when the button is pressed and let it on when

Circuit to turn on multiple LEDs when the button is pressed and let it on when the button is released

04.Program to turn on multiple LEDs when the button is pressed and let it on when the button is released

int red=11,green=10,blue=9,switch=12,cnt=0;

void setup()

{

19

pinMode(red,OUTPUT);

pinMode(green,OUTPUT);

pinMode(blue,OUTPUT);

pinMode(switch,INPUT);

Serial.begin(9600);

}

void loop()

{

int btst=digitalRead(switch);

Serial.println(btst);

if(btst==1)

{

cnt=cnt+1;

switch(cnt)

{

case 1:

digitalWrite(red,HIGH);

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

break;

case 2:

digitalWrite(green,HIGH);

digitalWrite(blue,LOW);

digitalWrite(red,LOW);

break;

case 3:

digitalWrite(blue,HIGH);

digitalWrite(red,LOW);

digitalWrite(green,LOW);

break;

20

 

case 4:

digitalWrite(green,HIGH);

 

digitalWrite(red,LOW);

digitalWrite(blue,LOW);

break;

 

}

delay(500);

if(cnt>=4)

{

 

cnt=0;

 

}

}

else

{

 

cnt=0;

digitalWrite(red,LOW);

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

}

}

21

Circuit to fade up and fade down an LED 05.Program to fade up and fade down

Circuit to fade up and fade down an LED

05.Program to fade up and fade down an LED

int i,j,level,red=9;

void setup()

{

}

void loop() {

for(i=0;i<=255;i++)

22

{

level=i; analogWrite(red,level);

}

delay(10);

for(j=255;j>=0;j--)

{

level=j; analogWrite(red,level);

}

}

delay(10);

{ level=i; analogWrite(red,level); } delay(10); for(j=255;j>=0;j--) { level=j; analogWrite(red,level); } } delay(10); Circuit to fade up

Circuit to fade up and fade down multiple LEDs

23

06.Program to fade up and fade down multiple LEDs

int i,j,level,red=11,green=10,blue=9; void setup() { } void loop() {

for(i=0;i<=255;i++)

{

level=i; analogWrite(red,level);

}

delay(10);

for(j=255;j>=0;j--)

{

level=j; analogWrite(red,level);

}

delay(10);

for(i=0;i<=255;i++)

{

level=i; analogWrite(green,level);

}

delay(10);

for(j=255;j>=0;j--)

{

level=j; analogWrite(green,level);

}

delay(10);

for(i=0;i<=255;i++)

{

level=i; analogWrite(blue,level);

}

delay(10);

for(j=255;j>=0;j--)

{

level=j; analogWrite(blue,level);

}

}

delay(10);

24

Circuit to fade up an LED using potentiometer 7.Program to fade up an LED using potentiometer

Circuit to fade up an LED using potentiometer

7.Program to fade up an LED using potentiometer

int i,j,red=9;

void setup()

{

Serial.begin(9600);

}

void loop()

25

{

 

i=analogRead(A5);

Serial.print(i);

j=map(i,0,1023,0,255);

Serial.print('\t');

Serial.print(j);

Serial.println();

analogWrite(red,j);

}

26

Circuit to blink LED and produce sound of the buzzer of an ambulance 8. Program to

Circuit to blink LED and produce sound of the buzzer of an ambulance

8. Program to blink LED and produce sound of the buzzer of an ambulance

int red=10,green=9,buz=8;

void setup()

{

pinMode(buz,OUTPUT);

pinMode(red,OUTPUT);

pinMode(green,OUTPUT);

}

27

void loop()

{

tone(buz,500);

digitalWrite(red,HIGH);

digitalWrite(green,LOW);

delay(500);

tone(buz,700);

digitalWrite(green,HIGH);

digitalWrite(red,LOW);

delay(500);

}

void loop() { tone(buz,500); digitalWrite(red,HIGH); digitalWrite(green,LOW); delay(500); tone(buz,700); digitalWrite(green,HIGH); digitalWrite(red,LOW); delay(500); } Circuit to produce the

Circuit to produce the sound of siren

28

9.Program to produce the sound of siren

int freq,buz=8;

void setup()

{

 

pinMode(buz,OUTPUT);

}

void loop()

{

 

for(freq=500;freq<=1500;freq+=10)

{

 

tone(buz,freq);

delay(10);

}

 

for(freq=1500;freq>=500;freq-=10)

{

 

tone(buz,freq);

delay(10);

}

}

29

Circuit to fade up and fade down an LED using switch button and let it on

Circuit to fade up and fade down an LED using switch button and let it on the same intensity when the switch is released

10.Program to fade up and fade down an LED using switch button and let it on the same intensity when the switch is released

int i=0,flag=1,red=9,switch=12,btst; void setup() {

pinMode(red,OUTPUT); pinMode(switch,INPUT);

Serial.begin(9600);

}

void loop()

{

btst=digitalRead(switch);

30

Serial.println(btst); if(btst==1) { if(flag==1) { i++; if(i==255) { flag=0; } } else { i--; if(i==0) flag=1;
Serial.println(btst);
if(btst==1)
{
if(flag==1)
{
i++;
if(i==255)
{
flag=0;
}
}
else
{
i--;
if(i==0)
flag=1;
}
}
analogWrite(red,i);
delay(10);
}
31
Circuit to fade up and fade down multiple LEDs using switch button and let it on

Circuit to fade up and fade down multiple LEDs using switch button and let it on the same intensity when the switch is released.

11.Program to fade up and fade down multiple LEDs using switch button and let it on the same intensity when the switch is released.

int i=0,flag=1,btst,cnt=0; int bulb[]={11,10,9,10}; void setup() {

pinMode(9,OUTPUT);

pinMode(10,OUTPUT);

pinMode(11,OUTPUT);

pinMode(12,INPUT);

32

Serial.begin(9600);

}

void loop() {

btst=digitalRead(12);

if(btst==1)

{

if(flag==1)

 

{

i++;

if(i==255)

{

 

flag=0;

}

}

else

{

i--;

 

if(i==0)

{

 

flag=1;

cnt++;

digitalWrite(bulb[cnt-1],LOW);

 

}

}

} Serial.print(btst); Serial.print(‘\t’); Serial.println(i);

delay(10);

analogWrite(bulb[cnt],i);

 

if(cnt==4)

{

cnt=0;

}

}

33

Circuit to spin the DC motor using potentiometer 12.Program to spin the DC motor using potentiometer

Circuit to spin the DC motor using potentiometer

12.Program to spin the DC motor using potentiometer

int i,mtr;

void setup()

{

Serial.begin(9600);

}

34

void loop() { i=analogRead(A5); Serial.print(i); mtr=map(i,0,1023,0,255); Serial.print('\t'); Serial.print(i); Serial.println(); analogWrite(A4,mtr); } 35
void loop()
{
i=analogRead(A5);
Serial.print(i);
mtr=map(i,0,1023,0,255);
Serial.print('\t');
Serial.print(i);
Serial.println();
analogWrite(A4,mtr);
}
35
Circuit to display Hello World on the screen of LCD 13.Program to display Hello World on

Circuit to display Hello World on the screen of LCD

13.Program to display Hello World on the screen of LCD

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 8, 7, 4, 3, 2);

void setup()

{

lcd.begin(16, 2);

36

lcd.print("hello, world!");

}

void loop()

{

lcd.setCursor(0,1);

lcd.print(millis() / 1000);

}

37

Circuit of tank level indicator using potentiometer 14.Program to design tank level indicator using potentiometer int

Circuit of tank level indicator using potentiometer

14.Program to design tank level indicator using potentiometer

int value,level,i,j,freq,red=11,green=10,blue=9,buz=8; void setup() {

pinMode(red,OUTPUT); pinMode(green,OUTPUT); pinMode(blue,OUTPUT); pinMode(buz,OUTPUT);

Serial.begin(9600);

38

Serial.println();

Serial.print("Value");

}

void loop() { Serial.println();

value=analogRead(A5);

Serial.print(value);

Serial.print('\t');

noTone(buz);

if(value<=10)

{

Serial.print("Empty"); digitalWrite(red,HIGH);

tone(buz,700);

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

}

if(value>10&&value<=200)

{

Serial.print("Low Level"); digitalWrite(red,HIGH);

tone(buz,700);

delay(500);

digitalWrite(red,LOW); noTone(buz);

delay(500);

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

}

if(value>200&&value<=450)

{

Serial.print("Low Medium");

for(i=0;i<=255;i++)

{

level=i; analogWrite(blue,level);

}

delay(10);

for(j=255;j>=0;j--)

{

level=j; analogWrite(blue,level);

}

delay(10);

digitalWrite(red,LOW);

digitalWrite(green,LOW);

39

}

if(value>450&&value<=550)

{

Serial.print("Medium");

digitalWrite(green,HIGH);

digitalWrite(red,LOW);

digitalWrite(blue,LOW);

}

if(value>550&&value<=800)

{

Serial.print("Upper Medium");

for(i=0;i<=255;i++)

{

level=i; analogWrite(blue,level);

}

delay(10);

for(j=255;j>=0;j--)

{

level=j; analogWrite(blue,level);

}

delay(10);

digitalWrite(green,HIGH);

digitalWrite(red,LOW);

}

if(value>800&&value<=1000)

{

Serial.print("High Level"); digitalWrite(red,HIGH); digitalWrite(green,HIGH);

tone(buz,700);

delay(500);

digitalWrite(red,LOW); digitalWrite(green,LOW); noTone(buz);

delay(500);

digitalWrite(blue,LOW);

}

if(value>1000)

{

Serial.print("Full"); digitalWrite(red,HIGH);

for(freq=500;freq<=900;freq+=10)

{

tone(buz,freq);

}

delay(10);

for(freq=900;freq>=500;freq-=10)

{

40

tone(buz,freq); delay(10); } digitalWrite(green,LOW); digitalWrite(blue,LOW); } } 41
tone(buz,freq);
delay(10);
}
digitalWrite(green,LOW);
digitalWrite(blue,LOW);
}
}
41
Circuit to sweep the Servo Motor 15.Program to sweep the Servo Motor #include <Servo.h> Servo myservo;

Circuit to sweep the Servo Motor

15.Program to sweep the Servo Motor

#include <Servo.h>

Servo myservo;

int pos = 0;

void setup()

42

{

Serial.begin(9600);

myservo.attach(9);

}

void loop()

{

for(pos = 0; pos <= 180; pos += 1)

{

 

myservo.write(pos);

Serial.println(pos);

delay(15);

}

for(pos = 180; pos>=0; pos-=1)

{

 

myservo.write(pos);

Serial.println(pos);

delay(15);

}

}

43

Circuit to sweep the Servo Motor using potentiometer (knob) 16.Program to sweep the Servo Motor using

Circuit to sweep the Servo Motor using potentiometer (knob)

16.Program to sweep the Servo Motor using potentiometer (knob)

#include <Servo.h>

Servo myservo;

int val;

void setup()

44

{

myservo.attach(9);

}

void loop()

{

val = analogRead(A5);

val = map(val, 0, 1023, 0, 180);

myservo.write(val);

}

delay(15);

45

Circuit to sweep the Servo Motor using switch knob and let it be on the same

Circuit to sweep the Servo Motor using switch knob and let it be on the same position when the switch is released.

17.Program to sweep the Servo Motor using switch knob and let it be on the same position when the switch is released.

int value,flag=1,swt=12;

#include <Servo.h> Servo myservo; int pos = 0;

46

void setup() {

 
 

Serial.begin(9600);

myservo.attach(9);

pinMode(swt,INPUT);

}

void loop()

{

 

value=digitalRead(swt); Serial.print(value); Serial.print('\t');

if(value==1)

{

if(flag==1)

{

 

pos++;

if(pos==180)

{

flag=0;

}

 

}

else

{

 

pos--;

if(pos==0)

{

flag=1;

}

 

}

myservo.write(pos);

Serial.print(pos);

}

else

{

Serial.print(pos);

}

Serial.println();

delay(15);

}

47

Circuit to sweep the Servo Motor using switch knob and let it be on the same

Circuit to sweep the Servo Motor using switch knob and let it be on the same position when the switch is released and count the number of times when the switch is off and display the motor position.

18.Program to sweep the Servo Motor using switch knob and let it be on the same position when the switch is released and count the number of times when the switch is off and display the motor position.

#include <Servo.h> Servo myservo; int value,flag=1,cnt=0,pos=0,last_val,swt=12;

48

void setup() {

 
 

Serial.begin(9600);

myservo.attach(9);

}

void loop()

{

 

value=digitalRead(swt); Serial.print(value); Serial.print('\t');

if(value==1)

{

if(flag ==1)

{

 

pos++;

if(pos==180)

{

flag=0;

}

 

}

else

{

 

pos--;

if(pos==0)

{

flag=1;

}

 

}

myservo.write(pos);

} last_val=digitalRead(swt);

if(last_val<1)

{

cnt=cnt+1;

Serial.print(pos);

Serial.print("\t");

Serial.print(cnt);

}

Serial.println();

delay(15);

}

49

Circuit of galvanometer with reference position= 90 19.Program to design the galvanometer with reference position=90 #include

Circuit of galvanometer with reference position= 90

19.Program to design the galvanometer with reference position=90

#include <Servo.h> Servo myservo; int pos=90,flag=1,value,toggle=0,swt=12;

void setup()

{

50

myservo.attach(9);

pinMode(swt,INPUT);

Serial.begin(9600);

}

void loop()

{

value=digitalRead(swt); Serial.print(value); Serial.print(“\t”);

if(value==1)

 

{

 

if(flag==1)

{

f1();

}

else

{

f2();

}

toggle=1;

}

else

{

 

if(toggle==1)

{

toggle=0;

if(flag==1)

 

flag=0;

 

else

 

flag=1;

 

}

go_to_90();

}

}

void f1()

{

if(pos<180)

 

pos++; myservo.write(pos); Serial.print(pos); Serial.print(“\t”);

delay(25);

}

void f2()

{

if(pos>0)

 
 

pos--;

myservo.write(pos);

 

Serial.print(pos);

Serial.print(“\t”);

51

delay(25); } void go_to_90() { if(pos>90) pos--; else if(pos<90) pos++; myservo.write(pos); Serial.print(pos); Serial.println(); delay(25); } 52
delay(25);
}
void go_to_90()
{
if(pos>90)
pos--;
else if(pos<90)
pos++;
myservo.write(pos);
Serial.print(pos);
Serial.println();
delay(25);
}
52

SENSOR DESIGN PROJECTS

SENSOR DESIGN PROJECTS Circuit to fade up an LED using LDR (Light Dependent Resistance) 01.Program to

Circuit to fade up an LED using LDR (Light Dependent Resistance)

01.Program to fade up an LED using LDR (Light Dependent Resistance)

int i,j,red=9;

void setup()

{

53

Serial.begin(9600);

}

void loop()

{

i=analogRead(A5);

Serial.print(i);

j=map(i,0,800,0,255);

Serial.print('\t');

Serial.print(j);

Serial.println();

analogWrite(red,j);

}

54

Circuit to glow an LED according to the range of an LDR 02.Program to glow an

Circuit to glow an LED according to the range of an LDR

02.Program to glow an LED according to the range of an LDR

int i,j,red=9;

void setup()

{

Serial.begin(9600);

}

void loop() {

i=analogRead(A5);

Serial.print(i);

55

if(i<200) { Serial.print('\t'); Serial.print("Dark"); Serial.println(); } if(i>=200&&i<=400) { Serial.print('\t'); Serial.print("Intermediate"); Serial.println(); } if(i>400&&i<=600) { Serial.print('\t'); Serial.print("Medium");
if(i<200)
{
Serial.print('\t');
Serial.print("Dark");
Serial.println();
}
if(i>=200&&i<=400)
{
Serial.print('\t');
Serial.print("Intermediate");
Serial.println();
}
if(i>400&&i<=600)
{
Serial.print('\t');
Serial.print("Medium");
Serial.println();
}
if(i>600)
{
Serial.print('\t');
Serial.print("Bright");
Serial.println();
}
analogWrite(red,i);
}
56
Circuit to design an indicator using LDR 03.Program to design an indicator using LDR int i,j,red=11,green=10,blue=9,buz=8;

Circuit to design an indicator using LDR

03.Program to design an indicator using LDR

int i,j,red=11,green=10,blue=9,buz=8; void setup() {

pinMode(red,OUTPUT); pinMode(green,OUTPUT); pinMode(blue,OUTPUT); pinMode(buz,OUTPUT);

Serial.begin(9600);

}

void loop()

{

57

i=analogRead(A0);

Serial.print(i);

if(i<200)

{

Serial.print('\t'); Serial.print("Dark"); Serial.println(); analogWrite(red,i);

tone(buz,300);

delay(500);

noTone(buz);

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

}

if(i>400&&i<=600)

{

Serial.print('\t');

Serial.print("Medium");

Serial.println();

analogWrite(blue,i);

digitalWrite(green,LOW);

digitalWrite(red,LOW);

}

if(i>600)

{

Serial.print('\t'); Serial.print("Bright"); Serial.println(); analogWrite(green,i);

tone(buz,700);

delay(500);

noTone(8);

digitalWrite(blue,LOW);

digitalWrite(red,LOW);

}

}

58

Circuit to obtain the temperature in diferent scales using temperature sensor 59

Circuit to obtain the temperature in diferent scales using temperature sensor

59

04.Program to obtain the temperature in diferent scales using temperature sensor

int value,celsius,kelvin;

float far,cons=0.48828125;

void setup()

{

Serial.begin(9600);

Serial.println();

Serial.print("value\tCel\tFahr\tKelvin");

}

void loop()

{

Serial.println();

value=analogRead(A5);

Serial.print(value);

celsius=value*cons;

Serial.print('\t');

Serial.print(celsius);

far=((9.0/5)*celsius)+32;

Serial.print('\t');

Serial.print(far);

kelvin=celsius +273;

Serial.print('\t');

Serial.print(kelvin);

Serial.println();

}

60

Circuit of temperature alarm indicator 61

Circuit of temperature alarm indicator

61

05.Program to design a temperature alarm indicator

int value,celsius,level,i,j,freq,red=11,green=10,blue=9,buz=8; float cons=0.48828125; void setup() {

pinMode(red,OUTPUT); pinMode(green,OUTPUT); pinMode(blue,OUTPUT); pinMode(buz,OUTPUT);

Serial.begin(9600);

Serial.println();

Serial.print("value\tCel");

}

void loop() { Serial.println();

value=analogRead(A5);

Serial.print(value);

celsius=value*cons;

Serial.print('\t');

Serial.print(celsius);

Serial.print('\t');

noTone(buz);

if(celsius>=40)

{

Serial.print("Excess Heat"); digitalWrite(red,HIGH);

tone(buz,900);

delay(500);

noTone(buz);

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

}

if(celsius>=35&&celsius<40)

{

Serial.print("Warm");

tone(buz,900);

digitalWrite(blue,HIGH); digitalWrite(red,HIGH);

delay(500);

digitalWrite(red,LOW); noTone(buz);

delay(500);

digitalWrite(green,LOW);

}

if(celsius>=27&&celsius<35)

{

Serial.print("Moderate");

62

for(i=0;i<=255;i++)

{ level=i; analogWrite(blue,level);

}

delay(10);

for(j=255;j>=0;j--)

{

level=j; analogWrite(blue,level);

}

delay(10);

digitalWrite(red,LOW);

digitalWrite(green,LOW);

}

if(celsius<27)

{

Serial.print("Cold"); digitalWrite(green,HIGH);

delay(500);

digitalWrite(green,LOW);

delay(500);

for(freq=500;freq<=900;freq+=10)

{

tone(buz,freq);

}

delay(10);

for(freq=900;freq>=500;freq-=10)

{

tone(buz,freq);

}

delay(10);

digitalWrite(red,LOW);

digitalWrite(blue,LOW);

}

}

63

Circuit to observe the values of gas sensor using different gases 64

Circuit to observe the values of gas sensor using different gases

64

06.Program to observe the values of gas sensor using different gases

int value;

void setup()

{

Serial.begin(9600);

Serial.println();

Serial.print("value");

}

void loop()

{

Serial.println();

value=analogRead(A0);

Serial.print(value);

}

65

MINI PROJECTS

MINI PROJECTS Circuit to design a “HOME AUTOMATION SYSTEM” 01.Program to design a “HOME AUTOMATION SYSTEM”

Circuit to design a “HOME

AUTOMATION

SYSTEM”

01.Program to design a “HOME

AUTOMATION

SYSTEM”

int ld,ldr,gas,value,celsius,mtr,red=15,blue=16,buz=9; float cons=0.48828125;

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 8, 7, 4, 3, 2);

void setup() { pinMode(red,OUTPUT); pinMode(blue,OUTPUT); pinMode(buz,OUTPUT);

Serial.begin(9600);

lcd.begin(16, 2); Serial.println(); Serial.print(“LDR\tGAS\tTEMP”);

}

66

void loop() { Serial.println();

ld=analogRead(A5);

Serial.print(ld);

gas=analogRead(A0);

Serial.print('\t'); Serial.print(gas);

value=analogRead(A3);

 

celsius=value*cons; Serial.print('\t'); Serial.print(celsius); Serial.print('\t'); noTone(buz);

if(ld<200)

{

analogWrite(blue,255);

 

digitalWrite(red,HIGH); lcd.setCursor(0, 0);

lcd.print("

Low Light

");

}

if(ld>=200&&ld<500)

{

ldr=map(ld,200,500,255,200);

analogWrite(blue,ldr); digitalWrite(red,LOW);

 

lcd.setCursor(0,0);

lcd.print("

");

}

if(ld>=500&&ld<800)

{

ldr=map(ld,500,800,150,0);

analogWrite(blue,ldr);

 

digitalWrite(red,LOW);

lcd.setCursor(0,0);

lcd.print("

");

}

if(gas>=300&&gas<500)

 

{

lcd.setCursor(0,0);

 

lcd.print("

CHECK GAS

");

digitalWrite(blue,LOW); digitalWrite(red,HIGH);

tone(buz,700);

delay(500);

digitalWrite(red,LOW); noTone(buz);

 

delay(500);

}

if(gas>=500)

{

67

lcd.setCursor(0,0);

lcd.print("

GAS LEAK

");

digitalWrite(blue,LOW); digitalWrite(red,HIGH);

tone(buz,700);

}

if(celsius>=27&&celsius<30)

{

lcd.setCursor(0,1);

lcd.print("COLD "); lcd.print(celsius); lcd.print(“°Celsius “);

mtr=map(value,27,30,30,100);

analogWrite(A4,mtr);

}

if(celsius>=30&&celsius<33)

{

lcd.setCursor(0,1);

lcd.print("WARM "); lcd.print(celsius); lcd.print(“°Celsius “);

mtr=map(value,30,33,100,255);

analogWrite(A4,mtr);

}

if(celsius>=33&&celsius<35)

{

lcd.setCursor(0,1);

lcd.print("HEAT “);

lcd.print(celsius); lcd.print(“°Celsius “); digitalWrite(blue,LOW); digitalWrite(red,HIGH);

tone(buz,900);

delay(500);

digitalWrite(red,LOW); noTone(buz);

delay(500);

}

if(celsius>=35)

{

lcd.setCursor(0,1);

lcd.print("FIRE ALERT "); lcd.print(celsius); lcd.print(“°C “); digitalWrite(blue,LOW); digitalWrite(red,HIGH);

}

tone(buz,900);

}

68

Circuit for “RAILWAY GATE CONTROL” 02. Program to design “RAILWAY GATE CONTROL” #include<Servo.h> #include <LiquidCrystal.h> LiquidCrystal

Circuit for “RAILWAY GATE CONTROL”

02.Program to design “RAILWAY GATE CONTROL”

#include<Servo.h> #include <LiquidCrystal.h> LiquidCrystal lcd(12, 8, 7, 4, 3, 2);

Servo myservo; int value,pos=90,flag=1,swt=9,buz=6,red=14,green=15,blue=16;

void setup() {

Serial.begin(9600);

69

lcd.begin(16, 2);

myservo.attach(5);

pinMode(buz,OUTPUT);

pinMode(red,OUTPUT);

pinMode(green,OUTPUT);

pinMode(blue,OUTPUT);

pinMode(swt,INPUT);

}

void loop()

{

value=digitalRead(swt); Serial.print(value); Serial.print("\t"); noTone(buz);

if(value==1)

{

if(flag=1)

{

if(pos>0)

{

pos--; myservo.write(pos); Serial.print(pos); Serial.println();

 

delay(5);

lcd.setCursor(0, 0);

 

lcd.print("

Train Alert ");

digitalWrite(red,LOW);

 

digitalWrite(green,LOW); digitalWrite(blue,HIGH);

tone(buz,700);

 

delay(100);

noTone(buz);

delay(100);

}

if(pos==0)

{

digitalWrite(green,LOW);

digitalWrite(blue,LOW);

 

digitalWrite(red,HIGH);

tone(buz,700);

lcd.setCursor(0, 0);

lcd.print("

Train Pass

");

}

}

flag=0;

}

70

else

{

if(pos<90)

{

 

pos++;

myservo.write(pos);

Serial.print(pos);

Serial.println();

delay(5);

lcd.setCursor(0, 0);

lcd.print("

Train Alert ");

digitalWrite(red,LOW); digitalWrite(green,LOW); digitalWrite(blue,HIGH);

tone(buz,700);

delay(100);

noTone(buz);

delay(100);

}

if(pos==90)

 

{

 

digitalWrite(green,HIGH); digitalWrite(blue,LOW); digitalWrite(red,LOW); lcd.setCursor(0, 0); lcd.print(" Vehicles pass ");

}

flag=1;

}

Serial.println();

}

71

Circuit for “AUTOMATIC RAILWAY GATE CONTROL” 03. Program to design “AUTOMATIC RAILWAY GATE CONTROL” #include <Servo.h>

Circuit for “AUTOMATIC RAILWAY GATE CONTROL”

03.Program to design “AUTOMATIC RAILWAY GATE CONTROL”

#include <Servo.h> Servo myservo; int red=14,green=15,blue=16,sw1=9,ir=3,buz=6; int flag=1,pos=90,k1,k2; int gt,cnt=0; int prev1=0,now1=0,prev2=0,now2=0; int down=0;

72

void setup() { myservo.attach(5); pinMode(sw1,INPUT); pinMode(ir,INPUT); pinMode(red,OUTPUT); pinMode(green,OUTPUT); pinMode(blue,OUTPUT); Serial.begin(9600); } void loop() { if(pos>=90) {
void setup()
{
myservo.attach(5);
pinMode(sw1,INPUT);
pinMode(ir,INPUT);
pinMode(red,OUTPUT);
pinMode(green,OUTPUT);
pinMode(blue,OUTPUT);
Serial.begin(9600);
}
void loop()
{
if(pos>=90)
{
digitalWrite(green,HIGH);
digitalWrite(blue,LOW);
digitalWrite(red,LOW);
noTone(buz);
}
else if(pos<=0)
{
digitalWrite(red,HIGH);
digitalWrite(blue,LOW);
digitalWrite(green,LOW);
tone(buz,700);
}
else
{
digitalWrite(blue,HIGH);
digitalWrite(red,LOW);
digitalWrite(green,LOW);
tone(buz,900);
delay(100);
noTone(buz);
delay(50);
}
Serial.print(pos);
Serial.print("\t");
k1=digitalRead(sw1);
k2=digitalRead(ir);
Serial.print(k1);
Serial.print("\t");
Serial.print(k2);
Serial.print("\t");
if(cnt==0)
{
if(k1==1)
{
sw1=9;
73

ir=3;

}

else if(k2==1)

{

ir=9;

sw1=3;

int tmp=k1;

k1=k2;

k2=tmp;

}

}

prev1=now1;

prev2=now2;

now1=k1;

now2=k2;

if(prev1!=now1)

cnt++;

if(prev2!=now2)

cnt--;

// COUNTED

if(cnt>0)

down=1;

else

down=0;

//decided to go down

if(down==1)

{

if(pos>0)

pos--;

}

if(down==0)

{

if(pos<90)

pos++;

} myservo.write(pos);

delay(15);

Serial.println(cnt/2)

}

74

ADVANTAGES OF EMBEDDED SYSTEM

Price- A Computer used to be something only governments or big

companies could own. Embedded Systems make it possible for electronics to be affordable and efficient ,so that we can place them in virtually anything and everything. Size and Weight- Before integrated circuits, we could even dream of computers smaller than their living room, much less the palm of their hands. Now, we can have embedded systems in things even smaller than our palms and they continue to become smaller and lighter.

Productivity- An Embedded System does only one thing, and it can do it efficiently. For many repetitive tasks, such as the many mentioned

previously, this is enough. It’s simply not a good use of resources to

have an entire general purpose computer in something that only does one thing.

High reliability

Fast Operations

Easy to manufacture

Fewer interconnections

75

DISADVANTAGES OF EMBEDDED SYSTEM

1.Difficult to change configurations and features

Once an embedded system is deployed (or finalized), it will be difficult to change its configuration - both its hardware and software. Remote update of software is possible provided the capability is included. Hence, proper requirement analysis is a must before deployment. Hardware configuration change will be much trickier which may require existing boards be completely replaced.

  • 2. Issue of scalability

Because it is difficult to change configuration, an embedded system cannot be easily scaled up as demand/scope changes. Said so, embedded systems can be designed to scale up for example using expansion ports or networking etc. This means it must be decided before hand during design phase for scale up provisions.

  • 3. Limitation of hardware

With a limited memory or computing capability in most embedded systems, there is always a limitation (or an upper limit) on our software design(upgrade). Be always aware of "Memory" and "Speed".

  • 4. Applied for a specific purpose

By definition, embedded systems are constrained in their objectives. If it is decided to "rehash" an existing embedded system for a completely different purpose, it will normally result in significant change(s) in either or both its hardware or/and software

  • 5. Hard to maintain.

  • 6. Doesn’t evolve with technology improvement.

  • 7. Hard to carry files from one machine to another.

  • 8. Hard to backup embedded files.

76

FUTURE SCOPE OF ARDUINO

The Arduino board is for anyone who wants to build a basic level of intelligence into an object. Once programmed, it can read sensors, make simple decisions, and control myriad devices in the real world. Arduino was basically designed to make the process of using electronics in multidisciplinary projects more accessible. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environment. Arduino is used by all class of people in a different way. Some students use it in their projects, some using arduino for fun, some went out to become entreupreuners. This only shows how useful is this tiny device. Arduino is spreading rapidly across the globe .Arduino is actually an open source hardware project that can be programmed to read temperatures, control a motor, and sense touch. Thousands of projects have been done worldwide using this tiny little device. Some of which to mention are:

Simple room temperature readout

Interactive real-time auditory feedback system

GPS receiver Module

Ultrasonic Sensor

Infrared detectors

SONAR

Lie detector

Magnetic door lock

Seven segment LED display

77

CONCLUSION

Over the years, Arduino has went out to become a huge success and a common name among students. With Google deploying it, people’s imagination has went out to much higher level than before. A developer in the

annual GOOGLE IO conference said ―when Arduino and Android coming

together, this really proves ―”INFINITY EXISTS” in the future‖. A study on arduino and practical experiments on arduino must be added for UG courses of engineering, to help students to leverage their talents, and

imagination.

Before Arduino, the largest players in the design/hobbyist market segment were the PIC microcontroller family(made by Microchip) and the BASIC Stamp (made by Parallax). Since the introduction of the Arduino, other larger companies have tried to enter the hobbyist market, including Texas Instruments, and even Microsoft. However, the open-sourced tools of the Arduino and the size of its community are large barriers for new platforms to overcome.

Therefore, by using the Arduino we can put together both software and hardware .Arduino will be the most useful interface between the software and the hardware in future. In summary, this arduino concept is a good software hardware co-design practice.

78

BIBLIOGRAPHY

79