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.

Urgent help required Pls!

Status
Not open for further replies.

eimaj12000

New Member
hi, I've posted before here but have now narrowed down my problem to the following:

With 2 switches, S1 and S2 positioned as so

S1 S2

How can I connect things up so that a motor operates fwds ONLY when the switches are pressed in the order S1-S2 i.e. so that if they are pressed in the order S2-S1 nothing happens ? Pls note that when I say press I mean the switches are HELD in the order S1-S2.

Please, please can someone help with this as it's for a kid and time is really of the essence.


Thanks guys
 
Forgive me for my ignorance friend, but where would one connect the electric motor in this circuit so that S1-S2 operates the motor ?


Thank you for your reply
 
Also, is there a way that I can adapt this circuit so that S1-S2 makes the motor go one way and S2-S1 makes it go the other ?
 
Ah ok,

Could you show me a circuit to do the above as this would totally solve all my problems.

Basically the same circuit where S1-S2 turns the motor one way and S2-S1 turns it the other. Also, what kind of region do the values of the resistors etc. need to be if I'm operating with like 1.5-3v controlling the motor ?


Thanks again friend
 
Can someone pls help with the above problem? I'd be very grateful as this whole thing is making my poor head hurt :) .


Thanks in advance
 
eimaj12000 said:
Can someone pls help with the above problem? I'd be very grateful as this whole thing is making my poor head hurt :) .


Thanks in advance

Ok,

So what you want is

S1: 0 -> 1 -> 1
S2: 0 -> 0 -> 1 = motor on, until either switch is released.

S1: 0 -> 0 -> 1
S2: 0 -> 1 -> 1 = nothing? Or the motor turning the other way?

Well, off the top of my head, you could try a simple 'D flipflop', with an AND gate. Both buttons (assuming they are 'momentary') would need debouncing, but a simple cap to ground would do. heres what 5 minutes in mspaint does for ya.

This is just the control part, not tested, probably won't work, just a simple idea. You could always use a microcontroller, but I thought logic is pretty cheap and easy to get hold of.
It shouldn't be hard to modify that for operating the motor the other way, but you'll need a half bridge driver, or a full bridge driver if you've only got a single powersupply.



Blueteeth.
 

Attachments

  • Motorsw1.JPG
    Motorsw1.JPG
    13.7 KB · Views: 140
Hi, firstly thanks ever so much for your reply as I am really at my wits end ! As you might have guessed I've bitten off a lot more than I can chew with this so this is why I come to the experts like yourself.

Basically I need this:

S1 THEN S2 pressed (and both held) :motor fwd until either switch is released.


S2 THEN S1 pressed (and both held) :motor rev until either switch is released.


This thing is (supposed to be) a directional sensor of sorts for controlling a DC motor. So with switch arrangement:


S1 S2

An object passing from left to right here hits (and holds as the object will stay in contact with the switches) S1 then S2 and so the motor goes FWDs.
Then an object passing from right to left hits and holds them in the order S2, S1 which REVERSES the polarity of the motor. With either direction, the motor should stop when BOTH switches are released.

Man, if you can solve this for me I'll send you some cash by paypal - that's how bad I need this now LOL. I'm serious though....
 
If you can provide me with a full working diagram (complete circuit with motor) for the above I'll pay you for your time.
 
well, the above circuit does what you want, just without the motor driver (google) and adding reverse just requires another 'AND' gate from the out of the S1/S2 AND gate and the inverted output of the flipflop

I'll draw up a better diagram soon, but I have no idea if it'll work, this is all guess work as I can't really be arsed to prototype something :D

Blueteeth.

Ps. When do you want the motor to stop? when BOTH switches are released or just when 'a' switch is released? basically is it AND or OR?
 
Ok, well here it is...

Let me know if it works. As for logic chips you'll need 3, thats quite a lot, maybe you could substitute the OR gate for a NPN transistor with two diodes on the base, because you only need one of those, and they come in DIP packages of 4 (I tihnk). SO that just leaves the D flipflop, and the AND gates, both of which should be readily available. Check here for part numbers:

http://www.kpsec.freeuk.com/components/cmos.htm

The full bridge motor drover is really basic, and probably not that good, using MOSFET's would give more current to the motor, but I've used power transistors before with success (they get hot even with smaller motors).

You *could* power the whole thing with the same powersupply, as CMOS works from 3-18 volts I believe, where as TTL (the 74** series) requires 5v.
Sorry if you know all of this, but that circuit is pretty basic, and you didn't mention microcontrollers, CPLD's or anything so I don't know what you'll understand.

Regards,

Blueteeth.
 

Attachments

  • Motorsw2.JPG
    Motorsw2.JPG
    40.9 KB · Views: 148
Hi,

First of all sorry for the delay in replying but I wanted to make absolutely sure I had tested this to the best of my ability before posting. Secondly thanks for your help on this.

I'm having a small problem. The bridge circuit works 100% perfect and I tested this separately before doing anything else. Now, the problem I am experiencing is this:

Press S1 then S2 I get zero - no motor running
Press S2 motor runs clockwise but stops as soon as I hit S1

