I'm trying to design a circuit that uses a momentary switch/push button to turn on an LED, then it turns off after 1 sec if the switch is held in the ON position longer than that. Below is a diagram of what I've attempted but it doesn't work and I'm not sure what I need to do to fix it.
D1 = an indicator LED just to let me know the switch works. This should be on when switch closed, off when switch open. This is working as expected right now.
D2 = the LED I want to turn on immediately when switch is closed, but I want it to turn off after 1 second if the switch is kept closed. So if switch is closed for 3 seconds, this LED should only be on for the first 1 second.
RLY = I'm using AZ943-1CH-12DE. If I'm reading the datasheet correctly, it seems this is a 12VDC relay, but the coil activates around 9VDC?
Power source = 12VDC laptop-style power brick, which actually supplies closer to 12.5VDC, rated @ 8A.
I have D2 connected to the RLY's "normally closed" output, so when I turn on the switch, D2 also turns on, but it never turns off like I want it to.
I thought the RC time constant would be 1 sec since C1*R2 = .001 * 1000 = 1, but using the setup below, the relay never engages. I used a multimeter to measure voltage drops across R2, RLY, and C1 and the C1/RLY only seem to use 0.8V or so which explains partially why the RLY isn't turning on. R2 drops the voltage by 11.5V.
Is my problem that the R2 resistance is dropping the voltage too much before it even hits the capacitor and relay?
Appreciate any advice!
simulate this circuit – Schematic created using CircuitLab
Thank you everyone for the informative replies! After reading, I decided to try this using a 555 IC instead of just the R-C circuit to trigger the relay. The below seems to work, where closing the switch turns on the relay (closing the relay switch and powering the load -- a motor in this diagram), then it turns off after a short time. I can of course change the time before shutdown by increasing R1 to create a longer delay before it shuts down.
This seems to work practically, but if there is any feedback on this I'm of course open to hearing. The one question I had is regarding the flyback diode that @Piotr suggested -- is the diode D1 in the correct position and orientation for this? What does this actually do? Does it protect my 555 in this case from getting increased voltage on the output pin when the relay is shut off?
@Kuba, I still want to use the relay here in addition to the 555 because the DC motor pulls a higher current from the stop-to-start and I wasn't sure the 555 could handle something that might be a very brief 4-6A draw -- so I figured using the 555 to trigger the relay might be the safer way to go?