.5mm Length Sorter

Hi guys and gals,

I had posted a question regarding a piezo in the general electronics but with no real response or suggestions, I think maybe I'm taking the wrong approach and in the wrong forum? Below I will describe my situation. I'm really new to electronics and striking out so I'm open for any and all suggestions!

I'm trying to sort two screws that are nearly identical. They're very small, 3mm head diameter, 1.5mm major diameter. The only difference between them is one is 3.5mm thread length, the other is 4. I have a belt conveyor that holds the screws by the head, leaving them hanging down, making the thread tips there to be checked.I'm trying to get a reading on an Uno from a light dragging of a screw tip on the ceramic of a piezo. Attached is a model of the actual screw sizes and my initial idea for a piezo for recognition.

Using the piezo, the reading is incredibly inconsistent. Just the piezo alone with a 1M resistor and analogue input, I received reading around 1.0 an 2.0 occasionally but was very inconsistent. I can't the input to divide by 100 and started getting readings like .02, .40, .35, .10 etc at much better frequencies but was still not accurate all the time. I had asked the question in the general electronics forum about using an op amp to increase the signal but to no one seemed to know or think this would work? Below is the code I was using for this layout.

Next I tried the KY-036 touch sensor externally from the setup and thought it was good to go, holding the screws by the head with needle nose pliers making sure to only touch the rubber grips but I guess my hand was still conducting enough through to trigger the sensor? When I put the touch sensor in the setup and the belt was driving the sensor wouldn't read.

I had also thought of a load cell that could measure grains, as these are very light parts, but looking into a couple videos on how to make one like some of the YouTube "weigh an eyelash" ones it seems pretty tough for me to do with such limited electronic experience and I would have to redesign the mechanics of the setup and the scales seems pretty finicky too.

Does anyone think the KY-010 sensor is worth a shot? I don't know how "fine" the line is for breaking the sight?

I know there are vision systems that can distinguish this kind of difference but I was trying to build something for a couple hundred bucks tops, not spend $2000+. I thought about something like the Pixy cam through a magnifying glass or something, but that's really best for identifying color differences it seems, where as these two screws are both silver (titanium) so that seems out.

Like I said I'm open to any and all practical solutions. Thank you for any help you can provide!

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int ledRedPin = 13; // longParts red LED signal
const float redKnockSensor = A0; // input for long parts piezo
const int thresholdMin = 2.0; // min piezo voltage
const int thresholdMax = 25.00; // max piezo voltage
float longParts = 0; // Counter reset for long parts.
float redSensorReading = 0;
int ledRedState = LOW;

void setup() {
lcd.begin(16, 2);
lcd.setCursor(0,1);
lcd.print("Long parts:");
lcd.setCursor(13,1);
lcd.print(longParts);
pinMode(ledRedPin, OUTPUT);
Serial.begin(9600);
}

void loop() {
lcd.setCursor(0,1);
lcd.print("Long Parts:");
lcd.setCursor(13,1);
lcd.print(longParts);
redSensorReading = analogRead(redKnockSensor);
//redSensorReading = redSensorReading /100 ;
Serial.println(redSensorReading);

if ((redSensorReading > 0) && (redSensorReading < thresholdMax))
{
++longParts;
ledRedState = HIGH;
digitalWrite(ledRedPin, ledRedState);
redSensorReading = 0;
ledRedState = LOW;
delay(1000);
digitalWrite(ledRedPin, ledRedState);
}
delay(300);
}

Image from Original Post so we don't have to download it. See this Image Guide

...R

Can you pass a small current through the screws and detect when the longer ones touch a metallic surface and complete the circuit?

Is it possible that the disturbance of the head of the longer screw (as shown in your image) could detected by a camera because it would reflect differently.

...R

Robin2:
Can you pass a small current through the screws and detect when the longer ones touch a metallic surface and complete the circuit?

Is it possible that the disturbance of the head of the longer screw (as shown in your image) could detected by a camera because it would reflect differently.

...R

First off thanks for the image thing. I'm new around here obviously but I'll try and pick up on the SOP.

These are both interesting suggestions. My initial reaction to the low current (how many volts do you think?) is that it shouldn't be a problem, as in should not damage the parts, I would just need a way to attach something wires or something else charged to the track of the belt, or make a metal belt system.

The second option seems a little more difficult, only because the change is still pretty small, and I don't know much about measuring / detecting reflections?

Put a small leaf spring over the track that only touches the head of the screw under test and lightly holds it down. Pass the current through the spring to the head.

groundfungus:
Put a small leaf spring over the track that only touches the head of the screw under test and lightly holds it down. Pass the current through the spring to the head.

I like this, definitely seems feasible. Just curious, why a leaf spring? And which way would you orient it, parallel or perpendicular to the track?

I would go for an optical sensor under the screws. The QRE113 is really easy to use and easy to calibrate looking end-on (vertical-up) to the screws.

The picture is helpful because it shows you have pointed screws. That won't work so well with an end-on looking sensor. A beam-break type sensor will work. Something like the laser beams you see in heist movie vaults. You don't need a laser. Just a thin slit to control the dispersion of the light.

Beam-break sensors can be bought with both halves embedded in a housing. There's a slot that you pass the thing to be detected. Just set it up with an adjustable height and calibrate with known screws.

