Making a circuit with two one-click switches, one closes the circuit, the other opens it

Thread Starter

AriesBreath

Joined Sep 22, 2020
11
Hello, new member here. I would like to clarify that I'm almost not educated at all in electronics even though I like it. I searched for some answers online but the problem is hard to put on few words, so when I found this forum I thought I could ask for help, actually a solution, or better, some instruction as I probably will not thorougly understand what I will be doing but I need to do it, and hopefully learn something while doing it. I know that the better way for me to learn is by studying but I know better that I would abandon the project if I had to start from the beginning.

I play Airsoft and I like to cutomize or modify my weapons. The majority of the existing weapons are completely mechanical and the gears work thanks to a motor connected to a battery. One of the cable is divided in two parts connected to the trigger: when the trigger is pulled, the contacts touch, the circuit is close and the battery gives power to the motor that spins the gear.

The full-auto mode is simple, the motor spins until the trigger is released and that's it, but I need to achieve even a singel shot mode. The single shot mode is a bit more complicated. Normally it is achieved by a mechanic system that, when a gear reaches a full cycle, moves a lever (Cut-off lever) that separate the contacts and opens the circuit, stopping the motor from spinning.

Now, for some reasons (high battery voltage (11.1 volts, 20-30 C) damages the trigger contacts, better trigger response, trigger moved in another spot), I would like to build a MOSFET system that can be connected to the battery and controls the current this way:
1) When the trigger is pulled, a microswitch(start) gets pressed. It should work with a single click or by staying pressed either way.
2) The microswitch(start) activates the MOSFET that gives energy to the motor.
3) The motor spins and makes the gears works until it completes a cycle. When it completes a cycle and the single shot is selected, a gear will move the cut-off lever that can be used to click another microswitch(end).
4) When clicked once, the microswitch(end) should cut the power off from the motor, regardless of the microswitch(start) position (still pressed or not).
5) After the cycle, the microswitch(start) can be pressed again or released and pressed again to start another cycle.

There are some tutorial on making a basic MOSFET that controls the opening and closing of the circuit, but I found none with this system I described. How should I do it? What MOSFET or resistors should I buy?
 

AnalogKid

Joined Aug 1, 2013
8,608
The circuit you want is called a flip flop (flipflop, ff, etc.). There are several kinds, and we'll need more clarity about how the gun works to determine which type fits your application.

ak
 

MrChips

Joined Oct 2, 2009
21,911
A flip-flop has a CLOCK input, data input (D-type) or J-K inputs, RESET (or CLEAR) and sometimes PRESET (or SET).
Trigger signal (start) goes to the CLOCK input to set the Q-output of flip-flop high while Data is high.
Second switch (end) goes to CLEAR in order to reset the Q-output to low.

1600779610733.png
 

Thread Starter

AriesBreath

Joined Sep 22, 2020
11
we'll need more clarity about how the gun works to determine which type fits your application.
Here is a video
that lets you see exactly how an airsoft gun works, but the important part is the trigger contact and the Cut-Off lever. If the single shot fire mode is selected (the fire mode can be selected with a moving plate that lets the Cut-Off lever work properly) the Cut-Off lever will separate the power contacts when a cycle is completed, If full auto mode is selected, the Cut-Off lever will be out of the way and the cycle will stop only when the trigger is released. You can see at 3:39 the green Cut-Off lever that moves one of the contacts away from the other, returning the system in the rest state and cutting the power off from the motor even though the trigger is still pressed. The trigger then can return to its initial state and the cycle can be repeated again.

I want to use that Cut off lever by installing a microswitch(end) that will be pressed by it, interrupting the power flow to the motor, so that:
1) The cycle can be started from another spot (I want to move the trigger from the gears) by clicking a microswitch(start) once
2) The microswitch(start) activate the mosfet that lets the energy flow from the battery to the motor
3) As the gears spin and the cycle is complete, the cut off lever will move and press the microswitch(end) that will deactivate the MOSFET and stop the power to the motor.

The concept is: one switch tells the MOSFET to supply power, another switch tells the MOSFET to stop supplying that power.

Also I just realised that if the full auto mode is selected thus the cut off lever doesn't move, there is no way to stop the cycle from repeating, so I have to either a) make a compromise and let the power stop when the microswitch(start) is released or b) install a state switch on the fire selector that tells the MOSFET if the single shot is selected (the power can be stopped only by the click of the microswitch(end)) or the full auto is selected (the power can be stopped by releasing the trigger / microswitch(start)), but this option seems too complicated so I think that thje option a) is better
 

