Programming a two "button" input within a certain time to trigger a light/buzzer

Hello, I have no clue where to even start for this project. I have read some posts regarding two button AND statements but I am not sure if that will work. If anyone could help steer me in the right direction or help with programming that would be much appreciated.

What I am working on is a project that detects the inside of a washer, there are 4 contacts that physically act as a button, 2 opposed contacts are 5v positive and the other 2 would be connected to a digital or analog pin. The smaller sized washer will contact all 4 points, the larger washer will not.

The idea is that the metal washer should contact at least 3 or 4 of the contacts within 100-500 ms of each other. If only one "button", or only 2 contacts complete the circuit, then a buzzer and light (I tried with pin 13) should activate. I am not sure how it could be reset, I was thinking of an actual physical reset button to start the code over again but I am not sure if that's possible.

If all 4 contact (both pins should see a high signal right?) then a different light (OK) should illuminate and no buzzer necessary.

*Hardware: Arduino UNO, 2x 5v LED one green one blue, one 5v buzzer.

Capture.PNG

Capture.PNG

Why not start with an UNO and generate a best guess schematic, not a frizzy thing. KiCad can be downloaded and used free of charge but a donation helps keep it alive. It does not matter if a signal is high or low, it is what your software does with it. A switch can be on with the input to the UNO as either high or low depending on the hardware. These washers are closing circuits, how are they wired? More information will help a lot. You might get a copy of the Arduino cookbook and read it, it will give you a lot of insight on your project.

mozzietheaussie:
What I am working on is a project that detects the inside of a washer, there are 4 contacts that physically act as a button, 2 opposed contacts are 5v positive and the other 2 would be connected to a digital or analog pin. The smaller sized washer will contact all 4 points, the larger washer will not.

Before we go any further this needs clarification.

The way you have described it suggests to me that the washer must contact both a 5v contact and one of the other contacts if it is to generate any signal. That suggests to me that there are 2 pairs of contacts rather than 4 contacts.

Naming the contacts helps with the description so lets call the powered contacts 5vA and 5vB and the other contacts A and B.

Is a circuit created when 5vA is connected by the washer to A only?
Is there a circuit when 5vA is connected to B only?
What about the other 2 cases?
Are two circuits created if 5vA is connected to both A and B ?

A simple drawing (by hand) that shows the arrangement of the contacts (with names) would help.

Is this intended to be a GO / NO-GO test to eliminate washers with over-sized holes? If so, what sizes are acceptable and what are unacceptable.

If it is something else entirely please tell us what it is.

...R

Hello Robin,

Thank you for the reply, I am sorry for the massive delay in response, we had other issues that kept me away from this project.

Firstly, yes, the contacts will be in pairs. so there will be a total of two "switches" All I need it to do is if only one "Switch" is toggled and the other isnt toggled within a certain timeframe (.500ms) it would sound an alarm/light showing the operator its the incorrect size.

So the way I was designing the circuit is the left side contacts share a 5v input, the two on the right go to a seperate pin, so each pin would get some.

So 5va and 5vb could be pins 12 and 13 respectively. Something like this.

Yes, the idea is to prevent oversized washers on smaller bolts. The size difference is over 3mm dia, or 6mm total, the only issue would be if the operator hold the shim at an angle as to trigger both contacts.

What you describe sounds like anti-tiedown logic.

SOLVED: Programming 2 hand anti tie down

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.