Wemos D1 Mini and HC SR04 Ultrasonic Sensor

Erelen edited this page Oct 21, 2018 · 3 revisions

HC-SR04 Ultrasonic Sensor

"This is the HC-SR04 ultrasonic ranging sensor. This economical sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit." See HC-SR04 Ultrasonic Sensor for more information.

Buy example:

Connecting the HC-SR04 to a Wemos Mini D1

Wemos HC-SR04
D6 (gpio12) Echo via voltage divider
D7 (gpio13) Trigger

The HC-SR04 operates best at 5V, therefore the echo signal will be 5V as well. Connecting the echo pin via a voltage divider (see schematic) will divide the 5V to 3.3V, which is the operation voltage of the Wemos D1 Mini.

Tasmota Configuration

In the Configuration -> Configure Module page, select the following:

  1. Module Type : 18 Generic
  2. D6 GPIO12 : 70 SR04 Ech
  3. D7 GPIO13 : 69 SR04 Tri

Tasmota Main

After reboot of the device the displays the HC-SR04 distance.

Theo's Tasmota Tips
What's New

Getting Started

Upload tools


Devices - Additional Info

Home Automation Integration

Other Integrations

Further Topics



Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.