Arduino for Industrial Machine

Hello, I need some tips to do my project in an industry.

OBJECTIVE:
Well, I want to connect an Arduino UNO to an industrial wire cut machine .
When the machine is running, it sends a 24VDC signal everytime a crimp goes up and 0VDC when goes down.

The idea is to count the amount of hits the crimp makes.

ELECTRIC DIAGRAM:
I want to know which is the best way to receive the 24VDC signal to arduino and have it isolated from the machine.

I don't know which of the next circuits are the best:
-Voltage divider
-Relay
-Regulator

I tried to use a 24V relay, but I think because of the noise; I received 9V and couldn't activate the relay.
Now I'm using a voltage divider and it works (I'm receiving 2.5V to Arduino Digital I/O), but I want to have a better isolated circuit. That's why I'm searching for tips of how to receive big voltage to arduino D I/O.

I'd go with the voltage divider, but shoot for closer to 5V. 2.5V may be working, but it's undefined. 3V or more (0.6Vcc) is guaranteed high and 1.5V or less is guaranteed low (0.3Vcc).

And, since you're connected to the "outside world" it wouldn't hurt to add an [u]over-voltage protection diode[/u].

Or, if you want electrical isolation (and protection) use an opto-isolator.*

Voltage regulators are for constant DC voltage (power supplies). They are not intended for signals.

I tried to use a 24V relay, but I think because of the noise; I received 9V and couldn't activate the relay.

The 24V source can't supply the current required for the relay coil.

  • A "normal" opto-isolator requires a current limiting resistor on the input-LED side, which you'll have to calculate & supply. The output-transistor side requires a pull-up resistor, but you can enable the Arduino's internal pull-up. And depending on how the LED is wired, an opto-isolator normally inverts (when the LED is on the transistor turns-on, pulling the output low).

Hi,
I'd suggest the opto-isolator as safest / easiest.

Opto-Isolator will get you on the safe side and might help with protection against "industrial" noise.