Delayed switch - maybe with NE555 - Page 1
Forum section: electronics / projects

author: ksrele
author_rank: Contributor
timestamp: September 16, 2013, 04:38:17 pm
content: Hello all, and thank you Dave for this forum and blog.This is my first post here, and my english is not so good but I think that you will understand me. I don't use Google translate because I don't have time to copy-paste for just few mestakes.So, now my question.I need a switch but it need to work like this:-input voltage is low most of time and output of switch is low too-input voltage is setted to high and output MUST me low until input is high for at least 2 or 3 secunds then output MUST be hight and stay like that until input is hight, and when input goes to low output must go to low as soon as it is posible-input MUST be capacitor free, because switch must not sum time, for ex. if input is HIGH for 1 sec and then low for 0.3 sec and then hight for 1.5 sec outup MUST stay low, it can be hight only if input is high for > 2 secI have idea to build this with NE555 as clock generator for some counter and when I hold input high counter is counting and if I put input to low then it will be reseted. And if input is high long enought then counter will count to some vaule and that value will be detected by logic after counter.This is clean solution but it is complicated and I want as simple as it can be.

author: dodad_guy
author_rank: Contributor
timestamp: September 16, 2013, 07:45:05 pm
content: I built one years in the 1970's using a 555 timer. It uses a capacitor. The capacitor resets when the input goes low. I used a transistor to pull the capacitor high (I think) instead of the chip's pin #7 (which pulls the cap low). It stays high until the transistor turns off, at which time the capacitor starts its discharge cycle (this is when the delay timing starts). Let me think about it a while. I might be able to give you the basic circuit when my brain resets.What is the value of the input voltage?

author: ksrele
author_rank: Contributor
timestamp: September 16, 2013, 08:12:05 pm
content: Well, whole project is this:I have telephone line to other house where I have 2 phones and in fist house I have 2 more phones all on same line. It is imposible to put new cables for mini telephone exchange.So, I have idea to near every phone put some circuit (black box) which will have function to listen for DTMF tones on line and when it detects selected tone it will activate small buzzer. This way we can call eachother from one to other house on same line. So, if I want to call my dad in his office then I will pick up the phone and press and hold numer 1 for 2-3 sec, then ONLY his buzzer will go on.DTMF detection part is easy with MT8870 IC and BCD decoder but idea is that buzzer don't buz on simple dialing. So I need some delay for this. So, this device what I need will be conected to output of BCD decoder (74HC42), that is TTL level.How there is no some hybrid logic/analog IC for this. It can be in 8 DIP package with input out put and some logic or analog way for setting delay.

author: crisr
author_rank: Contributor
timestamp: September 16, 2013, 08:59:32 pm
content: I made something like this once just using a couple or resistors, capacitor and relay: resistor - capacitor to GND - NPN transistor base (emitter to GND, collector to relay to VCC).For your application, without using MCUs, counters or other digital logic, you will probably need a capacitor; you just have to make the circuit in a way that the capacitor charges through a large value resistor but discharges through a very low resistance, maybe using a transistor to pull the top side of the cap to ground when input is low, or using a diode in parallel with the charge resistor, if your input is not open-collector type.

author: ksrele
author_rank: Contributor
timestamp: September 16, 2013, 09:17:21 pm
content: I will try that way... what to say.Just one question: what if I could make it like this: I make oscilator with 555 but with very long periods and I connect Vcc to output of previous stage so when output is low there is no Vcc for 555 but when output ih high then 555 starts its work but with half period of 2 sec and other half period of 2 sec when Buzzer buzz (or how do you say it).Is that good solution? Does 555 always starts output at same position on time line?

author: dodad_guy
author_rank: Contributor
timestamp: September 16, 2013, 09:24:17 pm
content: OK... here it is. It has been over 35 years since I built it, but this looks like it will work. I will let you breadboard it and select values. R and C are your timing components. R1 and R2 bias your transistor so that it will turn off if the input voltage is too low. The timer has everything inverted from a standard configuration. Here are some values you might use as a starting point. R - 10k / R1-10K / R2 - 4.7k / C - 10uf / C1 - .05uf. PNP transistor - 2N3906. That should give you something which functions, but is probably outside of your parameters.THEROY OF OPERATION:INPUT GOES LOW, turning transistor on, discharging capacitor. Pin #6 goes high driving the output low.INPUT SWITCHES HIGH, turning transistor off removing short across the capacitor, which begins charging C through R (the timing cycle). When the negative end of the capacitor drops lower than 1/3 V+, pin #2 drives the output high. Everything resets to the output-low state when the input goes low.Let us see your results when you finish it.