Thread Starter

AriesBreath

Joined Sep 22, 2020
11
Doesn't the single-shot stop switch still work in the auto mode when the trigger is released to complete the last cycle?
No because when the full auto mode is selected, the Cut-Off lever is moved out of the way and it will not move to click the microswitch(end) at the end of a cycle
 

crutschow

Joined Mar 14, 2008
25,462
No because when the full auto mode is selected, the Cut-Off lever is moved out of the way and it will not move to click the microswitch(end) at the end of a cycle
So how does it complete the last cycle?
If the trigger cut off in mid cycle would't that be a problem?
 

Thread Starter

AriesBreath

Joined Sep 22, 2020
11
So how does it complete the last cycle?
If the trigger cut off in mid cycle would't that be a problem?
It can be considered a problem but it's a common one. When a normal airsoft gun is fired but the user doesn't pull the trigger for enough time (dependent on the battery voltage, gears quality etc), the gears spins but don't complete the cycle, and the gun doesn't actually shoot. When the trigger gets pulled again, the cycle starts from where it stopped.

The guns equipped with a high quality mosfet don't suffer from this problem, but I repeat myself, it's common and I can make a compromise if the solution is complicated. I just want my new trigger to start the cycle, and another switch to stop it
 

crutschow

Joined Mar 14, 2008
25,462
Below is the LTspice simulation of a circuit using a 555 timer as a latch that, I think, does what you want.
When in the single-shot mode (green trace low) the Trigger signal (blue trace) turns on the MOSFET (red trace), and the Stop signal (yellow trace) turns off the MOSFET.
When in the Auto mode (green trace high) the MOSFET turns on and off with the Trigger signal.

1600800667652.png
 

Thread Starter

AriesBreath

Joined Sep 22, 2020
11
Below is the LTspice simulation of a circuit using a 555 timer as a latch that, I think, does what you want.
When in the single-shot mode (green trace low) the Trigger signal (blue trace) turns on the MOSFET (red trace), and the Stop signal (yellow trace) turns off the MOSFET.
When in the Auto mode (green trace high) the MOSFET turns on and off with the Trigger signal.
Let's see if I'm understanding correctly. I remember that MOSFETs get activated when passed by a current above their resistance threshold (I think), acting like a switch.
So, reading your first image, I see that when the trigger is pressed, the current instantly activates the mosfet. If I stop pressing the trigger in this moment, does it stop? The current then gets stopped when the second microswitch gets pressed once. Then I see the trigger is still pressed but nothing happens. At 5 seconds I see that the green line is now at 5 volts, is it just for reference/readability? Is it consuming power while in this state? The trigger is then pressed and the MOSFET gets activated, and then deactivated when the trigger stops being pressed.
So it seems to work fine.
But, what is the extra hardware needed to achieve the full auto logic change? It looks like a big circuit, and maybe it could be lighter without that
 

crutschow

Joined Mar 14, 2008
25,462
I remember that MOSFETs get activated when passed by a current above their resistance threshold (I think), acting like a switch.
You are thinking of bipolar junction transistors.
MOSFETs are activated by a voltage between their very high-impedance gate and source terminals.
0V is off and 12V is fully on, as a switch.
If I stop pressing the trigger in this moment, does it stop?
In the single-shot mode it will fire only one shot, terminated by the second switch, no matter how short or long the trigger is pressed.
At 5 seconds I see that the green line is now at 5 volts, is it just for reference/readability? Is it consuming power while in this state?
No, the green trace just shows the state of the Auto switch.
When low the Auto switch is off, and when high the Auto switch is on.
 

Thread Starter

AriesBreath

Joined Sep 22, 2020
11
crutschow can you please explain the diagram to me? I can't barely read it, and in my ignorance I'm seeing multiple sources of power while I only can use a single battery
 

djsfantasi

Joined Apr 11, 2010
6,850
crutschow can you please explain the diagram to me? I can't barely read it, and in my ignorance I'm seeing multiple sources of power while I only can use a single battery
One point. There are multiple places that connect to 12V; there is only one power source. It’s on the left of the schematic.

In a schematic, when several nodes have the same label, they all are connected. The battery node labeled 12V connects to all similarly labeled nodes.
 
Top