Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Hi just after a little help

Status
Not open for further replies.

Harv

New Member
Ive got a problem and dont know to much about electronics basically i have 2 switchs when the first is pushed i need circuit to be made and the 2nd when pushed to break circuit until first switch is released and pushed again but when the 2nd is pushed in to start with then to then leave the first switch alone ive got about 2cm in height and 3cm x 3cm and under 3mA any help would be appreciated even if its just pointing me to place in luton that could help
 

Attachments

  • 20160111_212934.jpg
    20160111_212934.jpg
    663.2 KB · Views: 218
Two switches, A (first) and B (second). Make = circuit is made; Break = circuit is broken

A and B both are released.
If A is pushed before B, Make
When B is pushed, Break
When A is released and pushed again, Make
etc.
Question, what happens if B is held while A is released and then pushed again?

If B is pushed before A, ignore A always until B is released.

Is this correct?

The "released and pushed again" part means tis probably will take at lease one flip flop.
What is the voltage range of the signal being made and broken?
What power is available to run the logic circuit?
Does this have to be industrially rugged (lots of interference, big motors arc welders in the area, etc.)?

ak
 
Hi Harv,
Welcome to the forum. You will need to give more details before members can suggest a solution.
1 Are the switches momentry action for example micro switches ? (Or do the contacts remain closed untill it is pressed a second time ?)
2 The case when the second switch is pressed first exactly what do you mean by "then leave the first switch alone" (Do you mean that the first switch no longer has any effect and the output of the circuit will no longer be able to switched on ? If so how do you want to get out of this state ?)
3 You say you have less than 3 mA available but you do not say what the voltage is.
4 What is the load that you want to drive with the circuit ? (Voltage and current and is it AC or DC ?)

If your supply is 3 volts or more you could probably use CD4000 series IC's or a small PIC (Such as a PIC12F629) or a small Atmel micro (such as a ATtiny13)

Les.
 
My guess is that "dont know to much about electronics" probably includes 'don't know too much about C++'.

ak
 
Analogkid sounds like youve got it the volt will be a lipo 14.8v and 35amp at most probaly be a 11.1v but a mosfet will handle this and this circuit be just a signal wire so should be low and its just a hobby item running a motor so interference should be low i think i answer your questions below

Les james
In the first instance the A switch makes and the B is a momentary press to break until A is released and pressed again the 2nd instance B is pressed in before and held and A then makes circuit when pressed until released i was planning on using mini micro switches im hoping to replace a single switch on a trolly system the switch is pulled out of way by lever unless that lever is pushed up first hope this is clearer
Thanks
 
Last edited:
I'll post some pics tonight of item may help i could use a 3rd switch to cut of B so A is free to make and break but i would like to avoid this as it would be outside casing and would be vulnerable
 
Last edited:
If I understand your reqirements then I think this should work.
Image120116_01.jpg

It will require a small change to ensure it powers on in the correct state. Also the D input of the flipflop should be connected to +5 volts. (I forgot to draw that line on the schematic.) If switch A goes from the open to closed state first then the flipflop is set as the transistion clocks in the high on the D input of the flipflop. the not Q output drives two of the four negative inputs of the quad negative input OR gate. (This is just an alternative way of thinking of a quad input NAND gate.) This drives the output high. When switch B is pressed it forces the flipflop into the reset condition switching off the output. (If switch A is still closed the output will NOT go low untill the B switch is released. If this will cause a problem then another flipflop will be required) If the B switch is pressed first and held pressed then the state of the A switch is routed through the two gates to the output. The circuit uses half of a CD4013 dual flipflop and both gates in a CD4012 dual quad input NAND gate

Les.
 
Last edited:
I think im getting this and the gear that hits the lever to press B is spinning very fast so unlikely to stop in time for it to still be pressing it but if it did just taking battery out should sort it? Or if i release A and press again would it think it was instance 2 and just keep motor running. And d just goes straight to line above and the 4012 would run in that order which would be just pins from one side of the chip and 2nd part from other side of chip and am i right in thinking any spring based switch would work for A&B would like to use microswitchs