There's obviously a problem somewhere but I can't figure it out. I'm powering the whole thing from one 9V battery (the motor and the control section). I made sure I got the correct CMOS chips also but just can't seem to make this work. Any help would be greatly appreciated and if you leave me your paypal ID I will send some cash to cover your time.


Thanks again
 
eimaj12000 said:
Hi,

First of all sorry for the delay in replying but I wanted to make absolutely sure I had tested this to the best of my ability before posting. Secondly thanks for your help on this.

I'm having a small problem. The bridge circuit works 100% perfect and I tested this separately before doing anything else. Now, the problem I am experiencing is this:

Press S1 then S2 I get zero - no motor running
Press S2 motor runs clockwise but stops as soon as I hit S1

There's obviously a problem somewhere but I can't figure it out. I'm powering the whole thing from one 9V battery (the motor and the control section). I made sure I got the correct CMOS chips also but just can't seem to make this work. Any help would be greatly appreciated and if you leave me your paypal ID I will send some cash to cover your time.


Thanks again

OOoo, hi :D

Well looking over the circuit, it appears I made a couple of mistakes, sorry. Yes, the bridge is a tried and tested simple method for making a motor run either way on a single supply (not a dual +, GND, -supply).

As for the control circuit. A little explaination.....

The 'flip flop' part, I'm quite pleased with. S1 is the input to it, and S2 provides a clock. So, because both buttons are normally open...and pulled to ground, they are '0'. If you pressed S2 THEN S1, you are clocking in a '0' to the flip flop, then changing its input...so the output of the flipflop is '0', because the FF only reads the input when the clock goes from low to high. Any changes made to the input (S1) make no difference whatsoever unless S2 is pressed AFTER S1. So for that part at least, its all good.

Now, the problem arises with the 'OR' part. The output of the flipflop is only part of the problem as its output stays on if you pressed S1, then S2. The only way to change the output is to pressed S2 without S1 being pressed before, (so, S1 is open, it shows '0' to the input of the FF, and you clock that in with S2). I used an OR gate so that only when BOTH switches are released from a press, does it provice a '0', and therefore, when anded with the FF output (normal or inverted) turns this off.

There-in lies the problem though. Because its an 'OR', pressing either or both the switches makes the output of the OR gate '1', and therefore, because this is AND'd withthe flipflops output, whatever state the FF is in, sends the motor running. Now, because the motor runs in either direction, depending on the state of the flipflops output, if it isn't anded with something (like the output of our OR gate) then the motor will run continuously, and we can only change the direction if it.

Just wanted to get an explaination in first, circuit on its way. As I said, rough idea, not tested, and I made several mistakes :D

Blueteeth (buriedcode)
 
Hi,

Thanks so much for replying to this again as I'm really eager to get this sorted once and for all. I really appreciate your help on this and like I say if you can help me get it working I will cover you for your time.

Thanks again and if you could let me see a corrected diagram that would be great as I cannot sleep at the moment.


Thanks again
 
quick update, and a question:

You've said that you want the motor to stop once BOTH switches have been released, so...say if you press, S1, then S2 and hold them...the motor runs...do you want the motor to turn off if you release both switches? Or could you release either switch but still hold one and the motor should still run?

You've said both in different posts, and one is a LOT easier than the other. Either way, the only part that needs to be changed is the 'OR' gate. Be it, with another gate, or a circuit of gates (still working on an 'easy' way, that means you won't have to buy any more parts, just using the spare gates you've already got left over from your Quad, flipflop (4013?) and your AND gates.

Blueteeth
 
Hi there,

I need it to work so that the motor turns off when you release BOTH switches. So for instance, I press (and hold) S1 then S2 the motor turns on. Then turns off only once S1 AND S2 are released.


Hope this is the easy option you speak of :).
 
" Or could you release either switch but still hold one and the motor should still run?"

The answer to this is YES just to clarify. So I press S1 (and hold) THEN S2 (and hold) the motor operates in the clockwise direction. I can release S1 and the motor still runs, but as soon as S1 AND S2 are released the motor stops. Also, the opposite should be true (so that S2, then S1 cause the motor to turn in the anti-clockwise direction).


Thanks again and hope this clarifys the matter
 
heh, unfortunately that isn't the easy option.

If you needed the motor only to run when both switches are held..(either direction) then a simple AND gate would do it. Truth table:

A B Output
0 0 0
0 1 0
1 0 0
1 1 1

If A and B are Sw1 and Sw2 then as you can see the output (used to enable the motor) is always 0, except when BOTH Sw1/2 are pressed.

It seems you want the motor only to come 'on' (again, either direction depends on switch order) when BOTH switches are pressed...BUT....you want it to turn off when BOTH switches are released...so a simple AND gate would work for turning the motor ON....but as soon as you release either button, it iwll turn off. SO, I was thinking, you might have to buy yet another logic chip....but another solution is a little trick with D flipflops. What chips do you have? I need part numbers, because some have more 'functions' (access to parts of the gates) than others.

If your Flipflop IC has another FF spare, and it has 'set' and 'reset' pins, we can use this to turn on/off the motor :D Its 'set' when both switches are on (ANDed) and 'reset' when both switches are off.

I'll agree this is a VERY difficult promleb for pure logic, I would ahve gone down the microcontroller/CPLD route a long time ago, but it can be done.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top