Mechanical estop switch

Good day
My project involves a estop which i did mechanically.
I wired the +24v to the estop N/C switch.
My inquiry is , is there anyway that i can return the programme flow to the start ,if lets say the mechanical e-stop is pressed halfway through the pogramme.

(deleted)

You will need to give more details of your project e.g. what is the estop trying to stop.

You cannot feed 24V directly into the Arduino as its I/O operates at 5VDC. No doubt though there are other contacts on the estop that will allow the Arduino to detect that the estop has been pressed and the contacts have opened (or you can use a voltage divider as has been suggested)

Once the estop is pressed the Arduino can stop what it is doing and wait for the estop to be reset at which point it can commence whatever it was doing from the beginning. In fact it can do pretty much whatever you want, but you need to define what that is.

ardly:
You will need to give more details of your project e.g. what is the estop trying to stop.

You cannot feed 24V directly into the Arduino as its I/O operates at 5VDC. No doubt though there are other contacts on the estop that will allow the Arduino to detect that the estop has been pressed and the contacts have opened (or you can use a voltage divider as has been suggested)

Once the estop is pressed the Arduino can stop what it is doing and wait for the estop to be reset at which point it can commence whatever it was doing from the beginning. In fact it can do pretty much whatever you want, but you need to define what that is.

Hello, thanks for the reply.
i have already connected the circuit for the 24v. It consist of 2 capacitors and 1 transistor . The problem now is that the raw voltage from the power supply is what i use to go through the N/C estop. Hence i do not know how to write a programme to say that; if the estop is pressed the programme will start from the top again . I have 3 24v solenoids, 3 12v motors and 5vs are pretty much everything else.

So you have no spare contacts on the estop that the Arduino can use?

Regarding the program, forget the estop for now. Just put a switch between an output and an input on the Arduino and get a simple version of your code to run the way you want using the switch instead of the estop. Once you have that working solve the problem of using the estop.

You are being very sparing with providing information on what you are doing. If you post your code, use the </> tags, you will get much better answers from people. A diagram would also help people understand what you are trying to do. You may know what "pretty much everything else" is but nobody else has a clue.