-->
Page 1 of 1

multiple inputs without multiplexer

PostPosted: Sun Jan 22, 2017 12:34 pm
by molahs
Hi,
I want to have esp8266-12e setup with 4 or 5 buttons.
each button press will trigger a mqtt action.
The mqtt action isn't an issue.
I would like to inquire whether the esp8266 can have 5 inputs (toggle switch) without using a multiplexer?

Thank you very much for your assistance.

Re: multiple inputs without multiplexer

PostPosted: Sun Jan 22, 2017 7:01 pm
by rudy
You can have each switch connected individual IO pins. If you do not have enough IO pins available then you will need to use a different approach. I don't know what you consider to be a multiplexer. The term by it's self is not descriptive enough. It could mean that you don't want to use external chips or it could mean that you do not want to do other tricks in order to combine the switch signals that would take less IO pins.

I will throw out one option that I consider is multiplexing but maybe it could be acceptable to you. Use the analog input to measure a resistor string with the switches shorting out different resistors to produce a variable input voltage that you can then use to determine the closed switch.

Below are two ways to accomplish the same thing. Values and voltages should be adjusted to meet your needs.

Image

Image

Re: multiple inputs without multiplexer

PostPosted: Mon Jan 23, 2017 1:27 am
by molahs
@rudy, that is the best idea ever and exactly what I was hoping to hear.

I'll most probably go down the route of the first image, using a resistor for each button.

Thank you very much for the pointers.