1 second pulse to keyboard

Thread Starter

trickyrick

Joined Sep 18, 2013
58
Right now I have several pairs of mico relays connected to the PCB of a computer keyboard. So when I turn one pair of relays on one relay pulses one for 1 second (use that to simulate letter A) the other relay stays on until the power is removed
I have 15 pairs of relays, Is there any way to use a 555 timer to do the same thing
Thanks
Rick
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,840
hi Rick,
Do you have a sketch you could post.?
How is the first relay in a 'pair' activated.?
The timing of 1sec On, for the 1st relay could be done easily using logic IC's.
I assume the 1sec On does not have to be precise.
What type of relay contact arrangement, Single, Double pole etc ...

E
 

Thread Starter

trickyrick

Joined Sep 18, 2013
58
I have taken the PCB out of a USB keyboard. There are several pads along the edge of the board that make contact with the membrane under the keys. If I short out 2 of these I get various letters depending on what 2 pads I short. In the circuit, I attached that's where the 2 leads go. I would like to replace the two relays with something else.

Relays.jpg
 

crutschow

Joined Mar 14, 2008
34,407
Sorry, but I don't understand your diagram.
  • I assume the magnetic switch is connected to +12V(?).
  • What operates the magnetic switch?
  • Why two relays?
  • Why does one pulse and the other need to stay on?
  • What provides the 1 second pulse?
 

Thread Starter

trickyrick

Joined Sep 18, 2013
58
Sorry. Magnetic switches are mounted in my windows and yes connected to 12v. When the magnetic switch is closed both relays are energized but the left relay will shut off the relay on the right, as this will happen too fast I've added a capacitor so the relay on the right will stay on for about 1 sec and simulate a keypress.
Switch on
Relay (left) turns on and stays on
Relay (right) turns on for one second
As long as the switch is closed (window open) relay (right) will only pulse once. I don't want to keep simulating a keypress over and over while the window is open (switch closed). So thats y the 2 relays
Hope this helps
 

Tonyr1084

Joined Sep 24, 2015
7,894
What's confusing me is the power to both relays appear to be connected to 12V ground.
1612453895186.png
Give me some time and I'll redraw your circuit exactly as you have it.
 

Tonyr1084

Joined Sep 24, 2015
7,894
Unless I got something wrong - this is what you're showing us: Note - the cap is reversed polarity according to your drawing. I have not attempted to correct anything, I only present it in a format that may be easier to decipher.
1612456189622.png
 

Tonyr1084

Joined Sep 24, 2015
7,894
To use your circuit - I'd make the following changes: Move C1 between K2 and ground and add R1 to drain C1 when K2 is off.
When the reed switch momentarily closes (long enough to charge C1 and activate K2) K2 will energize K1. K1 will remain energized on its own and K2 will shut down. This way you will get your keyboard closure.
1612456837648.png
I've tinkered with a 12V relay ( an HLF 14F3L DC 12V - C ) and a cap ( 220µF ) much as shown in K2 / C1 configuration. I get about a 20mS closure then it opens. This would be long enough to close K1 AND give you the keyboard pulse you want. Only one problem I see with your design ( unless this is intentional ) K1 will remain closed as long as the reed switch is closed. Once the switch opens up the whole thing will reset and be ready to go again. So I'm assuming you're using the reed switch ( magnetic switch as you have stated ) to hold K1 closed while the reed switch is closed. If that's the case you can do away with K1 and just use the reed switch to power K2 / C1 while the window is closed. K2 will still close momentarily. But you will need to drain the capacitor charge when the window opens.
 

Tonyr1084

Joined Sep 24, 2015
7,894
Here's how I would approach this: When the window closes the reed switch closes, C1 will charge. During that time K1 will close for approximately 20mS. Long enough to simulate a brief keyboard switch closure. When you open the window the current (1.2mA) will stop flowing and C1 will discharge. Next time you close the window you will again get a brief keyboard switch closure.
1612458212946.png
Are you attempting to sneak out the window without your parents knowing? That's what this would serve; sneaking out. Or maybe you're sharing an apartment with an alarm, and you don't have the code so you want to simulate a key stroke to set the alarm AFTER you've closed the window.
 

Thread Starter

trickyrick

