1
\$\begingroup\$

I'm looking for a little help with regards to the logic required for a project I'm looking at undertaking soon.

I am looking at creating a 'quickshifter' for my motorbike. The way this will work is by breaking the ignition circuit(signified as M1 motor) momentarily using a 'normally closed' relay(RY1).

The problem I am facing is that the circuit will stay broken for as long as the switch (s1) is pressed. I am looking for a solution that will only leave RY1 open for a specific amount of time, in the 50-100ms range.

I would like the circuit to be broken for a maximum of 50-100ms; this is regardless of how long the button is held down. So for example. If I press and hold the button/switch, the relay will be trigged within the first 50-100ms, but not again until the switch/button is de-pressed and re-pressed.

What logic could be used in order to achieve this? Apologies for my incredibly crude diagram.

extremely basic diagram

EDIT - I have tried to create a monostable 555 circuit as suggested, but I think I am missing something.

docircuits test example

When I view data recorded when I run the circuit, I see some erratic current readings at Imeter1; and VMeter1 shows the voltage droping from 12v to 0v when the switch is activated.. nothing gets recorded across any other the other meter(IMeter0). Can anyone tell me what I've missed? Am I being an idiot?

\$\endgroup\$
  • 1
    \$\begingroup\$ Use monostable circuit like 555 \$\endgroup\$ – R Djorane Dec 4 '14 at 14:07
  • \$\begingroup\$ see the link: instructables.com/id/555-Timer/step3/… \$\endgroup\$ – R Djorane Dec 4 '14 at 14:14
  • \$\begingroup\$ @Jack: 1. The lamp doesn't need to be grounded, but the wire connecting C1, C0, Relay0 coil-, and Relay0 armature do. Also, SW0 NO needs to be grounded, 555 pin 3 needs to be connected to the switch as shown on my schematic, and SW0 needs to be debounced when it's opened. Finally, you can get rid of C0, but you need 0.1µF dirctly across 555 pins 1 and 8. \$\endgroup\$ – EM Fields Dec 5 '14 at 13:32
2
\$\begingroup\$

This is a simple task for a small microcontroller. Even the tiny PIC 10F200 can do this easily.

The switch pulls a input line to ground. When the micro sees this, it energizes the relay for 100 ms or whatever you decide is the right time. It then goes into a loop waiting for the input line to be high continuously for 100 ms (to debounce the switch and ignore short glitches and prevent rapid back to back firing of the relay), then looks for a new high to low transition of the input line again.

\$\endgroup\$
  • \$\begingroup\$ it seems a little complicated for what he's looking for, i think if he use a monostable circuit with his push button SW1 it's will be OK with the appropriate values. \$\endgroup\$ – R Djorane Dec 4 '14 at 14:49
  • 1
    \$\begingroup\$ @codo: "Complicated" is not a single scalar quantity. Your circuit will be more complicated, but with a micro you have to write code. It depends on the relative importance of different criteria, which the OP hasn't supplied. \$\endgroup\$ – Olin Lathrop Dec 4 '14 at 15:03
  • \$\begingroup\$ Hey - thanks for your suggestion. I thought I'd better add some more criteria so that you're able to tell me if your suggestion would be suitable. I would like the circuit to be broken for a maximum of 50-100ms; this is regardless of how long the button is held down. So for example. If I press and hold the button/switch, the relay will be trigged within the first 50-100ms, but not again until the switch/button is de-pressed and re-pressed. Does that make sense? \$\endgroup\$ – Jack Dec 4 '14 at 15:13
  • \$\begingroup\$ @Olin Lathrop: Yes you're right, but for first time we choose the simple solution. \$\endgroup\$ – R Djorane Dec 4 '14 at 15:17
  • 1
    \$\begingroup\$ @EMFi: As has already been said, each approach can be judged more or less complex, depending on the relative weights of criteria we don't know. For example, if the OP is already familiar with PIC 10Fs and has the development system all set up, then this is a simple task. If not but he would like to learn such things, then this becomes a advantage over using outdated methods. Again, trying to argue "complexity" in this context is just hot air since we don't know the relative importance of various criteria. He asked, I said how I'd do it. It's up to him to judge which approach he prefers. \$\endgroup\$ – Olin Lathrop Dec 4 '14 at 18:42
