Maker Pro
Maker Pro

Need to abort a 555 1-shot timer with same pulse that triggers it

okasional

May 14, 2017
4
Joined
May 14, 2017
Messages
4
Abortable 555 Timer.jpg I'm trying to design a device that uses a monostable 555 timer to provide an output signal of several minutes duration. The unique requirement is that if the timer receives only one start pulse it should run its full timing cycle, but if a second identical pulse is given (an abort pulse) while the timer is running, the 555 is reset immediately, and everything is back to the starting point.

Gates C and D steer the input pulse to either the TRIGGER or RESET pin of the timer, depending on whether the 555 OUT is low or high, respectively. R3 and C2 are to delay the switchover between trigger and reset and vice versa, so as to avoid a race condition. The circuit works sometimes, more or less, but is not what I consider reliable. Perhaps someone can suggest an improvement or another simple way to do this.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
I think the RC delay is probably way too large. Actually, not sure why it is needed at all.

Bob
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
If you have any issues at all it will relate to the CR time constants of the integrators in the input and 'feedback' circuits.

You should put a 'debounce' circuit on the input with an integral period shorter than the CR constant of the 'feedback' cirucit.
 

AnalogKid

Jun 10, 2015
2,892
Joined
Jun 10, 2015
Messages
2,892
The input differentiator has a nominal 10 ms output pulse width. Because the 555 prop delay is less than that, the rerouting of the input from the trigger input to the reset input cannot happen while the input is low. R3-C2 delay the input routing change until after the input pulse has timed out. But it needs to be only about 5 x the input pulse width, not 100x.

You have given zero details about the input signal, especially its "cleanliness". If the input is bouncing when R3-C2 finally times out, this will give erroneous signals to the trigger and reset inputs. Reduce R3 to 10K and see if that helps.

ak
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Thats is a bit pessimistic. I think most people with some electronics experience could learn enough about Arduino for this project in a matter of days.

Bob
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,716
Joined
Nov 17, 2011
Messages
13,716
Thats is a bit pessimistic. I think most people with some electronics experience could learn enough about Arduino for this project in a matter of days.
Youre right, Bob.

Anyway, I support the OP's idea of using a (more or less) discrete circuit. One can learn from such a circuit, be it only by debugging it as AnalogKid has started to do.
 

AnalogKid

Jun 10, 2015
2,892
Joined
Jun 10, 2015
Messages
2,892
Based on my own experiences learning C++, programming a PIC, debugging code written by people way more experienced than me, and stories on other fora, I think the total time delay from a cold start with an unknown language, unknown compiler (an entirely separate can of worms), unknown programmer, and no experience in how to select, assign, and configure I/O pins and functions, my guess is 90 days minimum. That does not include figuring out the program to do the job, including handling the race condition. Interrupts, timers, and logic; Oh my!

ak
 

Bluejets

Oct 5, 2014
6,916
Joined
Oct 5, 2014
Messages
6,916
Come on fellas.... It's not That difficult to learn to program Arduino. Kids in primary school do it every day.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
It depends on where you are starting. I am a software engineer and electronics hobbyist, who had not done anything with microcontrollers before, and I was able to program PICs with a PICkit 1 on the first day, and had built my own NiCad charger on stripboard within a week. And PICs are way more difficult to learn than Arduino.

Bob
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,716
Joined
Nov 17, 2011
Messages
13,716
I was going to argue with the cost, but surprise:

Mouser prices (singles):
555: $ 0.432
CD4093: $ 0.392
Add another $ 1 for all the small stuff (resostors, capacitors, LED)
-> Total: ~ $2

Arduino Nano ~ $2 on ebay

The arduino is not considerably more expensive, contrary to what I was expecting.

Isn't it crazy that we discuss using a microcontroller that has more computing power than an early pocket calculator to perform such a simple task?

One advantage of using the arduino rather than the discrete solution is that the same arduino will be able to perform lots of additional tasks which would require additional electronics on the output of the original circuit from post #1. All but the high power stuff.
 

okasional

May 14, 2017
4
Joined
May 14, 2017
Messages
4
OK, OK, you guys have convinced me! I'll crack this nut with a sledge hammer, and finish it this year, if you'll help. Be gentle. It's my first Arduino. I've found the perfect solution -- the "Trinket." It's very small board (0.6" x 1.2") designed with headers so that it can be installed as a through-hole component. It has all the GPIO I need (5), and the cost is only $7.
Trinket Timer Schematic.jpg
In the schematic above, pressing S1 starts a 1-shot timer, turns on the LED, and outputs a short pulse on PB0. Unless S1 is pressed to abort the timer, at the end of the 1-shot period the timer is reset (or just stopped), the LED is turned off, and another short pulse is output from PB0. But if S1 is pressed during a 1-shot period, timing is terminated immediately, the LED turned off, and another short pulse is output on PB0.

The period of the 1-shot timer is stored in EEPROM in a variable having a decimal value of 1 to 8, which is the 1-shot period in units of 30 seconds. At startup this value is retrieved from EEPROM. A subroutine to be added later allows the 1-shot period to be customized by counting 1 to 8 presses of switch S2 when the timer is not active. This is referred to as "calibration" While a calibration is in progress, input from switch S1 is ignored. (As you can see, if the discrete component circuit is going to be replaced by a processor, let's make the most of the additional capability.)

The switches will be typical snap-action PCB switches, so inputs can be anything from a hundred milliseconds to several seconds, and debounce is probably necessary. I can live with whatever timing accuracy the internal clock gives us.

I've ordered a couple of Trinkets, and I have downloaded something called Arduino 1.8.4 (I thought I was downloading Arduino IDE). I get a warning that my Windows Firewall has blocked some features of Java. Can someone tell me what additional tools and/or software I will need to become as proficient as one of those primary school kids. I may try to lure one of those kids over with an ice cream cone to program this thing. Any help to get me setup will be appreciated. Once I get any kind of basic program that can be loaded with the boot loader, I can experiment with it by trial and error. Does the Arduino IDE include an editor that provides any help with syntax errors, etc?

okasional
 
Top