Thanks

Stuart
 
Last edited:
Hi Stuart,
I cannot comment on the suitability of microswitches without knowing what the purpose if this circuit is. From your diagram it is not clear as to weather the pin sticking out of the gear hits the lever which operates the switch and stalls the gear when the lever hits the switch or weather it just catches the lever and so generated a pulse for each revolution of the gear. It would be a great kelp to know the purpose of the circuit and some propper details of the mechanical side.

Les.
 
Hi Stuart,
I cannot comment on the suitability of microswitches without knowing what the purpose if this circuit is. From your diagram it is not clear as to weather the pin sticking out of the gear hits the lever which operates the switch and stalls the gear when the lever hits the switch or weather it just catches the lever and so generated a pulse for each revolution of the gear. It would be a great kelp to know the purpose of the circuit and some propper details of the mechanical side.

Les.

Just catches the lever so pulse every revolution the circuit is part of a trigger for a airsoft gun (basically a toy gun like paint bull) so the trigger spins the motor and pulls back a piston the same gear that flicks the lever lets piston slip to fire the bb semi auto mode the lever will flick switch and break circuit and when put in to full auto mode lever is lifted to keep it firing and im basically trying to shorten the trigger pull well shortening pull isn't a problem its the trigger reset thats the problem, its about a inch now and the pull reset on a microswitch would be a lot smaller and would be adjustable by moving the switch
Thanks

Stuart
 
Hi Stuart,
I can see no reason why micro switches should not be used. For the following comments I am making these assumptions. 1 Switch A is the trigger. 2 switch B is pulsed by the bit sticking out from the gear wheel hitting the end of the lever when in single shot mode. 3 To set continuous fire mode the assembly containing the lever and switch B is moved away from the gear wheel and a cam or something pushes the lever so that it operates switch B. 4 the output of the circuit drives the motor.
The possible problem I described in post #7 would only occur if the trigger was held in while changing back from continuous fire mode to single shot mode. I would think in single shot mode that the motor would always stop either with switch B pressed or just after it was pressed. (As the motor would not stop the instant power was removed.) When the trigger was released in continuous fire mode the motor could stop in any position. I suspect this could cause a problem as I would think there would be a cam on the gear wheel to trigger the firing.

Les.
 
1 yes
2yes
3something is moved to press switch switch stays in same place and lever no longer gets hit but B is being pressed
4 it used to control motor but a mosfet and control unit will handle this and power for motor will come from this this circuit will be just a signal wire coming coming from control unit to the control unit will just see this as on and off

Switching from one fire mode to other whist pressing trigger will not be a problem as this will not happen

And i dont think it would be a problem as in full mode cam would not make contact with lever or switch but B will be pressed in and stay in i think i know wot you mean that gear could stop in postion it pushes lever up but as soon as it moved lever would drop but would the chips act as if was being pushed as it was to start with the gear has lots of teeth missing that hot it fires by letting it slip

Thanks alot for your help i thought it would be simple how wrong i was lol
 
Last edited:
In full mode B will be closed and stay closed untill put in semi semi mode it will be open and need to be closed which be one quick pulse

Il open it tomorrow i may be able make a hole in case and use the lever on the out side of case that moves lever which presses B
So A would make B would break A and then C could break B dunno if this make it easier

Just idea but is there a switch that while be held does nothing and while not being held does nothing but mid way on a press pulses , or could we use the unused port on the A microswitch to reset B
 
Last edited:
Ive marked the lever that will hit B with green it will lift from this position to hit it and go up when in full mode. red one is trigger which will tilt right. photo of case is to show bit that puts it in full mode one on right with rod i was hoping a hole could be made for a 3rd switch so it could be inside and just lever of switch out but this is not possible but could drill hole for wires and have it on rear but this would have to be very flat 2mm and be pushed in from side if i could find switch like this i could use one for cam on gear cut lever part that catchs cam and use it for B only keeping and 3 in case but would worry of durability of switch this small being hit so much