2
\$\begingroup\$

This'll work for you: enter image description here

and if anyone wants to play with the circuit, the LTspice simulation is here.

There's a 1 second delay built into the sim, just because, but in the circuit above, as soon as S1 is pressed, K1 will go hot and stay hot for 1.1RtCT, no matter how long S1 stays made. Then, when S1 is released and pressed again, U1 will make another single pulse.

Just as an aside, Ct is 0.47µF, so for U1 OUT ~ 100 milliseconds, Rt needs to be 200k ohms, which is about halfway around R4, a rheostat-wired 500k pot.

\$\endgroup\$
  • \$\begingroup\$ Wonderful, I was hoping someone would post a 555 thing! \$\endgroup\$ – George Herold Dec 4 '14 at 18:52
  • \$\begingroup\$ As far as switch de-bouncing, the traditional method is with a SR flip-flop. Another IC... you can get away with an artfully chosen RC thing too. (RC time longer than the bounce time, but not too long.. well unless there is some hysteresis on the input.) \$\endgroup\$ – George Herold Dec 5 '14 at 13:58
  • \$\begingroup\$ Tell and show? The sim is out there, just waiting... \$\endgroup\$ – EM Fields Dec 5 '14 at 14:24
  • \$\begingroup\$ Here are some images, electrosome.com/switch-debouncing (Will you forgive me if I'm too lazy to plug those into your simulation?) \$\endgroup\$ – George Herold Dec 5 '14 at 14:54
  • 1
    \$\begingroup\$ There's nothing to forgive; I have no expectations of you, one way or the other. \$\endgroup\$ – EM Fields Dec 5 '14 at 19:35
0
\$\begingroup\$

Well I assume you are powering everything from 12V. So it would be nice to have an IC that works up there. As other's said in the comments this looks like a perfect job for a one-shot/ monostable. Perhaps a 555, but I was going to suggest something from the CMOS 4000B series. Perhaps the CD4047. And though this will most likely send Olin spinning, I'd get sometihng in a dip package. Easier to solder to and prototype. (Here are my hit's from Digikey.) Oh, you will most likely need a little more current than the IC can provide to operate the relay. So a transistor current gain circuit may be needed.

\$\endgroup\$
  • \$\begingroup\$ Hey @George - please see my comment on Olin's answer - do you think your solution could account for this? \$\endgroup\$ – Jack Dec 4 '14 at 15:28
  • \$\begingroup\$ Hi Jack, It's been a long time since I last used a one shot. (circa '95) Want you want is possible. I'm not sure the 4047 will do it.. I'd (You'd) have to read the spec sheet. What might be a bigger issue is debouncing your switch. When you turn your switch off there may also be some pulses generated.. that would be bad. Perhaps someone will post a 555 circuit that will work and that will be better for you. \$\endgroup\$ – George Herold Dec 4 '14 at 15:46
  • \$\begingroup\$ @GeorgeHerold: The bipolar 555 is specified to work with a Vcc of from about 3V to 18V, so that's not a problem. The 4047 can only source or sink about 2.5 mA with a 15V supply, so that's a big problem if it's trying to drive a relay. That problem is solved by using a 555, which can source/sink about 200 mA. Also, debouncing isn't a problem with either chip since its output will go high and stay high for the entirety of the bounce period. If the bounce lasts for less than the output period, that is. \$\endgroup\$ – EM Fields Dec 4 '14 at 16:44
  • \$\begingroup\$ @GeorgeHerold: A problem I hadn't anticipated, but which I think you noted, is that if the switch is held closed for longer than the one-shot's timeout and then released, the bounce on release could cause the one-shot to trigger. As you said, that would be bad. \$\endgroup\$ – EM Fields Dec 4 '14 at 23:44
  • \$\begingroup\$ @EMFields, yeah and the automotive enviornment. I'm thinking decoupling of the power supply will be important, but I've never done automotive design. \$\endgroup\$ – George Herold Dec 4 '14 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.