1) Objective:
HC-SR04 is ultrasound distance sensor. IntoRobot Nut is a MCU board with wifi feature. In this project, we will use NUT to drive HC-SR04 sensor and send distance data to IntoRobot Cloud.
2) Parts and devices:
Devices
quantity
Nut board
1
HC-SR04 distance sensor
1
USB power adapter
1
USB cable
1
jumper wires

3) Circuit graph

Nut
HC-SR04
5V
VCC
GND
GND
Trig
D0
Echo
D1

4)Step by Step procedure:

A)Register an IntoRobot Account and add your NUT to IntoRobot cloud, for detail, please read https://osoyoo.com/2016/11/15/intorobot-nut-quickstart/

B)Add HC-SR04 distance sensor into you

After login to your IntoRobot account, click My  devices->Demo devices->距离检测->测距仪

C)Click Fork it to my device

D) Select your Nut board from device drop down menu and click Update device

E)  Click Yes on question “Write to the device?”
After compiling, you will see distance info as following:
You can also see the data in your IntoRobot Mobile App.
Click programming->Diastimeter, you can see and customize source code to meet your special requirement