How about sonar then. You send out a pulse or Ping, and if a tube is in one of the holes, you should receive a ping back. Note you can set ranges so it does not detect a wall or something else.
Delta_G:
The tubes are clear, so optical sensing might not be my best choice.
Still - you might want to give it a try - maybe using something like these:
http://www.goldmine-elec-products.com/prodinfo.asp?number=G18740
Note that the above device is -really- tiny (maybe 3-4 mm in diameter); both the IR led and transistor face upward, so perhaps without a tube, there would be little reflectance, but when you put one it, there would be more.
As far as using switches, you could use something like:
http://www.goldmine-elec-products.com/prodinfo.asp?number=G18631B
...or similar...
Of course, the real problem (whatever you use) will be hooking all of those sensors up and reading them; that won't be an easy task (especially for the IR device mentioned). You would basically need to do something like an LED matrix - but rather than lighting the LED, you would want to read the sensor (well, in the case of the IR sensor thing - you would need to do both). Regardless, you are looking at a ton of wires!
Maybe what might be better would be to not use an Arduino, but go for something like a Raspberry Pi (or one of those other ARM/linux embeddable PC boards) - and use a web cam (facing down?) and some machine vision software (ie, OpenCV and Python?) to verify whether the hole is filled or not...
This may be a rubbish idea but ...
Suppose you had a light dependent resistor underneath each hole and all the resistors in a column wired in series.
Then if you measure the resistance of the row with the ADC on an Arduino you may be able to detect how many tubes are in that row (or how many empty spaces there are).
It might be useful to have one LDR that is not in a tube to provide a reference point for changes in ambient light.
This method wouldn't tell which holes are empty.
...R
What environment is the disc in when you need to do this sensing?
I mean - is it installed in the centrifuge? Is it rotating? What access do you have to the top/bottom/sides of each opening to do your sensing? Do the tubes penetrate the foam or are they blind at the bottom? I guess you want to avoid any solution that requires weakening the foam and won't leave any part of your sensing solution in the rotating assembly, but it's not clear what the exact constraints are.
For example, if the holes penetrate the bottom of the disc, and the disc can be placed on a bench, you could just position it over something that had a momentary switch under each hole that was operated when a tube was inserted in that hole. (Presumably that won't fly or you'd have thought of that already.)
Now I'm picturing something like an orbital sander, rather than something that spins round in circles. That ought to avoid a lot of the practical issues I was anticipating.
One option would be to find a really small microswitch that was small enough to be embedded in the foam next to the tube, so that when the tube was inserted it operated the switch. That would be relatively bulky and expensive, but also simple and reliable. This is the sort of thing I mean, although there's nothing special about this particular supplier:
I was expecting them to cost more than that but judging by those prices you might be able to get the whole set for $30-$40, so the size would be the main stumbling block.
Antistatic foam has high resistance until it is squeezed. So if the holes were a bit small for the pipettes and if you had wires inserted in the foam close to the holes then you could get current flow between the wires if a pipette were in the hole squeezing the foam around it and between the wires.
You could even go with a layer of antistatic foam on top of some other non-conductive foam.
Why not a PCB under the foam with regular tact switches lined up under each hole. Wire them up like a matrix keypad. Shouldn't need as many pins that way. Just spit-balling here.
TomJ
Tumbleweed:
Why not a PCB under the foam with regular tact switches lined up under each hole. Wire them up like a matrix keypad. Shouldn't need as many pins that way. Just spit-balling here.
TomJ
Or somthing like these small momentary pushbuttons:
That would require less force that way, plus more room for error.
If you're stuck for space, how about these?
http://www.aliexpress.com/item/Free-shipping-500Pcs-lot-Wholesale-35-OFF-4mmx4mmx1-5mm-Waterproof-Copper-Head-SMD-Tactile-Switch-Touch/653424981.html
And they're waterproof!
If your foam plate and the associated switches is going to be vibrated I suggest you don't use tactile switches as there will inevitably be vibration between the tubes and the switches which will cause damage either to the switch or the tube.
I reckon non-contact optical sensors are the only option, regardless of complexity. And they will probably need to be installed very securely so that there is no risk of the vibration causing stress to the connecting wires.
If this is for a "real" project (rather than a hobby) I also think it would be essential to give feedback to the users - such as an LED lighting for a successful insertion as someone else mentioned.
This is all evidence of why real stuff is more expensive than hobby stuff.
...R
Robin2:
I reckon non-contact optical sensors are the only option, regardless of complexity. And they will probably need to be installed very securely so that there is no risk of the vibration causing stress to the connecting wires.
I agree. I suggest reflective IR sensors mounted on a PCB underneath the foam disc.