SlideShare a Scribd company logo
1 of 6
R-tist
R-tist
12/6/2012        i-SKY TECHNOLOGIES   2
SHARP SENSOR
     IN AVR ADC IS IS INBUILT SO THERE IS NO NEED OF
      EXTERNAL CIRCUIT.
     THIS SHARP SENSOR HAS RANGE OF ONLY 10 TO 80
      CM.
     WHEN IT IS OUT OF RANGE THAN IT GIVE RANDOM
      VALUE OF DISTANCE.
     DUE TO THIS IN PROGRAM WE USE 0 VALUE WHEN IT
      IS OUT OF RANGE.




R-tist
  12/6/2012        i-SKY TECHNOLOGIES                   3
FORMULA FOR DISTANCE
CALCULATION


sensorValue = (6787 / (sensorValue - 3)) - 4;



12/6/2012    R-tist   i-SKY TECHNOLOGIES        4
PROGRAM TO SHOW DIS. ON
SERIAL PORT
  #include <LiquidCrystal.h>          void loop() {
  const int analogInPin = 0;          sensorValue =
  float sensorValue = 0;                 analogRead(analogInPin);
  LiquidCrystal lcd(4, 7, 8, 9,           lcd.setCursor(0, 0);
   12, 13);                               if(sensorValue<80)
  void setup() {                           sensorValue=0;
  lcd.begin(16, 2);                       else
  }                                        sensorValue = (6787 /
                                          (sensorValue - 3)) - 4;
                                             lcd.print(sensorValue);
                                           lcd.print(" ");
                                          delay(100);
                                         }

12/6/2012          R-tist      i-SKY TECHNOLOGIES                       5
Q-: WRITE A PROGRAM TO
   DEMONSTRATE WHEN DISTANCE
   OF OBJECT IS LESS THAN 40 CM
   THAN RED LED OF RGB IS GLOW
   WHEN IT IS 40-50 GREEN LED IS
   GLOW AND WHEN IT IS GREATER
   THAN 50 BLUE LED GLOW
12/6/2012   R-tist   i-SKY TECHNOLOGIES   6

More Related Content

Viewers also liked

Viewers also liked (12)

Bulimia Nervosa
Bulimia NervosaBulimia Nervosa
Bulimia Nervosa
 
near transfer
near transfer near transfer
near transfer
 
Lm35
Lm35Lm35
Lm35
 
Kma week 6_knowledge_transfer_type
Kma week 6_knowledge_transfer_typeKma week 6_knowledge_transfer_type
Kma week 6_knowledge_transfer_type
 
PHYLUM CNIDARIA
PHYLUM CNIDARIAPHYLUM CNIDARIA
PHYLUM CNIDARIA
 
LITHUANIA
LITHUANIALITHUANIA
LITHUANIA
 
Essentialsof chineseacupuncture
Essentialsof chineseacupunctureEssentialsof chineseacupuncture
Essentialsof chineseacupuncture
 
Cromoterapia
CromoterapiaCromoterapia
Cromoterapia
 
Empresas de servicios
Empresas de serviciosEmpresas de servicios
Empresas de servicios
 
Pato
PatoPato
Pato
 
Pato
PatoPato
Pato
 
Razones trigonométricas de ángulos agudos
Razones trigonométricas de ángulos agudosRazones trigonométricas de ángulos agudos
Razones trigonométricas de ángulos agudos
 

Similar to Sharp sensor

Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptsatish 486
 
Snake Game on FPGA in Verilog
Snake Game on FPGA in VerilogSnake Game on FPGA in Verilog
Snake Game on FPGA in VerilogKrishnajith S S
 
Comprehensive acquisition management methodology rev6
Comprehensive acquisition  management methodology   rev6Comprehensive acquisition  management methodology   rev6
Comprehensive acquisition management methodology rev6clifpt
 
updated resume ---III
updated resume ---IIIupdated resume ---III
updated resume ---IIIshrutinalla
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuatorsEueung Mulyana
 
Embedded System Practical manual (1)
Embedded System Practical manual (1)Embedded System Practical manual (1)
Embedded System Practical manual (1)Niraj Bharambe
 
Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/OJune-Hao Hou
 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogsumedh23
 
LD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdf
LD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdfLD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdf
LD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdfSomnathKhamaru1
 
PASSWORD DOOR LOCK SYSTEM.pptx
PASSWORD DOOR LOCK SYSTEM.pptxPASSWORD DOOR LOCK SYSTEM.pptx
PASSWORD DOOR LOCK SYSTEM.pptxsonalshitole
 
Modeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationModeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationEMA Design Automation
 
Writing more complex models (continued)
Writing more complex models (continued)Writing more complex models (continued)
Writing more complex models (continued)Mohamed Samy
 

Similar to Sharp sensor (20)

Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor ppt
 
