Go Down

Topic: ESP32 Hardware Interrupt - 2 switches on 1 pin? (Read 338 times) previous topic - next topic

jtbennett

Hi - I have an ESP32 WROOM chip with all my pins in use. I have a little bump switch on pin 18 that serves as an auto stop on a linear actuator. It's using the hardware interrupt option, and working with a pullup. If I wanted to connect a second bump switch on the other end of the axis, would it technically be fine to run it on the same pin (just merge the wires some point before)?

Idahowalker

Me, I'd, in this case, consider putting the bump switches, through an OR gate and then onto the ESP. The problem then becomes, in the least, which auto stop has been activated.
Receiving partial information does not help me help you and wastes my time.

jtbennett

Me, I'd, in this case, consider putting the bump switches, through an OR gate and then onto the ESP. The problem then becomes, in the least, which auto stop has been activated.
I don't think I need to differentiate because there's no reason for anyone to be all the way at the end of the axis, I'll just send it to the zero point each time it gets stopped. What's an OR gate? I'm no good at circuit design stuff :|

6v6gt

>> What's an OR gate?
In the minimum case, 2 small signal diodes.

PerryBebbington

You can connect 2 switches as you suggest. If they are normally closed then put them in series, if they are normally open put them in parallel. I suggest using normally closed switches in series and writing your code accordingly. That way, if a wire comes loose or a switch breaks or something like that the circuit will be broken and the program will respond accordingly. With normally open switches in parallel a loose wire will not show up until the switch is pressed and nothing happens.

Idahowalker

What's an OR gate? I'm no good at circuit design stuff :|
Do some research, start by using the words 'OR gate' into your internet search engine and go from there. Mostly, I'd use a gate, in this case, to separate or isolate, the two switches.
Receiving partial information does not help me help you and wastes my time.

jtbennett

Thanks for the help - I'm gonna try this gate business out!

Go Up