I was thinking horizontal with a bit of a curve so the screw head lifts the flat spring as the head slides under. And the metal contact plate of Robin2 on the other end to complete the circuit with only the longer screws.

Hall effect with the magnet mounted on its back face should be able to detect the difference if mounted within spec range.

MorganS:
I would go for an optical sensor under the screws. The QRE113 is really easy to use and easy to calibrate looking end-on (vertical-up) to the screws.

The picture is helpful because it shows you have pointed screws. That won't work so well with an end-on looking sensor. A beam-break type sensor will work. Something like the laser beams you see in heist movie vaults. You don't need a laser. Just a thin slit to control the dispersion of the light.

Beam-break sensors can be bought with both halves embedded in a housing. There's a slot that you pass the thing to be detected. Just set it up with an adjustable height and calibrate with known screws.

So you're suggesting something like the KY-010 sensor? Or am I thinking this is something different than it is? https://tkkrlab.nl/wiki/Arduino_KY-010_Optical_broken_module

I wasn't sure if the beam had a blend point of a certain width, I'd imagine it did, and I just figured .020" wasn't too much. Also, I thought maybe depending on the helix on the parts there could be more overlap of material and it may trigger, for instance if the short screw was at maximum material condition and the long screw was at minimum material condition. I'm just talking theoretically though, this probably wouldn't happen?

Thanks for the tip on the QRE113, the idea seems interesting, but yes I'd assume with the tips on the screws and the thread wrap coincident with the nose wouldn't be very accurate.

groundfungus, thanks for the suggestions. What you're saying makes a lot of sense to me and seems simple enough to do. Going to do some prototyping tomorrow on it :slight_smile:

bluejets, the hall effect sensor looks interesting, but I don't know much about it or how it would work? Could you describe why I need to mount a magnet on the back face? And when you say specific range is this like 1mm or 1 inch? Or is it a trial by fire thing once you get it setup?

55thSwiss:
First off thanks for the image thing. I'm new around here obviously but I'll try and pick up on the SOP.

These are both interesting suggestions. My initial reaction to the low current (how many volts do you think?) is that it shouldn't be a problem, as in should not damage the parts, I would just need a way to attach something wires or something else charged to the track of the belt, or make a metal belt system.

The second option seems a little more difficult, only because the change is still pretty small, and I don't know much about measuring / detecting reflections?

The usual way I have seen to do this is to use a brass brush to touch the screw head. The longer the bristles, the less force on the screw.

Paul

55thSwiss:
So you're suggesting something like the KY-010 sensor? Or am I thinking this is something different than it is? https://tkkrlab.nl/wiki/Arduino_KY-010_Optical_broken_module

That's one example. It's not the best but it does have 0.1" pins for easy connection to a breadboard or a plug.

On Mouser at least, the key word to look for is "optical switch". See http://www.mouser.com/ProductDetail/Optek-TT-Electronics/OPB390T51Z/?qs=sGAEpiMZZMvQY0bpacMSodxFvo3SCOucy59SoDFiVMw%3D for just one example out of hundreds.

55thSwiss:
bluejets, the hall effect sensor looks interesting, but I don't know much about it or how it would work? Could you describe why I need to mount a magnet on the back face? And when you say specific range is this like 1mm or 1 inch? Or is it a trial by fire thing once you get it setup?

Alegro have spec sheets that can explain the operation better than I can.

Essentially though the hall would output a varying signal depending on distance from the (I'm guessing steel) screws. Distance to the sensor would be a millimeter or two at the most.

The purpose of the magnet on the back side of the hall effect is to make the hall operate in a "missing tooth" style of operation. i.e. the flux density changes depending on where the ferrous metal is located and returns a varying signal from the hall.

Just a thought, may end up not sensitive enough given the screws with a fine needle end.(or is that just an example)

PDF of various ones are in attach below.

an27702-Linear-Hall-Effect-Sensor-ICs.pdf (72.6 KB)

bluejets:
(I'm guessing steel)

The Original Post mentions Titanium. I can't see anyone taking this trouble with steel screws :slight_smile:

Of course, if this is a quality control issue I wonder why not reduce the manufacturing size by 0.5mm so they are all between 3.0 and 3.5mm - or increase it so they are all at least 4.0mm

...R

Robin2:
The Original Post mentions Titanium. I can't see anyone taking this trouble with steel screws :slight_smile:

Of course, if this is a quality control issue I wonder why not reduce the manufacturing size by 0.5mm so they are all between 3.0 and 3.5mm - or increase it so they are all at least 4.0mm

...R

Correct, I wouldn't do this with steel screws! Haha. And I can't control the sizes, it's what the customer specifies for the size, I can't change them. I started my own business as a third tier supplier to some medical device companies. I broach or put a Philips style drive feature in the head. Problem is when doing 10,000+ screws its easy to mix one or two together and it's of course unacceptable for my customers, unfortunately I've made the mistake!

Thank you so much everyone for the suggestions, there's several viable options here, and you've all helped me think outside the box from the piezo. I'll be working on testing some solutions this weekend.

Thank you again!!

55thSwiss:
and it's of course unacceptable for my customers,

I know it's completely Off Topic but it seems a really stupid waste of money to have designed a device that cannot accept the small variation in screw size that the OP is talking about. No wonder HealthCare is so expensive.

And another suggestion ...

What about passing the screws over a grinding wheel that automatically removes the unwanted 0.5mm ?

...R