EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Distance measurement using InfraRed sensor

Distance measurement using InfraRed sensor

|

Projects › Projects › Distance measurement using InfraRed sensor

  • This topic has 7 replies, 4 voices, and was last updated 12 years, 5 months ago by AJISH ALFRED.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • October 17, 2012 at 3:35 pm #1987
    Sanket Kulkarni
    Participant

     

    Hello, I'm performing one of the project mentioned above. I was working on the concept of the program and could'nt get along with this part of the program. If test_final was initialised already to 0 then why the conditional statement was made?
    Thank you in advance

    s=test_final/100;
    test_final=test_final%100;
    lcd_cmd(0x8a);
    if(s!=0)
    lcd_data(s+48);
    else
    lcd_cmd(0x06);
    s=test_final/10;
    test_final=test_final%10;
    lcd_data(s+48);
    lcd_data(test_final+48);

     

    October 18, 2012 at 6:12 am #8672
    AJISH ALFRED
    Participant

    Please mention the trouble that you are facing with the project.

    October 18, 2012 at 10:04 am #8673
    V.Thenmozhi
    Participant

    Dear sir

    can you kindly give me the remote controlled ground vehicle circuit.

    October 19, 2012 at 12:59 pm #8675
    AJISH ALFRED
    Participant

    Hi Thenmozhi,

    Find the link article in this website at.

    /contribution/unmanned-ground-vehicle-ugv-or-spycar

    The circuit of the same project might be helpful for you.

    October 21, 2012 at 12:36 pm #8680
    Sanket Kulkarni
    Participant

    I understood the program and implemented it.. still I’m not getting any output on lcd, its just glowing.

    I heard about pull-up resistor is required to connect to port0 of micro-controller? What is it and how to connect?

    October 23, 2012 at 6:45 am #8683
    AJISH ALFRED
    Participant

    Hi,

    A pull-up or pull-down resistor is basically used to preset a value (logic high or logic low) at any pin.

    Find the discussion about pull-up and pull-down concept in this forum itself.

     

    A pull-up is done by connecting a pin to VCC through a resistor (normally 1K) and a pull down is done by connnecting a pin to ground through a resistor (normally 1K). Pull-up make the preset voltage at the pin as logic high and pull-down make the preset voltage at the pin as logic low. We can change those voltages by writing a low or high respectievely.

    January 30, 2013 at 4:36 pm #9082
    Kausu T R
    Participant

     

    
    

     

    Hello sir, I’m performing one of the project  Distance measurement Distance measurement using InfraRed sensor. I was working on the concept of the program and could’nt get along with this part of the program.i am so confused this convert function.Because this HEX to ASCII conversion couldn’t understan me.Pls explain ths logic as early as possible….

    Thank you in advance…

     

    void convert()

    {

      int s;

      lcd_cmd(0x81); 

      delay(2);

      lcd_data_string(“output:”);

      s=test_final/100;

      test_final=test_final%100;

      lcd_cmd(0x8a);

      if(s!=0)

      lcd_data(s+48);

      else

      lcd_cmd(0x06);

      s=test_final/10;

      test_final=test_final%10;

      lcd_data(s+48);

      lcd_data(test_final+48);

      lcd_data(‘ ‘);

      if(shift>16)

       {

          lcd_cmd(0xc0+(shift-1));

          lcd_data_string(” “);

          shift=0;

       }

      lcd_cmd(0xc0+(shift-1));

      lcd_data(‘ ‘);

      lcd_cmd(0xc0+shift);

      lcd_data_string(“CALIBRATE IT”);

      delay(30);

    }

     

    January 31, 2013 at 6:17 pm #9084
    AJISH ALFRED
    Participant

     

    Hi Kausu,

    It is very difficult to comment on the working of this piece of code only since we don’t have the details of your project and the complete code.

    What I understood is that, the “convert()” function does the following operations.

    -displays a string “output:”

    -it extracts the digits from the digit integer “test_final”

    -store the digit into two seperate integrs

    -convert the integrs into characters, so that they can be displayed on the lcd

    -checks whether the number of characters exeeds the number which can be displayed on the first line

    -if exeeds go to the next line

    -and print “CALIBERATE IT”

     

    Printing an integer on LCD:

     

    You assume a  value to test_final variable, say 567.

     

      s=test_final/100;                      //now s = 5

      lcd_data(s+48);                        // 48 is the ascii value of ‘0’ and 48+5 gives ascii value of ‘5’

                                                        //and hence print ‘5’ on LCD

     

    similary it does for 6 and 7.

     

    Have I made it more complex for you?? Take sample value and analyse yourself.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Raise your hand if your car had one of these: July 8, 2025
  • Tektronix 2235 channel 1 trace unstable July 8, 2025
  • How to make string LEDs? July 8, 2025
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz July 8, 2025
  • The Analog Gods Hate Me July 8, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise