HC-SR04 with I2C and UART communication?

Simply, my ultrasonic sensor's trig and echo pins have two other protocols besides using digital pins. How should i program and wire my arduino nano to use each of these protocols?

Here are the pin labels on its silkscreen mentioning two different names for trig and echo pins:

Does the rear of the PCB look like this?

Unfortunately not, mine has three ICs instead of one:

Ok, your version is different, but the markings are equally self-explanatory. For i2c mode, you need to use a blob of solder to connect the two pads marked M1 and leave the pads marked M2 alone. Or the opposite for UART (serial) mode.

What you will also need is an Arduino library that can communicate with the sensor in those modes. You should ask your seller for guidance on that.

Do you mean M1-R2 and M2-R3 respectively?

Unfortunately i bought this at the year of release (2021) online and the seller's account has been deactivated. For all this time i've only connected those two pins as digital and ignoring the two protocols mentioned on the silkscreen, and just got curious now...

Yes

Look for other sellers selling the same item and ask them to send you some information. If you are lucky, they won't check whether you actually purchased it from them or not. If they refuse, check that they will send something if you do buy another from them.

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