Joined Sep 18, 2013
58
Thanks, that's a lot better drawing that I made. Couple of things the keyboard uses NO contact and yes you were right I have the Cap reversed.. I didn't mention but I have K1's NO contact to light an LED on a panel so I know that window is open. One other thing the magnetic switch is closed when the window is open.
I suppose this is the easiest way to do this rather than to use say 555 timers and transistors.
 

Thread Starter

trickyrick

Joined Sep 18, 2013
58
The reason for this: I have every window and door in the home wired back to a computer in the basement. That computer is wired to several speakers around the house. When a window is opened and simulates say a "D" then I have a program running that will play a Wav file saying the front door is open or the kitchen window is open. Also, I have a panel centrally located with the outline of the house on frosted glass that is backlit and I have a red led behind where every window and door is so I can look at it say when I go to bed and tell what windows or doors are open
 

Tonyr1084

Joined Sep 24, 2015
7,894
OK, well, as far as the indicator light goes - use a DPDT relay where I showed a SPDT relay. The second set can power an LED. As for the reed switch (magnetic switch) being closed when the window is open - that seems to strike me as counter-intuitive. Every SPST reed switch I've seen closes in the presence of a magnet and opens when the magnet is moved away. Of course I know there are SPDT reed switches that can both OPEN and CLOSE in the presence of a magnet, so who's to say that's not what you have. But then that would seem to be in opposition to the drawing you first posted. I COULD be wrong.
 

Tonyr1084

Joined Sep 24, 2015
7,894
If all you're doing is running lights then simple electronics can solve the problem nicely. When the window is closed (switch open) a buffer-inverter such as a CD4049 which has six inverters on it can turn lights on and off. And with a similar RC circuit you can derive a pulse to act like a keyboard stroke to play the sound.

Sounds like you've done a lot of computer work to build your own home security system. Cool.
 

Thread Starter

trickyrick

Joined Sep 18, 2013
58
How would I power the panel light for as long as the reed switch is closed using DPDT when the relay K1 is only on for a second. Yes my reed switches have both NO and NC
 

Thread Starter

trickyrick

Joined Sep 18, 2013
58
I used your circuit for the one relay, works good. I had to use a 1500 resistor for my micro relays and for the panel lights I just wired it to one side of the reed switch and ground. Cool, thanks alot. Instead of 34 relays I only need 17
 
Last edited:
Before i spend any time on this thread, I urge the TS to look at the products made by: https://www.hagstromelectronics.com/

And:

I've used OPTO- FETS and Optomos relays (some need 1 ma) to do button interfacing. I

The first thing you need to do is find the minimum R that can be used and add a safety margin.

Loose the mechanical relays.

A data selector is a quick and dirty way to generate 9 characters. You have a relay matrix, let say you didn't, you interfaced across 9 keys.

You use the addresses of the data selector and set the output 000=1 line, 010 =4th line

If you need one line in multiple lines out, use a priority encoder.

These are brief ideas which you can explore.
 

AnalogKid

Joined Aug 1, 2013
11,036
How would I power the panel light for as long as the reed switch is closed using DPDT when the relay K1 is only on for a second. Yes my reed switches have both NO and NC
By putting the panel LED from the output of the reed switch to GND. This way the LED will be on as long as the switch is closed, way after the timer circuit to the coil has timed out.

16 posts, still missing critical information about the keyboard. The safest way to interface to it is with an isolated set ("dry") of relay contacts. But it also is the most wiring, and expensive. What do you know about the keyboard switch contacts? Are they scanned, multiplexed, common-grounded, x-y matrixed - ? Depending on the answer, you might be able to get away with two ULN2803's for up to sixteen switches.

OR, for smaller timing capacitors, one 2N7000 small MOSFET per circuit.

OR, if you are stuck with needing floating contacts, change to quad opto-couplers, with each one driven by a 2N7000, or a ULN2803 section as above. Lower cost, better reliability

geezer mode: on

Also, what operating system? Back in the day, you could do this through a printer port with way less hassle, but that required direct hardware access through a compiled program. Programming is not my long suit, but I hear that the later Windows versions do not allow this. Or maybe just the latest C compilers. Whatever, back in the day this would be a spare printer port card and 30 lines of BASIC.

geezer mode: off

ak
 
Top