Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Programmatically pressing buttons with 4n25/MAX395, multiplex or suggested setup

StealthRT

Member
Hey all I am in need of some advice on how to go about doing the following:

I have some 30 buttons I need to press programmatically. I know I can do this using a 4n25 but that would take up a lot of space on the PCB if I used that many!

I also ran across the MAX395 that has 8 switches within it instead of just one like the 4n25 has. This would cut down the size of the PCB. but would also be a challenge since I am unable to find any schematic & code using either an Arduino or ESP32 for this IC.

But I am unsure if that would be the best way to go about it? The type of switches I am trying to control via an arduino or ESP32 would be something like this:
Image-1.jpeg


Image.jpeg


I also found this animation that demonstrates something that looks like it would work as well for my project (multiplexing I believe this is?) But of course this is getting input instead of output like I would need:
switchessmaller2.gif


I am looking to just push one button at a time. Pushing meaning the Arduino will push the button for me. So suggestions would be great!

Image-3.jpeg


Image-2.jpeg


Image-1 (1).jpeg


Image (1).jpeg

As you can see, there is epoxy on the back that covers the chips and traces. I'm sure any attempt at lifting this epoxy will cause traces/resistors/chips to be lifted.

This is how my dash looks now:
dash2.png


And this is what it will look like when i add my tablet:
dash.png
 
Last edited:
It looks dead simple to drive, just chip select, clock, and data - an SPI type of interface or 74hc595 (loads of Arduino examples), and you can easily connect multiple ones in series to give your required 30 (32) switches.

The main issue 'may' be that the switches aren't isolated, and this could cause problems.

I suggest getting one to try, sort out driving that one, then try connecting it and see if it works the keys OK.

First choice would be 30 small relays, which are guaranteed to work, as they perfectly replicate the switches, next would be opto-isolators, not so good as they aren't bidirectional. CMOS switches are probably a third (and less likely to work) option.
 
As there are 10 wires going to the keypad and it seems to be arranged as 4 columns and 6 rows one axis will be driven by outputs from the microcontroller and the other axis will be connected to inputs on the microcontroller. So for example the 4 columns may be driven high (or low) in sequence. When a button is pressed in that column the microcontroller will see an high (Or low) on the input that is connected to that row. The microcontroller sees that bit go high so it know which row it is and as it is driving the signal to the columns it knows which column is active. So it knows which button was pressed.
Your microcontroller would need an input connected to the column drive signals to know which column was active in the scanning sequence and if the button that it wanted to simulate being pressed was in that column it would drive an output bit for that row . Your first step would be to identify which axis was being driven. NOTE the electrical layout of the matrix may not be the same as the physical layout.

Les.
 
As there are 10 wires going to the keypad and it seems to be arranged as 4 columns and 6 rows one axis will be driven by outputs from the microcontroller and the other axis will be connected to inputs on the microcontroller. So for example the 4 columns may be driven high (or low) in sequence. When a button is pressed in that column the microcontroller will see an high (Or low) on the input that is connected to that row. The microcontroller sees that bit go high so it know which row it is and as it is driving the signal to the columns it knows which column is active. So it knows which button was pressed.
Your microcontroller would need an input connected to the column drive signals to know which column was active in the scanning sequence and if the button that it wanted to simulate being pressed was in that column it would drive an output bit for that row . Your first step would be to identify which axis was being driven. NOTE the electrical layout of the matrix may not be the same as the physical layout.

Les.

You're over complicating it Les, there's no need to detect which column is active, he just wants to press a button - so needs 'something' for each switch, no need to know which column is active.
 
To simulate each button he could use a CD4051 (Single 8-channel analog multiplexer/demultiplexer.) to provide a path from the selected row to it's common output. that output would go to the common of another
4 channel analog multiplexer/demultiplexer. (A CD4052 or a CD4051). The 4 inputs on that would each connect to a column. When the column and row addresses were set on the two multiplexors it would provide a path between a row and a column simulating a button press. I think that would be simpler than having an opto isolator for each button. This would require 5 control bits. You could use this idea with two MAX395s.

Les.
 
Last edited:
A single chip for generating a single pulse to 1 of 32 pins, to actuate a
solenoid. Note power driver has to be used between this chip and the
solenoid.

1739902817203.png


The control reg is written under prgm control and a bit set in the reg will deliver one pulse,
your design pulse width, to the solenoid power driver. Above I show 100 mS pulse, could have
been 100 year if you so desired. Also there are also other micro miniature types of
actuators available you can consider.

Note this part also capable of simultaneously keying a group of keys, in fact triggered by a dma
process and triggers based on T and V and whatever....
 
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top