Go Down

Topic: Looking for a 'customized' Pulse Timer Relay and/or circuit (Read 1 time) previous topic - next topic

LockDots

I'm trying to find a relay (perhaps a pulse-timer relay) that energizes a relay's coil upon activation but does NOT begin to "count down" until after the trigger signal is removed. Does anyone know of a relay or circuit that does that or how to modify an existing pulse-timer relay to do so?

Most PTR's I'm finding will energize a coil and start counting down at the same time. The problem with this is that if my trigger lasts 10 seconds but the PTR is set for 2 seconds, the relay coil will only energize for 2 seconds despite the 10 second trigger. Once the trigger is removed nothing happens since the PTR is waiting for a new trigger signal.

Conversely, if I take a negative trigger and go directly to the 555 timer's trigger pin with a 10 second trigger, the relay will energize for the duration of the trigger but de-energizes upon removal of the trigger. In other words, I "lose" the count down.

I've built a circuit for an automotive application. To avoid having the circuit powered for a constant power line, I would like to use a custom PTR to provide power from the vehicle's 'constant' wire to the circuit upon being triggered from the vehicle's ignition or accessory power, and to stay on for a while after the ign/acc is removed. I hope that makes sense.

robtillaart

something like this (partial code, will not run)

Code: [Select]

unsigned long countdown = 2000;
unsigned long start = 0;

void loop()
{
  if (digitalRead(TRIGGERPIN) == HIGH)
  {
    digitalWrite(RELAYPIN, HIGH);
  }
  else  // trigger == low
  {
    if (start == 0 && digitalRead(RELAYPIN) == HIGH)  // only when relay has started
    {
      start = millis();  // remember the time the trigger went low
    }
  }


  if (millis() - start > countdown)  // wait until countdown has passed
  {
    digitalWrite(RELAYPIN, LOW);
    start = 0;                           // reset
  }
}


 
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

LockDots

Mind explaining how this works? It seems I would need a microcontroller powered constantly to run this, no?

robtillaart

Quote
no?

yes!

Think even the smallest arduino (tiny85 ?) can do this.

To understand the algorithm, follow it with paper and pencil and write out what happens in  ACTION -> EFFECT lines.

0) start and do nothing  -> relay switches off (no state change)
1) press trigger -> relay switches on
2) ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

LockDots

I guess I should have specified better. I would like to avoid having to power  a microcontroller to avoid a current draw. This is the reason I'm using a trigger to energize a relay that provides power to the microcontroller. Once the trigger (that powers the microcontroller via a relay) goes away, the relay should stay on for a duration of time continuing to power to microcontroller until the relay times out.

Go Up