Piezo amplifier

Hey all, I'm trying to get a reading on an Uno from a light dragging of a screw tip on the ceramic of a piezo. I sometimes, the piezo reads, sometimes it does not. There's some other variables like what / how the piezo sensor is mounted on, but what I'm wondering is can I use a 741 op amp to sincrease the piezo signal? I simply need to get a yes or no answer to the presence of the screw tip. A simple circuit would be appreciated, I'm too new to electeonics!

For reference 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. Open to other suggestions for sensors but I just have some piezo and op amps available.

Are you using an analog input? Run the [u]Analog Read Serial[/u] to see what kind of readings you're getting.

And, I assume you're using a pull-down resistor? A higher value resistor (maybe 1M) will allow a bigger signal from the piezo.

DVDdoug:
Are you using an analog input? Run the [u]Analog Read Serial[/u] to see what kind of readings you're getting.

And, I assume you're using a pull-down resistor? A higher value resistor (maybe 1M) will allow a bigger signal from the piezo.

Hey DVDdoug, well I guess I'm glad I started in the right spot. I was using a 1M resistor before the piezo's ground and signal wire and using an analogue input for the reading. Below is the code I was using. With just the straight reading I was getting 1.0, sometimes 2.0 but it was very inconsistent. Most of the time it was just 0. I was using a threshold also because I thought I would have a range and had heard the piezo could pick up other vibrations so I wanted to limit the signal. I then tried dividing the signal by 100 and was getting a much more consistent reading, things like .02, .40, .35, .10 etc but it was overall still inconsistent, still reading 0 about 1/2 the time. I tried adding more resistors to see if it would boost the voltage more but no luck, hence why I started thinking about the amplifier. The dragging of these screws against the ceramic is very light obviously.

On a side bar, I'm not set on the piezo, its just like I said some stuff I had on hand. 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.

I had 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.

As you can see I am open to any practical solution haha.

#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);
}

If you're going to bother with an external circuit, use a comparator to get a yes-no-right from the hardware.

55thSwiss:
For reference 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. Open to other suggestions for sensors but I just have some piezo and op amps available.

Wow: detecting just 0.5mm difference in length. I imagine your conveyor will need to be extremely stable with little to no vibration. Likewise, the screw clamp needs to reliably hold the screws in an identically positioned grip for each screw.

If you haven't already considered it so far, another cheap sensor option could be a photo-interrupter. If you can source one with a suitable slot spacing, narrow beam, a recessed detector (if available) and then mount it on a rigid, finely height adjustable mount, you might just be able to tweak it to break the beam with the slightly longer screw. A little screening around the sensor to protect it from as much ambient light as possible may also help. Just my 2 cents.

Maybe have an isolated wheel that presses them firmly down against a slot they pass thru, the long ones to make electrical contact with a contact surface below while the short ones do not.

Why does this post seem so similar to another post about sorting small screws with small difference in length? Are there other people with loose screw problems?

Paul

The jokes write themselves.