Object counting in conveyor

Discussion in 'Microcontrollers and Programming' started by cyanpraveen, May 10, 2011.

  1. cyanpraveen

    cyanpraveen

    Joined:
    May 10, 2011
    Messages:
    6
    Hello guys

    i am designing a simple conveyor system.

    I using 12V DC motor with 1500 rpm

    Now my problem is, i need to count the no of objects place in the belt on the run time

    As well as to control the speed of the motor.

    I thought of using IR to count objects, but dono how to get start.

    so guys pls help... if there is any other better option i ll consider tat also

    Advance Thanks for helping
    cyanpraveen, May 10, 2011
    #1
    1. Advertising

  2. cyanpraveen

    rob_croxford VIP Member

    Joined:
    Aug 3, 2010
    Messages:
    262
    Location:
    Birmingham, England
    Firstly is this system for comercial use or is it a home project??

    You could use an LDR and either a microcontroller or a counting ciruit (using latches and flip flops.

    For controlling the speed of the motor i would suggest a PWM aproach using either a microcontroller or 555 timers with the speed control using a potentiometer.

    Please outline exactly how you want this conveyor system to work and we can quide you on your design :)
    rob_croxford, May 10, 2011
    #2
    1. Advertising

  3. cyanpraveen

    cyanpraveen

    Joined:
    May 10, 2011
    Messages:
    6
    I am just using the conveyor for educational purpose... to show kids how conveyor works. PLC is a good option but i need to finish this one in low budget.

    since it is for edu purpose i m not using very big machine (12cm -width and 1 meter length) conveyor and i can control the speed using gears.

    so there no specific objects is used for this application .

    for me wat exactly required is the sensor need to count the objects as we place in the conveyor and need to display it on the lcd.

    the problem is i dono wat type sensor need to used,how to extract the value frm sensor to display in lcd.

    Thanks...
    cyanpraveen, May 10, 2011
    #3
  4. cyanpraveen

    rob_croxford VIP Member

    Joined:
    Aug 3, 2010
    Messages:
    262
    Location:
    Birmingham, England
    Ok well you could count the amount of objects placed on the conveyor using weight. This would be relativly simple if the weight of each object is the same.

    you could use an LDR (as previously mentioned) to count the amount of objects as they pass the LDR on the conveyor.

    However whatever method you use you will need to use a microcontroller to comunicate with an LCD. do you have experiance with microcontollers?? Displaying just a single value from a sensor will be quite a trivial task using a PIC however it will require some calculation and timing.
    rob_croxford, May 10, 2011
    #4
  5. cyanpraveen

    cyanpraveen

    Joined:
    May 10, 2011
    Messages:
    6
    well i had done once. i just displayed value from the pressure gauge to lcd using ADC... is tat i have to do in the same way for LDR
    cyanpraveen, May 10, 2011
    #5
  6. cyanpraveen

    rob_croxford VIP Member

    Joined:
    Aug 3, 2010
    Messages:
    262
    Location:
    Birmingham, England
    It will be even simpler using an LDR as you are looking to change an I/O pin on the pic either high or low (depending on how you have your LDR the resistance will either drop - allowing the pin to go high or it will increase allowing the pin to go low). You will then use the pic to initiate a count that for everytime this pin goes high (so every time an object is detected by the LDR) 1 is added to the count. Then you can display this integer on the LCD.
    rob_croxford, May 10, 2011
    #6
  7. cyanpraveen

    rob_croxford VIP Member

    Joined:
    Aug 3, 2010
    Messages:
    262
    Location:
    Birmingham, England
    "Poor mystic" made a good point that in order for your students to learn about how this conveyor system works it is probably a good idea to bypass microcontrollers and stick to Cmos. Would it be feasable for you to use Seven Segment Displays to display the count on the conveyor??

    Please see attached circuit.

    I have knocked this up for you as it is quite a simple circuit that should fit the purpose of you conveyor. When something is detected infront of the LDR a 1 is sent to the divide by ten counter then to the Seven segment Decoder and finally is displayed on the SSD. everytime this happens a 1 is added to the count. This particular model will coutn up to 999 but it can easily be changed to count to any number or to count down or to count to a certain number and then reset etc...

    SW1 is the on switch, SW2 is the reset switch (to reset the count)

    Hope this helps.

    Attached Files:

    Last edited: May 11, 2011
    rob_croxford, May 11, 2011
    #7
  8. cyanpraveen

    cyanpraveen

    Joined:
    May 10, 2011
    Messages:
    6
    Well Rob thanks for your suggestion.

    It seem there will be some problem in detecting objects while using LDR (it requires a closed surface to detect object). If i am wrong forgive me

    So I think the better option would be IR.

    so can you suggest me how to program n design using IR pls. I mean some schematics and material explaining how to interface IR with 8051 by program

    thanks
    cyanpraveen, May 13, 2011
    #8
  9. cyanpraveen

    cyanpraveen

    Joined:
    May 10, 2011
    Messages:
    6
    conveyor object counting

    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

    Code:
    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
    cyanpraveen, Jun 7, 2011
    #9
  10. cyanpraveen

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Joined:
    Jan 21, 2010
    Messages:
    16,558
    Location:
    Mid way between Beijing and the Ronne Ice Shelf
    OK, congratulations on getting this far.

    If it works fine in the debugger, and not so fine in real life then chances are it is something in real life that fouling you up.

    It is possible that you are seeing multiple pulses from the detector, or that something is causing it to be erroneously re-triggered.

    Can you show us how you have connected the IR detector? Is it detecting a beam being broken?

    Do you get multiple counts if you wave your hand in front of the sensor?

    Doe you get one count as the object obscures the beam, and another as it clears the beam, or do both happen as the beam is being occluded?
    (*steve*), Jun 7, 2011
    #10
  11. cyanpraveen

    cyanpraveen

    Joined:
    May 10, 2011
    Messages:
    6
    Actually when i include the display commands out side the interrupt for eg. say in a separate function the lcd display some random counts cant say it is multiples of previous count at each time when ir turned off.
    when i include the display command in interrupt as shown above the count increases twice when i wave my hand...
    If i pass an big object , wen led gets off it increase the count twice and wen it turned on once again increase two times... i dont know how to slove it...
    cyanpraveen, Jun 7, 2011
    #11
  12. cyanpraveen

    gorgon VIP Member

    Joined:
    Jun 6, 2011
    Messages:
    540
    Location:
    Norway
    If you use an active IR beam and a receiver, it could be that you count reflexes from the moving object or other objects. You should make some debounce code in your counter routine. Reading the input several times at defined intervals and compare a number of them to be the same before validating the change of state. This goes both ways.

    To make the debouncer more foolproof, you can calculate the minimum time the object is blocking the beam and use this to calculate the debounce of the signal.
    gorgon, Jun 11, 2011
    #12
  13. cyanpraveen

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Joined:
    Jan 21, 2010
    Messages:
    16,558
    Location:
    Mid way between Beijing and the Ronne Ice Shelf
    You can also debounce the circuit with electronics, but I would do it in software as it makes everything easier to adjust.

    Placing a capacitor (say 0.1uF) across your IR detector may improve things somewhat. If it does, then debouncing is certainly your problem. This will cause the sensor to react more slowly, so it may bot count if you wave your hand in front of the sensor quickly, so beware of that too.
    (*steve*), Jun 12, 2011
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Avital
    Replies:
    2
    Views:
    314
    Avital
    Nov 6, 2003
  2. Avital

    counting input from sensors

    Avital, Nov 7, 2003, in forum: Electronic Basics
    Replies:
    7
    Views:
    340
    John Fields
    Nov 10, 2003
  3. Paul Ciszek

    combining two pulse streams for counting

    Paul Ciszek, Sep 20, 2005, in forum: Electronic Basics
    Replies:
    4
    Views:
    305
    Jasen Betts
    Sep 21, 2005
  4. Rikard Bosnjakovic

    Counting 1-6 instead of 0-9 with a 74LS192 / 74LS47

    Rikard Bosnjakovic, Sep 29, 2005, in forum: Electronic Basics
    Replies:
    46
    Views:
    3,256
    Jasen Betts
    Oct 8, 2005
  5. david b

    counting bottles

    david b, May 20, 2006, in forum: Electronic Basics
    Replies:
    7
    Views:
    462
    david b
    May 22, 2006
Loading...

Share This Page