Flip flop circuit with a twist (dual triggers)

Thread Starter

basrijn

Joined May 25, 2020
9
Hi,

I’m trying to build a circuit to turns on an LED when a button is pressed (system “armed”)

There is a second button that is pressed several times in a row, every time that button is pressed it sounds a horn. It should sound for as long as the button is pressed.
The twist, on the first press of the second button, the light should turn off. It should NOT turn back on until the first button is pressed.
I’ve tried a 555 timer for the light flip - flop and that works fine. I have a mosfet to sound the horn.
But when I try to combine both functions, things go wrong. It upset the delicate balance of the 555 timer I guess.
I’m just getting started with electronics so don’t know very many “tricks”. Any pointers / suggestions are very welcome.
The application is for rowing. There is an existing (battery powered) horn that is triggered by somebody pushing a switch every time a boat crosses the finish line. Currently, a flag is raised a short while before the first boat crosses, the flag is dropped when the horn sounds for the first crossing.
Plan is to replace the flag with the light. Use the current plunger switch to drive the above project that mimics the plunger press to sound the horn (mosfet) and turn the light off.

tx
Bas
 

jbeng

Joined Sep 10, 2006
84
You will find, that in nearly every instance of someone posting questions about their circuit, one of the first responses is very likely to be "post a schematic".
 

Thread Starter

basrijn

Joined May 25, 2020
9
You will find, that in nearly every instance of someone posting questions about their circuit, one of the first responses is very likely to be "post a schematic".
Hi Jeff,

I didn't include the circuit for the 555 timer because that might not at all be the right solution. I guess I was asking more for what type of circuit to solve the particular challenge.

Attachment is the 555 timer circuit that works for turning the light on and off

Bas
 

Attachments

WBahn

Joined Mar 31, 2012
30,060
I would recommend doing a timing diagram of what you want the outputs to be in response to a sequence of inputs.

You don't need a timer for anything because you aren't timing anything. It is a straight forward state machine.

The simplest way would be to make a synchronous machine, but then you need a clock. However, clock oscillator ICs are plentiful and cheap.

The more elegant way is to do it as a fully asynchronous machine, but there be demons in those waters. However, this one is simple enough that they are pretty easily managed. In fact, as I think about it, this should be doable with a single RS flip flop (or two cross coupled NAND gates). There's no need to debounce anything as near as I can see at a glance. I'm guessing what I have in mind is the same circuit that @djfantasi is thinking of.
 

Thread Starter

basrijn

Joined May 25, 2020
9
I would recommend doing a timing diagram of what you want the outputs to be in response to a sequence of inputs.

You don't need a timer for anything because you aren't timing anything. It is a straight forward state machine.

The simplest way would be to make a synchronous machine, but then you need a clock. However, clock oscillator ICs are plentiful and cheap.

The more elegant way is to do it as a fully asynchronous machine, but there be demons in those waters. However, this one is simple enough that they are pretty easily managed. In fact, as I think about it, this should be doable with a single RS flip flop (or two cross coupled NAND gates). There's no need to debounce anything as near as I can see at a glance. I'm guessing what I have in mind is the same circuit that @djfantasi is thinking of.
Very cool, never thought about using a diagram like that. Two input buttons: one to "arm" the finish light, one to sound the horn. Note that the length of the push on the horn button needs to be reflected on the output.

You might have two finishes very close together, so the operator presses the button very quickly
 

Attachments

Thread Starter

basrijn

Joined May 25, 2020
9
An 8 pin PIC 12F675 would be my choice.
I just started doing some research on the ATTINY85. Didn't realize how cheap they are, and I have everything (skills and hardware) to program the behavior I'm looking for. Maybe that is easier then other solutions?

Bas
 

WBahn

Joined Mar 31, 2012
30,060
An 8 pin PIC 12F675 would be my choice.
That would be a good way to go except for the "I’m just getting started with electronics" statement. There's quite a bit of overheard in setting up to be able to program the parts plus learning what is needed to write the program. If the TS is wanting to get into that for other projects, it's a good investment. Otherwise, it's hard to beat a solution that uses one ten cent IC chip (maybe a dollar in single quantities) and a few passives.
 

WBahn

Joined Mar 31, 2012
30,060
I just started doing some research on the ATTINY85. Didn't realize how cheap they are, and I have everything (skills and hardware) to program the behavior I'm looking for. Maybe that is easier then other solutions?

Bas
Oh, didn't see this before my prior post. If you have what you need, then an MCU-based solution is probably the first one you should look at for most of these types of problems.
 
Top