I have redrawn your schematics to make sure ive understand them as im gonna try this as parts are cheap and worth ago and i hoping that it will be very rear that it stops pressing B as this is the moment the spring is let go and motor will have to much momentum to stop here any help or comments will be appreciated
Thanks
20160114_192518.jpg

20160114_192427.jpg

20160114_192356.jpg
 
Last edited:
Hi Stuart,
You have redrawn the schematic correctly except you have connected the output (The output or the right hand half of the 4012) to ground. This should go to the mosfet driver circuit which drives the motor. I would advise adding decoupling capacitors between ground and the positive supply. A 100 nF mylar or ceramic capacitor should be fitted close to the ICs and also something like a 10 uF electrolytic but that does not need to be very close to the ICs If you are using the same power supply for the motor as the ICs then having a diode in series with the positive rail will help reduce any drop in voltage caused by the motor starting current from effecting the circuit. (Diode - to the battery diode + to the circuit positive. In the circuit I have not put in any components to ensure the flip flop powers up in the reset state. If the circuit works as you want I will redraw it with these components added. The DC4000 series ICs can be used with a power supply up to 15 volts. It does not have to be 5 volts. In answer to your question about a switch that generates a pulse I do not know of one. Adding a capacitor and two resistors you can generate a pulse from a normal switch. To get a positive pulse when the switch closes connect one side of the switch to + 5V Connect the other side of the switch to ground via a resistor connect one side of a capacitor to the junction of the first resistor and the switch. Connect the other side of the capacitor to ground via a second resistor. When the switch closes you will get a positive pulse at the junction of the capacitor and the second resistor. The component values will depend on the length of the pulse you require and the impedance of the circuit being driven. The leading edge of the pulse will be fast but the trailing edge will be an exponential decay. If you require more precise pulse the you could use a CD4047 IC (Or similar.)

Les.
 
Thanks again les

I guessing how it is now it will work just not last or not perform at its best with out these extras the control unit has led that lights up so could just test like this but could i test it with motor and under load
And do you think this pulse switch would help with B as it would only pulse potentially fixing problem with cam holding in B when its not meant too
 
I do not think the pulse switch would help. I think it would cause more of a problem. The way you defined the requirment in your first post caused a problem. When you say "when the 2nd is pushed in to start with then to then leave the first switch alone" defined getting into a state that you would not be able to get out of. When you described what you realy wanted to do It clarified what your requirement really was. (As with many posts the real problem with your first post was what the question really is. The real problem I see now is that in the continuous fire mode is that the gear wheel that pulses switch B when single round mode can stop in any position. I think in the continuous fire mode there should be a way to ensure that this gear wheel stops in about the same positon as it would in single round mode. I do not know which parts are part of the original design and which parts are being added.

Les.
 
Hi Harv,
The question that you asked today in a forum mail is not clear. Can you post the full circuit so I can see which outputs that you are refering to. Asking questions offline if not a good idea as it breaks the continuity of the thread.

Les.
 
20160121_210421.jpg
20160121_210447.jpg
20160121_210743.jpg
Ive built the circuit 3 times first time i messed up as had the output on the top pin of the 4012 and the rest of the pins all out by 1 because or this if you held B and then A could be pressed and make

The secound and third time led just stays on with switches doing nothing i was think that i may need power to come straight from battery
 
Hi Stuart,
I have noticed that I have not shown the unused set pin connected to ground as it should be so it does not float high or pick up noise. This will not be the cause of your present problem as it would cause the output to come on when it should not. I built the circuit today and its behaved as expected except for the condition when the B switch is pressed first and held pressed and the A switch is held pressed while the B switch is released. When the B switch is released the output goes low but when the A switch is then released the output goes high. I worked out that this was caused by contact bounce when the A switch opened. This can be cured by connecting a 100 nF capacitor in parallel with the 10K resistor from the clock input of the 4013 and ground. I cannot see any decoupling capacitors that I suggested fitting on the picture of the board that you built. This is something that you should do on all logic circuits.

Les.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top