Direct analog
Direct analogDirect analog
Direct analog
 
Eye blink sensing
Eye blink sensingEye blink sensing
Eye blink sensing
 
Anup2
Anup2Anup2
Anup2
 
Snake Game on FPGA in Verilog
Snake Game on FPGA in VerilogSnake Game on FPGA in Verilog
Snake Game on FPGA in Verilog
 
Comprehensive acquisition management methodology rev6
Comprehensive acquisition  management methodology   rev6Comprehensive acquisition  management methodology   rev6
Comprehensive acquisition management methodology rev6
 
Alp lcd
Alp lcdAlp lcd
Alp lcd
 
updated resume ---III
updated resume ---IIIupdated resume ---III
updated resume ---III
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
 
Embedded System Practical manual (1)
Embedded System Practical manual (1)Embedded System Practical manual (1)
Embedded System Practical manual (1)
 
EEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdfEEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdf
 
Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/O
 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilog
 
Satellite based SCADA systems
Satellite based SCADA systemsSatellite based SCADA systems
Satellite based SCADA systems
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
LD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdf
LD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdfLD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdf
LD208_SLAMTEC_rplidar_datasheet_A2M8_v2.1_en.pdf
 
PASSWORD DOOR LOCK SYSTEM.pptx
PASSWORD DOOR LOCK SYSTEM.pptxPASSWORD DOOR LOCK SYSTEM.pptx
PASSWORD DOOR LOCK SYSTEM.pptx
 
Modeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationModeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice Simulation
 
Writing more complex models (continued)
Writing more complex models (continued)Writing more complex models (continued)
Writing more complex models (continued)
 
Mikroc gps
Mikroc gpsMikroc gps
Mikroc gps
 

More from Atul Uttam

More from Atul Uttam (16)

Sms based patient report from remote place1
Sms based patient report from remote place1Sms based patient report from remote place1
Sms based patient report from remote place1
 
Rfid
RfidRfid
Rfid
 
Id 12-datasheet
Id 12-datasheetId 12-datasheet
Id 12-datasheet
 
Max 232
Max 232Max 232
Max 232
 
Arduino shift in
Arduino   shift inArduino   shift in
Arduino shift in
 
Multiplexer
MultiplexerMultiplexer
Multiplexer
 
Din 4
Din 4Din 4
Din 4
 
Motor driver
Motor driverMotor driver
Motor driver
 
Din 4
Din 4Din 4
Din 4
 
Rgb led strip tutorial
Rgb led strip tutorialRgb led strip tutorial
Rgb led strip tutorial
 
Lcd programing and pin configuration
Lcd programing and pin configurationLcd programing and pin configuration
Lcd programing and pin configuration
 
R tist
R tistR tist
R tist
 
Day 2
Day 2Day 2
Day 2
 
Led program
Led programLed program
Led program
 
Day1
Day1Day1
Day1
 
Arduino
ArduinoArduino
Arduino
 

Sharp sensor

  • 2. R-tist 12/6/2012 i-SKY TECHNOLOGIES 2
  • 3. SHARP SENSOR  IN AVR ADC IS IS INBUILT SO THERE IS NO NEED OF EXTERNAL CIRCUIT.  THIS SHARP SENSOR HAS RANGE OF ONLY 10 TO 80 CM.  WHEN IT IS OUT OF RANGE THAN IT GIVE RANDOM VALUE OF DISTANCE.  DUE TO THIS IN PROGRAM WE USE 0 VALUE WHEN IT IS OUT OF RANGE. R-tist 12/6/2012 i-SKY TECHNOLOGIES 3
  • 4. FORMULA FOR DISTANCE CALCULATION sensorValue = (6787 / (sensorValue - 3)) - 4; 12/6/2012 R-tist i-SKY TECHNOLOGIES 4
  • 5. PROGRAM TO SHOW DIS. ON SERIAL PORT  #include <LiquidCrystal.h>  void loop() {  const int analogInPin = 0;  sensorValue =  float sensorValue = 0; analogRead(analogInPin);  LiquidCrystal lcd(4, 7, 8, 9,  lcd.setCursor(0, 0); 12, 13);  if(sensorValue<80)  void setup() {  sensorValue=0;  lcd.begin(16, 2);  else  }  sensorValue = (6787 / (sensorValue - 3)) - 4;  lcd.print(sensorValue);  lcd.print(" ");  delay(100);  } 12/6/2012 R-tist i-SKY TECHNOLOGIES 5
  • 6. Q-: WRITE A PROGRAM TO DEMONSTRATE WHEN DISTANCE OF OBJECT IS LESS THAN 40 CM THAN RED LED OF RGB IS GLOW WHEN IT IS 40-50 GREEN LED IS GLOW AND WHEN IT IS GREATER THAN 50 BLUE LED GLOW 12/6/2012 R-tist i-SKY TECHNOLOGIES 6