News:

Two-Factor Authentication is now enabled. For instructions, visit the Engine Room.

Main Menu

'Electrical' problem; converting toggle to 'impulse'?

Started by Torvald_Faust, October 06, 2011, 03:25:34 PM

Previous topic - Next topic

Torvald_Faust

Before I get started, I will add that I am not quite sure if I am using the correct terminology. Apologies beforehand ;)

I (want to) build a wide variety of props, and my latest idea is building a tactile control panel that I will use to send signals to my computer or laptop, so the PC can, say, play a sound or play a video; the idea being that if I toggle the "hyperspace drive" on, a nice computer lady would be able to confirm my action ;)

The problem I have ran into is a problem of toggle versus 'impulse' switches. The switches I want to use are either on or off. The original idea I had, was to hack something together to convince my computer that, say, the 'a' key on my keyboard was pressed. Though that worked, my computer was convinced the 'a' key was continuously pressed - and no sound program I have tried to use was able to cope with that, leading to unwanted looping of sound.

Though I think there may be a software solution to this, I found myself wondering; would there be a hardware/'eletrical' solution to this problem? E.g. toggle a switch to 'On' and then some thingamajig prevents that the signal is send continuously?

Professor Bevel

A few solutions suggest themselves;

first, buy 'momentary' (usually 'MOM' in the catalogue) switches that do a brief make and then open again when released.  The fact that you're using latching switches is what's giving you the problem.

Second, and there's any amount of googleable circuit designs out there, something monostable that responds to the closing of each side of a SPDT switch (or is it DPST?  Can never remember which way round they go, I just count terminals and check it with a meter before installing) by sending a transient 'on' before dropping back to a monostable 'on' position.

Third, get and program an arduino to send suitable serial-line signals on detecting changes of state in a switch.  You can control several switches from one arduino, and have a wider array of responses than 'treat it as keypress insert-letter-here'

that's just off the cuff, there are probably more, and I haven't even thought about the software solutions because .
I hate coding with a passion.
You know what this situation calls for?  More gin.

Torvald_Faust

Ah! Momentary! Now I remember what I was forgetting :D I'm afraid they're not an option, atleast, not for the feel I want. When I toggle something on, I want it to stay on ;)

Option number two sounds intriguing, and that's mostly because I don't understand what you're saying ;) I'll see if Google-Fu will help.

As far as option number three goes, I'm aware of it. I feel it's a tad pricey, so I hope to avoid it.

Thanks for your help!

Professor Bevel

You know what this situation calls for?  More gin.

Birdnest

momentary, yes ...

perhaps a programmable relay?  alliedelec.com

computer modding sites have what's called a latching momentary switch (push-click-momentary on).  similar to a power switch on a pc.
Onward ho!

Torvald_Faust

Perhaps I should've added I've already got switches :) But I suppose given that's the case, I'll need a software solution ;)

xanthra


Professor Bevel

Yep, most monostable/astable switching circuits available in kit form use a 555 somewhere, although you can do them without.  With tuneable caps and resistors you can get some interestingly analogue effects.
You know what this situation calls for?  More gin.

Torvald_Faust

So, if I understand correctly, such a circuit, when triggered, gives output once, but once the timer reaches 'zero', it goes back to (virtually) no output?

von Corax

Quote from: Torvald_Faust on October 07, 2011, 07:25:45 AM
So, if I understand correctly, such a circuit, when triggered, gives output once, but once the timer reaches 'zero', it goes back to (virtually) no output?

Pretty much, yes. The magic word here is "monostable" ie. having one stable state, in which it will happily remain indefinitely if undisturbed; if forced (by an external input) into the other state, it will eventually return on its own to the stable state. The other alternatives are "bistable" (two stable states), which will remain in either state until external input forces it to switch to the other state (like your toggle switches) and "astable" (no stable states) which, lacking external input, will periodically switch itself between the two states, like a clock pendulum.
By the power of caffeine do I set my mind in motion
By the Beans of Life do my thoughts acquire speed
My hands acquire a shaking
The shaking becomes a warning
By the power of caffeine do I set my mind in motion
The Leverkusen Institute of Paleocybernetics is 5842 km from Reading

Torvald_Faust

#10
Continuing that train of thought...If I figure out how my toggle switches can trigger such a circuit - would it really result in a single output?

What I'm thinking is this; a toggle switch is continuous input (I think ;)) and this input goes into the proposed circuit. The circuit gives output once, until it goes back into it's stable state. But wouldn't it go into the other state immediately given that it is still getting input?

I suppose it's time I draw out a circuit, with components...Then find a electronics store and figure out it if it wouldn't be cheaper to go for a Arduino, still ;)

And I think that by now I'm proving I'm quite new to electrical engineering :P

Professor Bevel

Oh, I think you're proving that handily, dear boy.  We've all been there, and I don't doubt there's a few fond and misty moments of nostalgia behind posts in this thread, as we think back to the days when we, too, were that green.
You know what this situation calls for?  More gin.

Torvald_Faust

As green as I am and as much as I like 'roleplay', I do dare to raise my eyebrow at being called 'dear boy' ;) But I am sure you mean no insult :)

And that aside, I know the feeling you are talking about. For instance, I am quite proficient in Photshop - it was amusing to try and explain this and that to a acquaintance of mine.

Speaking of Photoshop, I will use it at my earliest convenience to try and map the circuit-to-be :)

Professor Bevel

Quote from: Torvald_Faust on October 07, 2011, 09:45:32 AM
I am sure you mean no insult :)

Indeed not - it's  a matter of perspective.  You just reach my age and see if anyone under 30 doesn't start looking like a kid to you, too.
You know what this situation calls for?  More gin.

Torvald_Faust

I do plan to reach such an age, so we will see what happens ;)

von Corax

Quote from: Torvald_Faust on October 07, 2011, 09:03:51 AM
Continuing that train of thought...If I figure out how my toggle switches can trigger such a circuit - would it really result in a single output?

What I'm thinking is this; a toggle switch is continuous input (I think ;)) and this input goes into the proposed circuit. The circuit gives output once, until it goes back into it's stable state. But wouldn't it go into the other state immediately given that it is still getting input?

No. The typical monostable multivibrator circuit is also called a "one-shot" in that it's triggered not by a "high" input but by a low-to-high (or high-to-low) transition — in short, when its input is triggered, it generates a single output pulse, and won't do so again until it is reset by the input being switched off.
By the power of caffeine do I set my mind in motion
By the Beans of Life do my thoughts acquire speed
My hands acquire a shaking
The shaking becomes a warning
By the power of caffeine do I set my mind in motion
The Leverkusen Institute of Paleocybernetics is 5842 km from Reading

Professor Bevel

Quote from: von Corax on October 08, 2011, 07:24:11 AM
Quote from: Torvald_Faust on October 07, 2011, 09:03:51 AM
Continuing that train of thought...If I figure out how my toggle switches can trigger such a circuit - would it really result in a single output?

What I'm thinking is this; a toggle switch is continuous input (I think ;)) and this input goes into the proposed circuit. The circuit gives output once, until it goes back into it's stable state. But wouldn't it go into the other state immediately given that it is still getting input?

No. The typical monostable multivibrator circuit is also called a "one-shot" in that it's triggered not by a "high" input but by a low-to-high (or high-to-low) transition — in short, when its input is triggered, it generates a single output pulse, and won't do so again until it is reset by the input being switched off.

You're not quite alongside the Edification of Youth yet, are you?  Don't tell 'em everything, they learn more if they have to look it up.
You know what this situation calls for?  More gin.

von Corax

Quote from: Professor Bevel on October 08, 2011, 11:11:21 AM
You're not quite alongside the Edification of Youth yet, are you?  Don't tell 'em everything, they learn more if they have to look it up.
I just figure he'll be more confident in his search if he knows what he's looking for, and that what he's looking for is actually there to be found.
By the power of caffeine do I set my mind in motion
By the Beans of Life do my thoughts acquire speed
My hands acquire a shaking
The shaking becomes a warning
By the power of caffeine do I set my mind in motion
The Leverkusen Institute of Paleocybernetics is 5842 km from Reading

Torvald_Faust

Thank you, Corax :)

By now, my expectations begin to shift from 'possible' to 'impossible'. I think I'm going to look into a software solution...

Professor Bevel

Quote from: Torvald_Faust on October 10, 2011, 12:51:28 PM
Thank you, Corax :)

By now, my expectations begin to shift from 'possible' to 'impossible'. I think I'm going to look into a software solution...

Amusingly, I'd be the other way about.  The more it looks like a software solution, the less I like it.  Although I have finally given in and accepted that my best method of getting code written is to kidnap a coder and motivate him with a scientifically-calibrated system of rewards and massive, massive electric shocks.
You know what this situation calls for?  More gin.

Torvald_Faust

Given that I do not have the time nor the knowledge to research an solution for the hardware side, I think you can forgive me to think 'software' :P

Captain Shipton Bellinger

Torvald,

Before you despair of a hardware solution, take a look at this page, especially the section toward the bottom on the NOR gate monostable. This should achieve your aim with (possibly) the smallest component count.

The CMOS 4001 or TTL 7402 integrated circuits each have four 2 input NOR gates, so you would be able to get two monostables from each IC.

If you need any help, drop me a line.

Capt. Shipton Bellinger R.A.M.E. (rtd)


mark V

What sort of toggle switches have you got (there are many flavours) it may be possible to open them up to make them passing contact  or to adjust them to spring load them to off (which would give a similar effect in use)   M 
general hammer abuser former lawnmower fireman

xanthra

Quote from: Torvald_Faust on October 10, 2011, 01:15:18 PM
Given that I do not have the time nor the knowledge to research an solution for the hardware side, I think you can forgive me to think 'software' :P

So now I must ask...  How are you planning to avoid "hardware" when you still need to interface those switches to your computer somehow?  It can't be actually be "pure" software solution : )

Torvald_Faust

Quote from: Captain Shipton Bellinger on October 10, 2011, 05:00:51 PMTorvald,

Before you despair of a hardware solution, take a look at this page, especially the section toward the bottom on the NOR gate monostable. This should achieve your aim with (possibly) the smallest component count.

The CMOS 4001 or TTL 7402 integrated circuits each have four 2 input NOR gates, so you would be able to get two monostables from each IC.

If you need any help, drop me a line.
I will probably drop you a line sooner or later, then. I hope to reduce my 'worries' to a component list and a scheme what to solder to what ;)

Quote from: mark V on October 14, 2011, 05:17:14 PMWhat sort of toggle switches have you got (there are many flavours) it may be possible to open them up to make them passing contact  or to adjust them to spring load them to off (which would give a similar effect in use)   M
That's not a bad idea, actually...Tweaking the switches themselves sounds like fun!

Quote from: xanthra on October 14, 2011, 10:54:02 PMSo now I must ask...  How are you planning to avoid "hardware" when you still need to interface those switches to your computer somehow?  It can't be actually be "pure" software solution : )
Obviously I do need hardware, but the problem I see can probably be solved either within the hardware or the software. I have actually made bits and pieces of software, so I have more experience with it :)