Micro Switch or Button

Can someone recommended me micro switch or button for following case:
The small ball (plastic or glassy) falls through a plastic tube and activate the switch on the bottom with appropriate weight.
The switch must give free passage to ball and returns to the original position.
The ball falls on the ground.

Thanks!

potter:
Can someone recommended me micro switch or button for following case:
The small ball (plastic or glassy) falls through a plastic tube and activate the switch on the bottom with appropriate weight.
The switch must give free passage to ball and returns to the original position.
The ball falls on the ground.

Thanks!

Your not likely to find a 'store bought' switch that will do that and you would have to jury rig something to work with a mechanical switch or button. Easier I think would be to use a optical interrupter sensor and mount in across the clear tube and the passing ball will generate a pulse output from the sensor that you can easily detect in software, perhaps using a user interrupt pin.

Lefty

are you expecting any error events? such as different weight of balls?
if yes are the balls you are aiming at are the lightest or the heaviest?
if nothing of that you can use
http://www.ebay.com/itm/2-x-1P2T-Mini-Micro-Switch-with-Lever-AC125V-1A-e-/160931276931?pt=LH_DefaultDomain_0&hash=item2578406883
lenght of the "lever" will determine of how much force you need to activate it.

Thank you for answering.
The best solution would be if the switch can be activated only with specific plastic light ball (cca 1 cm diameter)..
If this would be impracticable, please if someone can provide example with "optical interrupter sensor" (where I can buy??) or
with "Mini Micro Switch with Lever"..

The small ball (plastic or glassy) falls through a plastic tube

is the diameter of the ball and the tube (almost) identical?

The essential interrupt code is

int pin = 13;
volatile int state = LOW;

void setup()
{
  pinMode(pin, OUTPUT);
  attachInterrupt(0, blink, CHANGE);  // 0 refers to pin 2 see attachInterrupt() on reference page
}

void loop()
{
  digitalWrite(pin, state);
}

void blink()
{
  state = !state;
}

If pin 2 of the UNO changes from HIGH to LOW or LOW to HIGH the led will blink.
You can place a photoresistor on pin 2 (use a pull up/down resistor if needed) and shine a led on it. The signal will be high until the ball passes and becomes high again when the ball has passed. If you do some timing measurements you can possibly discriminate falling speed/diameter of the object. YOu have to experiment with that.

If the specific ball is translucent I think you could do the same with an photoresistor on an analog port and get a dip in the analog voltage. The width and depth of the dip is an indication for the speed and translucency of the ball.

Does this makes sense to you?

potter3366:
Thank you for answering.
The best solution would be if the switch can be activated only with specific plastic light ball (cca 1 cm diameter)..
If this would be impracticable, please if someone can provide example with "optical interrupter sensor" (where I can buy??) or
with "Mini Micro Switch with Lever"..

Does sound too light for a microswitch - might be able to rig up a couple of bent paperclips into a switch
with a light action though. Optical switch would be more reliable I think, but more expensive than two
paperclips!

What optical interrupter sensor (optical switch) do you recommend ?

Would this work? Just wrap some dark tape around it to limit its field of vision and the put its “eye” up against the clear tube that the balls drop thru. Less then $2! Good Luck!

http://www.ebay.com/itm/1pcs-Pyroelectric-Infrared-PIR-Motion-Sensor-Detector-Module-/400330055400?_trksid=p2047675.m2109&_trkparms=aid%3D555003%26algo%3DPW.CAT%26ao%3D1%26asc%3D154%26meid%3D4371655877860104938%26pid%3D100010%26prg%3D1088%26rk%3D1%26sd%3D260263786624%26

Arduino420:
Would this work? Just wrap some dark tape around it to limit its field of vision and the put its "eye" up against the clear tube that the balls drop thru. Less then $2! Good Luck!

http://www.ebay.com/itm/1pcs-Pyroelectric-Infrared-PIR-Motion-Sensor-Detector-Module-/400330055400?_trksid=p2047675.m2109&_trkparms=aid%3D555003%26algo%3DPW.CAT%26ao%3D1%26asc%3D154%26meid%3D4371655877860104938%26pid%3D100010%26prg%3D1088%26rk%3D1%26sd%3D260263786624%26

I suspect that module would be too slow to react to the falling ball as there seems to be a minimum 'blocking' time specification:

4.Delay time: adjustable (0.3 seconds to 18 seconds)
5.Blockade Time: 0.2 seconds

Lefty