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 / Object counting on conveyor system

Object counting on conveyor system

|

Microcontroller › 8051 › Object counting on conveyor system

  • This topic has 2 replies, 3 voices, and was last updated 8 years, 7 months ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • June 7, 2011 at 6:52 am #983
    praveen
    Participant

    Guys i m trying to count the no of objects passing in a conveyor belt. for that purpose i am using IR sensor. When sensor goes low it have increase the count by 1.
    Now the problem is in the debugger mode it increments the count properly. but while displaying in LCD it increment the count twice… 
    And i want to know whether i had followed correct procedure.. since i am new to this programming field. i had include my code below.

     

     

    P3 = 0x00;
    LED1 = 1;
    /* LCD initialization */
    InitializeLCD();

    /* Display project titles */
    DisplayProjectTitle();

    *ArrayBasePtr=&UserMessageStorage;

    EA = 1;
    EX0 = 1;
    IT0 = 1;

    while(True)
    {

    /* Serial bit transmissions */
    SerTx(TotalCount[0]);
    SerTx(TotalCount[1]);
    SerTx(TotalCount[2]);

    ArrayBasePtr=" TOTAL OBJECTS ";
    DisplayLCD(1,0,ArrayBasePtr);
    ArrayBasePtr=&TotalCount[0];
    DisplayLCD(2,5,ArrayBasePtr);
    TimeDelay(850);
    LCD_CLEAR();
    void Extint0 (void) interrupt 0
    {
    // IE0=0;
    value++;
    Count = value;

    UserMessageStorage[4]= Count/100;
    Count=(Count-(UserMessageStorage[4]*100));
    UserMessageStorage[4]+=0x30;

    UserMessageStorage[5]= Count/10;
    Count=(Count-(UserMessageStorage[5]*10));
    UserMessageStorage[5]+=0x30;

    UserMessageStorage[6]= Count%10;
    UserMessageStorage[6]+=0x30;

    TotalCount[0] = UserMessageStorage[4];
    TotalCount[1] = UserMessageStorage[5];
    TotalCount[2] = UserMessageStorage[6];

    ArrayBasePtr=" TOTAL OBJECTS ";
    DisplayLCD(1,0,ArrayBasePtr);
    ArrayBasePtr=&TotalCount[0];
    DisplayLCD(2,5,ArrayBasePtr);

    TimeDelay(850);
    LCD_CLEAR();
    }

     

    thanks for you help

    October 22, 2016 at 3:48 pm #14211
    GANEEV SINGH
    Participant

    Hi Praveen

    I do not see any problem in the code, according to the knowledge that I have. It could be related to any hardware problem as well, like there is a possibility that IR sensor might be interrupting the controller twice whenever it detects any object under itself. Try out more methods of debugging this problem and do share with me the solution/mistake, once you find it. 

    Good Luck :)

    November 14, 2016 at 6:24 am #14241
    Ashutosh Bhatt
    Participant

    its not the problem with your HW or SW

    it is due to low speed of object passing through conveyor. 

    by the time only one object passes through belt, the sensor is interrupted twice – so it counts two objects

    so either 

    1) you incresease the speed of conveyor

    or

    2) you apply delay in SW between every object pass

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

RSS Recent Posts

  • Siemens large industrial PLC parts June 15, 2025
  • Parts required for a personal project June 15, 2025
  • Cant log in to Easy PC forum June 15, 2025
  • Failure of polypropylene motor-run capacitors June 15, 2025
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz June 15, 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