I'm looking at controlling an external device with arduino. I need to be able to make connections outlined in the diagram below. I was thinking about using optocouplers but I would require too many and also I need to be able to make different connections on the same pin.
for example I need to be able to make these connections:
Pin 1 + 2
Pin 1 + 3
Pin 1 + 4
etc etc.
I never need to make more than one connection at the same time.
The hacked device has it's own power so I only need to trigger a switch. Does anyone have an idea what might be the best thing to use?
I looked at this:
but I'm not sharing the ground with the device? Any help much appreciated. Can you get multichannel relays/optocouplers?
Your switches are arranged in a matrix of rows and coloumns.
-first you figure out the row / coll s
-then you can use 2 4051 multiplexor IC's one to select the row the other to select the col. The outputs of the two 4051's are connected together. So when you selct a row and a coloumn they a basically shorted together = presseing the corresponding switch.
This way you can control a switch matrix up to 8 x 8.
EDIT: Just remember that this solution only works for simulating one key pressed at a time. Because each 4051 can only selct one input at a time.
Sounds like a good idea. I checked the voltage on the buttons and I couldn't register any So i think it will work. Will give it a go. Can you daisy chain the IC? if I need to go above 8x8?
When you say four individual switches? does that mean 4 x 8 ?
It means individual switches. You can use as many of these ICs as you like. Like you showed as buttons on your original diagram. It allows you to control each button with a separate aruino output.
Without an oscilloscope you have little chance of seeing what your hacked unit is actually doing and how it is responding to your forced signals.
Without an oscilloscope you have little chance of seeing what your hacked unit is actually doing and how it is responding to your forced signals.
The input buttons I'm trying to simulate are actually buttons on an old electronic typewriter, there's nothing else connected to it so I think it should work Will get some 4051's and give it a go.
I've got my 4051 chips in the post so going to give it a go. I've sketched up a schematic, do you think this will work even though each circuit is completely separate. i.e. I only want to simulate making a connection with a wire as in my original diagram?
cool, will give it a go and let you know how I get on. I haven't made my own PCB yet (well a proper one, not using peg board) and was going to maybe use this as my first. I might take you up on your offer it fails though
Also one thing, because I'm trying to trigger a separate device, should I join up both 4051's with PIN 3 instead of making one go to V and the other to GND? Thus maing it's own closed circuit?
I've found a similar method (inlcuding a diagram) in this german site where they use two 4051 to simulate a mobile phone keyboard: Wilke Technology - 404
I made some progress but am still not sure about my circuit. I'm struggling, I've created a 8x8 matrix but how would I trigger 0 and 0 of each chip? In the spec sheet I would have to pull the buttons down all the 6 PINS down to LOW but this would mean that they would trigger constantly?. I can successfully trigger other combination's. (tested with a multimeter)
Is my wiring wrong? I can't seem to get it to work for triggering channel 0 on both chips.
Basically I'm just trying to simulate a key press on a typewriter. I just can't seem to get this last bit working
If I were doing this, I would make a haunted typewriter. If only they were commonly used today. You could have it print at random times "they are coming" or something like that.
This was the final circuit I used to get it all to work
This circuit can control a 8x8 matrix of buttons. You have to write PIN 9 to HIGH continuously then write it LOW when you write to PINS 2,3,4,5,6,7. You then take PIN 9 HIGH again after. Hope it helps anyone wanting to control a load of buttons like an old keyboard