Kineda, last time I pointed something like this out, they got their panties in a twist, so I want you to know this isn’t a personal attack. You saw a problem and found a way to overcome it that works. Awesome. I just think it’s a bad way, and far inferior to other options. I’ve recommended the use of analog switch IC’s many times; and would happy to be shown a better way, but I don’t believe this is it.
Relays are electromechanical. The power turns on an electromagnet that causes a metal reed to touch its other contact; physical movement. Over time, performance degrades, both from metal fatigue from the rapid movement, and also the magnetization of the reed. Analog IC’s are solid state, and barring nuclear war, will last far longer. Sadly, this is the only point I dont have numbers to back up.
Speed:
I can’t find a datasheet for that relay, but if we assume that the reed travels 1mm, and the reed moves as fast as possible (speed of sound), then time from the magnet turns on until it moves the 1mm to make contact with the other piece of metal is at best 2.9 microseconds. Analog switch IC delays max out at around 120ns, 4% of the time the relay takes with those numbers;average is 2-3%.
Power:
The setup you have has power going to the relay, and when a direction is pressed, it grounds it so power flows through the electromagnet. I can’t find a datasheet on that relay, so the only number I have to go on is the 250Ohm written on the relay itself. If that’s the resistance, then having a single direction pressed is causing (5v / 250 Ohm) = 20mA of sunk power, 40mA if you hit a diagonal. Supply current for an analog switch chip is 1uA (1/40000th of relays in a diagonal).
Cost:
Radio Shack sells those relays for $3 each, for a total of $12 to wire your four directions. The MAX4611 chip can be sampled for free from maxim-ic.com, or ordered for around $1.50 each from numerous places. One chip does all four directions. If you dont want to go with the MAX4611 and would rather use more standard chips, a single 74HC04 inverter and a single 74hc4066n analog switch IC is needed, and cost 50 cents each from Digikey. Cost for an analog switch $1-$1.50, 1/8th to 1/12th the cost of relays.
Size:
A single 14pin IC is smaller than one single relay, much less four.
I’ve sold a number of little boards made to do exactly this. Get a hold of me if you’re looking to have one made, or check my posts in the padhacking thread for info on how to make your own.
If it works ‘good enough’ for you, fine. Enjoy. But especially with the heavy current draw of those relays, I have to recommend analog switch IC’s to anyone thinking of a project like this.