Counting button presses from multiple unique buttons

Hope this is the right place to post this.

I am working on a project and am looking to see if it can be addressed with arduino. We have a factory that has something like 20 "stations", but we change the machines that go into each station depending on what we are making. I would like to have a button on each machine that can be pressed to capture output, with one press being one output.

Is there a way that we can use arduino where when we move the machine into the position, connect the button (Plug the connector in), and then capture the button press? Could this be achieved with 20 buttons, each button being unique, with 1 arduino?

sofortune: Could this be achieved with 20 buttons, each button being unique, with 1 arduino?

But the 20 is the number of stations, not the number of machines, which is presumably more than 20.

Just to clarify the requirement, do you mean each machine or each station needs to be identified by its own "code" so to speak?

So although you have 20 stations, there are (say) 50 machines. Today machine 26 might be at station 12, and tomorrow it may be out of play, with machine 33 at station 12. Next day, maybe machine 33 is at station 6 and machine 26 is at station 3.

That the kind of thing you mean? So each button press actually identifies what was made, since the machines make different things.

sofortune: Could this be achieved with 20 buttons, each button being unique, with 1 arduino?

If your “button connection” was at least 2 pins then yes you could do it.

Arduino side would have one wire being +5 volt out and other connected to a analog in pin.

Button side would be 5+ in, button, multiple resistor setup / variable resistor , output left over voltage.

Set each button with a unique resistive value, have a stored table in the arduino so that it knows what to do for each value.

If this was my task I would use a three pin connection so that the “button” is on one circuit and the unique resistive load is on another that way when it’s plugged in the machine can show what station it “thinks” it is at before the actual trigger button is used.

I may not be understanding correctly but, here goes: If each machine is to have a unique signature, there could be five groups, each group having its own four different resistance values. So, the plug for group '1' is wired to A0, group '2' to A1 and so on. Reserve a connector pin to indicate that a machine is connected. When a machine is detected read the analog pins, only one will have a valid value, and decode which machine signature is present. You wouldn't even need a button for this.

.02, YMMV

For unique identifications of machines: - use 8 pins for a digital number (connect as needed for any number 0-63). Use more/less pins depending on the number of machines. - Equip each with a DS18B20 temperature sensor, and use the unique ID of the sensor to identify the machine. There are also ICs out there that can do the same. Just 1-2 pins needed.