24Vdc Alarm to trigger 24Vdc Servo

Hi... I have a laser gauge that monitors the manufacture of cable. The cable is required to be a uniform diameter - However, there is potential that there maybe 'lumps' in the cable at random intervals. To manage this, we have what we call a 'LUMP' detector in place. If the lump detector finds a lump, it rises a 24Vdc output and sends a signal to an Alarm. The audible alarm is currently the way for the operator to know there was a lump - However, his reaction could take minutes, by which time the lump is 'somewhere' on the drum of cable being made.... Resolution - SPRAY the defect area at the time the alarm is raised, identifying the area very easily for the operator to see. We have developed a spray unit that runs off 24Vdc (Solenoid depresses the sprayhead) Our Challenge is this : When the alarm sounds - and the 24Vdc rises, the Arduino needs to detect the rise (at present we have a voltage divider in place to take the 24Vdc down to 3.5v (manageable by the Arduino) and we can detect the voltage change "GREAT" - This activates the solenoid "Another Great" . . . However, the alarm will stay at 24v until the operator resets it... i need to add some code that recognises that the solenoid has been activated - keep it depressed for 0.5 seconds ( delay(500) ) but then understand that the alarm has not been reset, but 'not' continue to depress the solenoid. I am attempting to implement an 'IF' or 'ELSE IF' structure that maybe adds an alarm variable and its status is not reset. I hope I have explained this adequately, and any assistance would be appreciated. Should I resolve this problem, then I shall post the code for future developments by others.

I'm guessing that you want the alarm status to stay active so the operator will eventually see it.

The programming answer should be fairly easy.

You need a variable (let's call it alarmRespondedTo) which is normally false.

When your program detects a new alarm it will deal with it and change alarmRespondedTo to true.

After that if your program loop continues to detect the same alarm it will see that alarmRespondedTo = true and it will know not to do anything.

When the operator resets the alarm your program should detect that and set alarmRespondedTo back to false waiting for the next event.

...R

You're looking to spray when the input changes from low to high; take a look at the stateChangeDetection example that comes with the IDE.

I now have this working - your suggestions have assisted (Many thanks) I shall upload the schematic and program in the next day or so (hopefully)

Already thinking of the next step of not only recognising the change of state, but also 'addiional' changes of state WHILE the alarm is sounding and additional lumps are detected...