0

I have an ESP8266 to which I want to connect a few ultrasonic sensors. I need to poll them every second in order to calculate the distance they measure. Because ESP8266 doesn't have many digital pins, I have to use an I/O extender, but I don't know how to find a cheap option. I need 1 IN pin and 1 OUT pin per HC-SR04 sensor and I plan to use as many sensors as I can. Can anybody help me?

  • StackOverflow community is related to software development while your question is hardware based and I suspect that you will not get an answer here. Also it would help people to answer you if they know what ultrasonic sensors do you plan to use to know how many pins do you need - Please specify it in question, i.e. _I need 1 IN pin and 1 OUT pin per HC-SR04 sensor and I plan to use 6 sensors_. – Maxim Sagaydachny Feb 25 '20 at 08:36

1 Answers1

0

If these are the standard sensors with vcc, gnd and 2 pins where 0/1 is sent/received I use the

PCF8574 / PCF8574A  8   INPUT, OUTPUT
PCF8575     16  INPUT, OUTPUT 

to multiplex data input/output (real life use in model railroad)

with multiple sensors like hall effect / ir gates and other triggers. Use the I2C protocol and can be daisy chained. If you buy modules then look for the possibility to jumper the I2C address and if neccessary to attach extra power (not from ESP) for the sensors so the drain on the ESP is minimized.

For ESP8266/NodeMcu/ESP32 you need modules working with 3.3 V on the ports (some modules work with 3.3.V / 5V these are for universal use).
Prices for quality modules 16 port are 3-5 $/Eur.

Codebreaker007
  • 2,911
  • 1
  • 10
  • 22