author: dodad_guy
author_rank: Contributor
timestamp: September 16, 2013, 09:37:09 pm
content: Your comments occurred while I was commenting so I didn't update the component values. The 555 timer circuit will work with a 5 volt supply. You will probably want to make R1 and R2 much lower values. The timer output will drive a 5 volt relay.

author: ksrele
author_rank: Contributor
timestamp: September 16, 2013, 10:33:21 pm
content: Thank you.I understand it and will try to make something with it.No, power supply can be what ever I need, but I just was thinking to output of previus stage to be power supply for 555. Now I see how it was stupid.So your first values are OK.

author: ksrele
author_rank: Contributor
timestamp: September 17, 2013, 12:55:57 am
content: I simlated this and it workswith 5V supply. It is perfect!Thank you dodad_guy!Here is a screen from simulation:

author: dodad_guy
author_rank: Contributor
timestamp: September 17, 2013, 09:54:18 am
content: Thanks for the update. I simulated it in my head but I haven't built it on my breadboard in many years. It is nice to know that the grey-haired brain can still function.

author: dannyf
author_rank: Super Contributor
timestamp: September 17, 2013, 11:03:16 am
content: A mcu-based solution would be simpler in hardware.

author: MrAureliusR
author_rank: Unknown
timestamp: September 18, 2013, 05:17:59 am
content: Agreed with dannyf. Personally I love the ATtiny13A. Same size as 555 but a million times as useful.Not to say I don't like the 555 - I've got 50 of them on my bench and only 30 13A'sTyped using Hacker's Keyboard for Android

author: dodad_guy
author_rank: Contributor
timestamp: September 18, 2013, 10:07:08 am
content: It sounds good to me. Show us the schematic.

author: dannyf
author_rank: Super Contributor
timestamp: September 18, 2013, 12:39:40 pm
content: QuoteAn input pin connected to the mcu (maybe with a serial resistor) and an output pin from the mcu?

author: dannyf
author_rank: Super Contributor
timestamp: September 19, 2013, 02:28:38 am
content: Rough logic:Code:if ((~SW_PORT) & SW_IN) { //if any pin is lowcycle = 0; //reset cycle countturn off the output;} else { //all pins are highcycle += 1; //increment the channelif (cycle == CYCLE_COUNT) { //sufficient time has elapsedcycle = 0; //reset cycle countturn on the output;}}delay_ms(SW_DLY); //waste small account of time.Implmented the above on a PIC12F675 and it took just 100bytes before any omptimization.

author: 47MHz
author_rank: Newbie
timestamp: September 19, 2013, 08:46:24 am
content: You can use something like that:There is no need to use optocoupler if the rest of your system is 5V or 3.3V logic.

author: dannyf
author_rank: Super Contributor
timestamp: September 19, 2013, 11:20:29 am
content: An opto could be ussful if you want isolation.Otherwise, a sufficiently sized resistor will work on the input and a transistor will on the output. The code I presented allows for multiple input pins to drive the same output pin: it runs on negative logic as is but you can easily write it on positive logic;

author: dodad_guy
author_rank: Contributor
timestamp: September 20, 2013, 10:19:30 am
content: I started playing with electronics in the vacuum-tube days, when a transistor's cost was a day of delivering papers. I quit in the mid 1990's. I recently got back into electronics to fill in my semi-retirement (hence the ugly, hand scratched schematics).WOW! I am amazed with what is now available. I pulled up the ATtiny13 datasheet... 175 pages. My grey-haired brain is spinning. I guess I have a lot to learn. The "rough logic" lost me. Could you suggest any tutorial websites for the ATtiny13? Thanks

author: dannyf
author_rank: Super Contributor
timestamp: September 20, 2013, 11:24:07 am
content: QuoteSome of the mcu's datasheet go over 1000 pages,The 8-bit mcus are fairly easy to start. In the AVR family, the ATMEGA328p for example is fairly nice chip, with a good set of peripherals that allow you to go up or down in the family easily. That would be a good starting point.