Pin to gnd in place of digitalwrite(LOW)?

I am still pretty new to this area, but really enjoying playing with the Arduino’s and learning a lot thanks to forums like this. Typical “this is a very n00b question” disclaimer here.

I am using a Nodemcu ESP8266 12-e which only has one analog pin. I am trying to read two analog sensors so I got a CD4051 multiplexer https://a.co/d/0i9eqXN

Since I am not planning to read more than 2 analogs, I never plan to toggle the B and C bits to read analogs beyond pins 0 and 1.

I am low on digital pins and would like to avoid wasting 2 to write LOW to pins B and C.

Silly question: can I just wire pins B and C to gnd and/or put a resistor between them and ground to ensure they remain LOW?

Typical Connection Diagram (Fig-1) between 4051 and NodeMCU to suit OP's (@jdoto713 ) need.
4051Node
Figure-1:

What are the 2.2k pull-downs for?

Why do you label a crippled selection method as typical?

  1. To avoid floating conditions when sensors are not connected.
  2. I humbly delete the word typical from post #2.

Is that more valuable than an uninfluenced analog reading? Not for me.

Then I would increase the pull-down resistors to 20k each

Not using them at all would give the most accurate measurement.

If Senosr-2 is removed from Ch-1 for maintenance purposes while Ch-0 is kept in operation, then the channel cross talk (during switching) between Ch-0 and floating Ch-1 might be noticeable.

1 Like

not a silly question - but yes you can just ground them.

Thanks for the quick responses!

Great to hear I can save a few pins and ground the ones I wanted to always be LOW. I also did not explicitly ask, but see in that diagram I can do the same for the inhibit bit too.

That pin can only be grounded, which is in input mode.

yes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.