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.

Connecting 6 push buttons with ESP32 with 1 common pin

Status
Not open for further replies.

StealthRT

Member
Hey all I have 6 buttons that have the following voltage:

enter image description here

I want to hook up a 4N25 to each one of these so I can use the ESP32 as a "virtual push" to each of these buttons. When the button is pressed the 3.2vdc goes to ground.

enter image description here

To minimize the amount of wire going to each one I have come up with the following:

enter image description here

Is it possible to just hook 1 of the buttons left/bottom pins to all of the 4N25 chips so that I dont have to run 2 wires per button? Or is there a better way of doing this that will minimize the amount of wires?
 
Presumably, as it's such crazy 'circuit', the buttons are already in installed in another circuit?.

So no, you can't connect the other sides of the switches together.

Even wiring them independently doesn't look very plausible, assuming those voltages are correct? - are the switches actually multiplexed?.
 
All buttons on 1 pin, using A/D to determine which button pressed :

1682960091001.png



Regards, Dana.
 
No, this won't work. The switches are connected to a TM1650 and read as a scanned array.

Neither the original proposal nor Dana's will work.
 
No, this won't work. The switches are connected to a TM1650 and read as a scanned array.

Neither the original proposal nor Dana's will work.

To be fair, Dana's solution was exactly the same as my original thought - the question wasn't very clearly written.

From his voltage measurements I concluded he was actually referring to a scanned keypad, but now he's mentioned the TM1650 it makes it even worse - as that multiplexes some of the inputs and outputs on the same pins.

Easy option - use six small reed relays - this avoids all problems, such as potential reverse polarity across the switches.
 
I might be wrong, but the TM1650 scans a matrix keyboard in the progress of running a multiplexed LED display. The keys are arranged in a row by column format and at very high speed, the column is energized and each row is checked (or maybe vice versa) for a signal. This is happening at a 40 mSec rate.

If all of the switches are connected in the same row or column, one side the them will be common, but they will be common with one segment of all of the LEDs or in common with all of the segments of one digit. You can't tie the common pin to ground or to +5 volts without screwing up the LED display.

The opto-isolater idea might work, but you'd get a pulse string out of the non-pressed buttons (low, high, low, high.....) and a low signal out of a pressed button. It would take some fancy coding to test if a button stays low longer than the pulse interval, and all the switch inputs will need continous testing to separate the signals.

SmartSelect_20230501_161556_Dropbox.jpg
 
What you'd see from the opto-isolators is something like this.


TM1650 timing pic.jpg
 
I read it as the esp needs to be able to mimic a button being pressed.

Mike.

Perhaps you're right. Which would be more practical to accomplish.
 
So you want to trigger the button with the ESP output?
 
I think Nigel Goodwin is right. He seemed to understand the question from the start where I did not. I think relays are the only possible way to do it, since both sides of the switch must be isolated from power and ground.
 
I think Nigel Goodwin is right. He seemed to understand the question from the start where I did not. I think relays are the only possible way to do it, since both sides of the switch must be isolated from power and ground.

Like many of these threads, the OP gives far too little information, and you have to 'deduce' what they are actually asking.

The most likely situation was what I settled on - and once he actually gave a little more information, then it became fairly clear what he was trying to do.

I'll still give him the same answer - reed relays - if they are too big, then find smaller ones. Reed relays are available as DIL sized, or SIL sized - both relatively small. There's not really any other option, although 'perhaps' a bridge rectifier between opto-coupler and switch?, and connecting the opto-couplers the correct way round with the required resistors. However, the reed relay solution is guaranteed to work, other ways would require experimentation.

It doesn't help he's posting pictures rather than an actual circuit.
 
Quad bilateral switches (Such as CD4066) MIGHT work BUT StealthRT will need to provide the FULL schematic and be prepared to provide the wavefrorms when we have seen the schematic.

Les.
 
Quad bilateral switches (Such as CD4066) MIGHT work BUT StealthRT will need to provide the FULL schematic and be prepared to provide the wavefrorms when we have seen the schematic.

Les.
Again, it's a question of experimenting, and quad bilateral switches aren't isolated which could well be an issue.

Reed relays are simple, guaranteed to work, not terribly large, but aren't cheap!!.
 
Reed relays are simple, guaranteed to work, not terribly large, but aren't cheap!!.
Aren't cheap? Many options for under 2 bucks a piece at Digikey seems pretty reasonable!

These were one of the most useful things at Radio Shack in the later days before they closed. I think they were something like $1.29, and simple enough to exact the reed switch when I needed one.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top