What are sensors???
A device which provides a usable output in response to
a specified measurand.
A sensor acquires a physical parameter
and converts it into a signal suitable for
processing (e.g. optical, electrical,
mechanical).
Real
world
Senso
r
Intelligent
system
Working:
Physical quantity
Electrical Signals
Microcontroller
Need for Sensors
 Sensors are omnipresent. They embedded
in our bodies, automobiles, airplanes,
cellular telephones, radios, chemical plants,
industrial plants and countless other
applications.
 Without the use of sensors, there would be
no automation !!
Criteria to choose a sensor:
1.Accuracy
2.Environmental Condition
3.Range
4.Resolution
5.Cost
6.Sensitivity
7.Availability
8.Lifetime
Types of Robotics sensors:
1. Environment sensors
2. Motion sensors
3. Touch sensors
4. Proximity sensors
5. IR sensors
Environmental sensors:
1.Temperature Sensors:
Temperature sensors appear in building, chemical
process plants, engines, appliances, computers, and many
other devices that require temperature monitoring
2.Pressure Sensors:
A pressure sensor measures pressure, typically of gases
or liquids.
3.Humidity Sensors:
Humidity sensing is very important in control systems
for industrial processes and human comfort.
Circuit diagram of IR sersor:
I R led
Photodiode
I R SENSOR
-
OPAMP
POT
GND
TO
MICROCONTROLLER
PIN
(LOGIC1)
1
+
vcc
Black line
I R led Photodiode
I R SENSOR
-
OPAMP
POT
GND
0
+
White line line
TO
MICROCONTROLLER
PIN
(LOGIC 0)
vcc
Instructions
 bit_is_set(PINx , Pin no.);
 bit_is_clear(PINx , Pin no.);
 Header File:
compat/deprecated.h
Before going into programming mode
lets learn to interface SWITCH :
 Instructions :
1. sbi(PORTX , Pin no.);
2. cbi(PORTX , Pin no.);
Ex : sbi ( PORTD, 7);
cbi ( PORTD, 7);
1. bit_is_set(PINX ,Pin no.);
2. bit_is_clear(PINX ,Pin no.);
Ex: bit_is_set(PIND,2);
bit_is_clear(PIND,2);
VCC
D2
VCC
Program:
 #define F_CPU 16000000
 #include <avr/io.h>
 #include <util/delay.h>
 #include<compat/deprecated.h>
int main(void)
 {
 DDRD=0b11110000;
 PORTD=0b00001111;
 while(1)
 {
 if(bit_is_clear(PIND,2))
 sbi(PORTD,6);
else
if(bit_is_clear(PIND,3))
sbi(PORTD,7);
else
cbi(PORTD,6);
cbi(PORTD,7);
}
}
else if(bit_is_clear(PIND,3))
sbi(PORTD,7);
else
cbi(PORTD,6);
cbi(PORTD,7);
}
}

Sensors and Switches

  • 2.
    What are sensors??? Adevice which provides a usable output in response to a specified measurand. A sensor acquires a physical parameter and converts it into a signal suitable for processing (e.g. optical, electrical, mechanical). Real world Senso r Intelligent system
  • 3.
  • 4.
    Need for Sensors Sensors are omnipresent. They embedded in our bodies, automobiles, airplanes, cellular telephones, radios, chemical plants, industrial plants and countless other applications.  Without the use of sensors, there would be no automation !!
  • 5.
    Criteria to choosea sensor: 1.Accuracy 2.Environmental Condition 3.Range 4.Resolution 5.Cost 6.Sensitivity 7.Availability 8.Lifetime
  • 6.
    Types of Roboticssensors: 1. Environment sensors 2. Motion sensors 3. Touch sensors 4. Proximity sensors 5. IR sensors
  • 7.
    Environmental sensors: 1.Temperature Sensors: Temperaturesensors appear in building, chemical process plants, engines, appliances, computers, and many other devices that require temperature monitoring 2.Pressure Sensors: A pressure sensor measures pressure, typically of gases or liquids. 3.Humidity Sensors: Humidity sensing is very important in control systems for industrial processes and human comfort.
  • 8.
  • 9.
    I R led Photodiode IR SENSOR - OPAMP POT GND TO MICROCONTROLLER PIN (LOGIC1) 1 + vcc Black line
  • 10.
    I R ledPhotodiode I R SENSOR - OPAMP POT GND 0 + White line line TO MICROCONTROLLER PIN (LOGIC 0) vcc
  • 11.
    Instructions  bit_is_set(PINx ,Pin no.);  bit_is_clear(PINx , Pin no.);  Header File: compat/deprecated.h
  • 13.
    Before going intoprogramming mode lets learn to interface SWITCH :  Instructions : 1. sbi(PORTX , Pin no.); 2. cbi(PORTX , Pin no.); Ex : sbi ( PORTD, 7); cbi ( PORTD, 7); 1. bit_is_set(PINX ,Pin no.); 2. bit_is_clear(PINX ,Pin no.); Ex: bit_is_set(PIND,2); bit_is_clear(PIND,2); VCC D2 VCC
  • 14.
    Program:  #define F_CPU16000000  #include <avr/io.h>  #include <util/delay.h>  #include<compat/deprecated.h> int main(void)  {  DDRD=0b11110000;  PORTD=0b00001111;  while(1)  {  if(bit_is_clear(PIND,2))  sbi(PORTD,6); else if(bit_is_clear(PIND,3)) sbi(PORTD,7); else cbi(PORTD,6); cbi(PORTD,7); } }
  • 15.