Limit switch timer relay

I’m trying to turn on a relay when a limit switch is activated. However when the limit is activated it will need to energize the relay for a certain amount of time, then the relay needs to cut out . When the relay cuts out it will deactivate the limit switch mechanically

Any help with sketch would be appreciated

  • Always show us a good schematic of your proposed circuit.
    Show us good images of your ‘actual’ wiring.

  • What kind of Arduino do you have ?

  • In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
    Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

Sounds like there’s more to be told.

The normal procedure is you build and code as much as you can then if you have a problem we can provide some pointers.

When the relay cuts out it will deactivate the limit switch mechanically

This will be the hard part if it can be done at all.

Please show a diagram/picture of your limit switch that can be switched mechanically by your relay. perhaps also explain why this needs to be done!

Would your relay be a solenoid?

mechanically? why? how?

if the limit switch is just driving a digital input, can't that input simply be ignored. A common issue is that a limit switch should stop travel in one directoin but not the other. so conventional logic might be

    if (CW == dir && Active == digitalRead (PinLimitCw))
      stop();

Here is code for a one-shot timer using one of the Arduino PLC modules Arduino 10MR & 10MT PLC modules – Cedar Lake Instruments. It’s overkill for what you need – strip out the LCD communication parts, but it should work.

However, if you are using a relay for the situation where a limit switch is activated but you want to override it so a moving device can go back in the other direction, off the switch, the conventional way to do this is to put a reverse diode across the limit switch. The diode allows current to flow only in the direction that would let a motor move away from the limit.

HTH

Hi, @Bentech

Can you please tell us the scope of your project?
What does it do and why do you need the delay etc?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia: