Maker Pro
Maker Pro

Delayed Circuit connection

one_eye_pete

Jan 13, 2015
5
Joined
Jan 13, 2015
Messages
5
I would like to wire a switch with 2 circuits. I would like 1 circuit to connect immediately and the second circuit a fraction of a second later. Do I use a capacitor for this?

The circuit is within a computer keyboard I have dissected. I say this so you have a clue on voltage involved. Is this even the right place to ask this??

My intent is to press say CTRL then a letter key with a minimal delay with just one press of a button. I hope this makes sense.

https://www.dropbox.com/s/dwt92azq5pujipz/2013-01-15 23.09.13.jpg?dl=0
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
I would like to wire a switch with 2 circuits. I would like 1 circuit to connect immediately and the second circuit a fraction of a second later. Do I use a capacitor for this?

The circuit is within a computer keyboard I have dissected. I say this so you have a clue on voltage involved. Is this even the right place to ask this??

My intent is to press say CTRL then a letter key with a minimal delay with just one press of a button. I hope this makes sense.

https://www.dropbox.com/s/dwt92azq5pujipz/2013-01-15 23.09.13.jpg?dl=0
Makes sense, however, most keyboard scan across the keys to see what is depressed... so using a capacitor on across the key may result in nothing reading at all.
To be honest, you could probably just do away with the capacitor idea all together... You can press the letter key a fraction of a second before the CTRL key, and due to the scanning nature of the keyboard, it should still be able to detect it as a key combo.
Have you tried this yet? Is there a reason you want to do this with hardware and not software?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That's good advice there from Gryd3.

This circuit may do what you want. It uses a 74HC4066 or CD4066 quad bilateral switch IC to make the connections across the required keys.

272229.001.GIF

Keyboard keys are scanned by the microcontroller in a grid pattern. The alternative would be for the microcontroller to have a separate input pin for each key, which would be impractical. So each key must be an electrically isolated "dry contact". These can be mimicked using relay contacts, but if both sides of the switch are known to always be between the positive and negative supply rails, a bilateral switch device can be used, with no moving parts.

The circuit is powered from the +5V and 0V rails of the keyboard. If the keyboard operates at a lower voltage such as 3.3V the circuit should still work but the bilateral switch IC works best at 5V.

The 74HC4066 (preferred) or CD4066 quad bilateral switch IC contains four bilateral analogue switch circuits. These are shown by the graphics inside the IC rectangle. Each switch has a control input, and two "contact" points. When the control input is logic high, the switch conducts (more or less) betwen its contacts; when the control input is logic low, the switch does not conduct.

The pushbutton and R1 produce a voltage at R2 that is high when the button is pressed, and low when it is released, but it has noise during transitions, especially the transition from OFF to ON. This noise is called "bounce" and it is caused by the mechanical nature of the pushbutton. C1 smooths out this bounce by slowing down the signal so it cannot change quickly.

R3, R4, R5 and one switch in U1 (on pins 3, 4 and 5) form a circuit called a Schmitt trigger. This circuit cleans up the slowly changing voltage across C1 and provides a clean, sharp transition at U1 pin 4. Search for Schmitt trigger on Electronics Point or Google to learn about how they work.

The cleaned-up pushbutton signal on U1 pin 4 is connected directly to U1 pin 6, where it controls the switch that you will connect across the modifier key - that is CTRL in your case. That switch therefore closes first and opens first. It is also fed through a brief delay (about 10 ms) implemented by R6 and C2, and to U1 pin 12, where it controls the switch that you will connect across the letter key. This switch therefore closes after the modifier key has closed, and opens after the modifier key has opened.

Pins 8~11 of U1 can be connected directly across the pushbutton or membrane contacts of the keyboard and should not disturb its normal operation.

C3 is a decoupling capacitor for U1 and is required for reliable operation. It should be connected as directly as possible between pins 14 and 7 of the device.

C3 should be a ceramic capacitor. C1 and C2 can also be ceramic capacitors with X7R dielectric, so their values are reasonably stable, or film capacitors, for better timing accuracy.

The circuit can be built up on stripboard.
 

one_eye_pete

Jan 13, 2015
5
Joined
Jan 13, 2015
Messages
5
Makes sense, however, most keyboard scan across the keys to see what is depressed... so using a capacitor on across the key may result in nothing reading at all.
To be honest, you could probably just do away with the capacitor idea all together... You can press the letter key a fraction of a second before the CTRL key, and due to the scanning nature of the keyboard, it should still be able to detect it as a key combo.
Have you tried this yet? Is there a reason you want to do this with hardware and not software?

Thanks. I have tried wiring both circuits (ctrl & letter) to the same switch, thus activating at the identical time. This resulted in just the letter key being recognized, not the combo. My intent is to build a flight deck for flight simulating. There are so many functions I need combo keys. I have also wired separately 2 switches, 1 ctrl and the other a letter. This works with ctrl being pressed first. So the wiring does work, just not at the same time apparently.

Did you see the photo? Bridging a letter to a number makes the signal for what ever key.

Thanks.
 

one_eye_pete

Jan 13, 2015
5
Joined
Jan 13, 2015
Messages
5
That's good advice there from Gryd3.

This circuit may do what you want. It uses a 74HC4066 or CD4066 quad bilateral switch IC to make the connections across the required keys.

View attachment 18130

Keyboard keys are scanned by the microcontroller in a grid pattern. The alternative would be for the microcontroller to have a separate input pin for each key, which would be impractical. So each key must be an electrically isolated "dry contact". These can be mimicked using relay contacts, but if both sides of the switch are known to always be between the positive and negative supply rails, a bilateral switch device can be used, with no moving parts.

The circuit is powered from the +5V and 0V rails of the keyboard. If the keyboard operates at a lower voltage such as 3.3V the circuit should still work but the bilateral switch IC works best at 5V.

The 74HC4066 (preferred) or CD4066 quad bilateral switch IC contains four bilateral analogue switch circuits. These are shown by the graphics inside the IC rectangle. Each switch has a control input, and two "contact" points. When the control input is logic high, the switch conducts (more or less) betwen its contacts; when the control input is logic low, the switch does not conduct.

The pushbutton and R1 produce a voltage at R2 that is high when the button is pressed, and low when it is released, but it has noise during transitions, especially the transition from OFF to ON. This noise is called "bounce" and it is caused by the mechanical nature of the pushbutton. C1 smooths out this bounce by slowing down the signal so it cannot change quickly.

R3, R4, R5 and one switch in U1 (on pins 3, 4 and 5) form a circuit called a Schmitt trigger. This circuit cleans up the slowly changing voltage across C1 and provides a clean, sharp transition at U1 pin 4. Search for Schmitt trigger on Electronics Point or Google to learn about how they work.

The cleaned-up pushbutton signal on U1 pin 4 is connected directly to U1 pin 6, where it controls the switch that you will connect across the modifier key - that is CTRL in your case. That switch therefore closes first and opens first. It is also fed through a brief delay (about 10 ms) implemented by R6 and C2, and to U1 pin 12, where it controls the switch that you will connect across the letter key. This switch therefore closes after the modifier key has closed, and opens after the modifier key has opened.

Pins 8~11 of U1 can be connected directly across the pushbutton or membrane contacts of the keyboard and should not disturb its normal operation.

C3 is a decoupling capacitor for U1 and is required for reliable operation. It should be connected as directly as possible between pins 14 and 7 of the device.

C3 should be a ceramic capacitor. C1 and C2 can also be ceramic capacitors with X7R dielectric, so their values are reasonably stable, or film capacitors, for better timing accuracy.

The circuit can be built up on stripboard.
Kris, thank you for this immense reply. I will have to be honest, this looks far more complicated than my skill set. What is lower than complete novice? I am well impressed how you took the time to put this together for me.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
My intent is to build a flight deck for flight simulating. There are so many functions I need combo keys. I have also wired separately 2 switches, 1 ctrl and the other a letter. This works with ctrl being pressed first. So the wiring does work, just not at the same time apparently.
I think you can get gaming keyboards with extra keys that can be programmed to do what you want.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Thanks. I have tried wiring both circuits (ctrl & letter) to the same switch, thus activating at the identical time. This resulted in just the letter key being recognized, not the combo. My intent is to build a flight deck for flight simulating. There are so many functions I need combo keys. I have also wired separately 2 switches, 1 ctrl and the other a letter. This works with ctrl being pressed first. So the wiring does work, just not at the same time apparently.

Did you see the photo? Bridging a letter to a number makes the signal for what ever key.

Thanks.
Pete, as mentioned above, keys are usually scanned, row-by-row... so if you electrically tie both switches together, you could end up with funny result... That is the basis behind Kris's diagram. It has a component in it that will trigger two keys independently at the same time rather than tie them together.
keyboard_key_ghosting.png
This is one common approach to it...


I know flight sims have a ton of functions, but can you enlighten us on how many functions you actually need? Aside from gaming keyboards, there are also software solutions to map buttons to do other functions. If you really want to dive in, Arduino has a well written library to make your own keyboard device... meaning you can tell it to press Ctrl-A or any combo you want by pressing a home-made button.

*As far as a software solution is concerned. Your keyboard should have between 70-80 keys that you can remap. I do it all the time with a program called GlovePIE. So if you don't need any more than 70 keys in your flight deck, I can help you write a GlovePIE script that should do what you want.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Thanks Adam :) Did you like my Schmitt trigger made from a bilateral switch? It seems like there's always a new way to do things!

Yes Kris, you know me too well. I love novel ways of doing things. I do a similar thing with transistors to speed up switching sometimes.
Adam
 

one_eye_pete

Jan 13, 2015
5
Joined
Jan 13, 2015
Messages
5
I know flight sims have a ton of functions, but can you enlighten us on how many functions you actually need? Aside from gaming keyboards, there are also software solutions to map buttons to do other functions. If you really want to dive in, Arduino has a well written library to make your own keyboard device... meaning you can tell it to press Ctrl-A or any combo you want by pressing a home-made button.

Hi, below is a link to the possibilities of assignments. My intent is to build a model of the flight deck at around 80% of the original flight deck size. The link shows 167 possible assignments then you add in the CDU which has a further 68 buttons. These latter ones are accessed by holding Tab then the appropriate letter or numeric key. I have thought if all else fails I could simply place a switch at the CDU that when locked into place holds the tab button closed then assign each button the appropriate letter or number. A little hockey, but would work.

https://www.dropbox.com/s/zx2y1oqp1uyzr8o/PMGD Flight Deck 737-800 Button Assignments.pdf?dl=0

Cheers,
 

one_eye_pete

Jan 13, 2015
5
Joined
Jan 13, 2015
Messages
5
I think you can get gaming keyboards with extra keys that can be programmed to do what you want.
Thank you. I am intending on building a scaled model of the flight deck with momentary buttons taking care of the keyboard assignments.

Cheers
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Perfect! You've given me some really good info on how many buttons you actually need...
Now, for some more details.

The flight deck you provided appears to have multiple dials and knobs to allow for adjustments and settings. There also appears to be some analogue dials.

Are all of the assignments you stated simple digital buttons? The attachment you have shared shows digital and analogue dials, as well as various displays. Because of the number of inputs you could require, I would urge against using relays or other electronics to simply manipulate a regular keyboard.. at least not yet. Can you shed some light on the software you will be using, and the types of inputs you want your flight board will contain?

Please tell us the expected quantity of each:
-Momentary Push Button
-Toggle Switch/Button
-Analogue Dial
-Multiple Position Dial

If I can find documentation on the software, it could prove very helpful.

I have looked at the flight deck... but aviation is not something I have dove into... It's hard for me to tell which inputs you want to use, and which ones will simply be for show.

The quantity and type, as well as the software will dictate which route we should most likely take.
Making modifications to a single keyboard may prove to be very difficult to get certain input types to work, but will be more than capable of handling the momentary digital inputs. Please also keep in mind that this method may only be able to identify 3 or 4 keys pressed (or held) at the same time. So some complex input methods on the flight deck may not function correctly.
Using something like an Arduino, or other microcontroller would be a more robust and cleaner approach in my opinion... This would require a little more brain work to program, but could keep the build electrically more simple...
The last recommended solutions is software like GlovePI.

In any case, I have a test I MUST carry out at home, unless someone can give me details.
I need to test the following:
-If shift is held on Keyboard 1, and a letter is pressed on Keybaord 2, will the result be a capital letter?
-Can Windows distinguish input from different keyboards? (ie... can GlovePI listen for a keypress on Keyboard 2, and ignore the same keypress on Keyboard 1)
 
Top