Authorized Online Retailers:
In this lesson, we’ll learn how to use HC-SR04 Ultrasonic sensor to measure distances and send data to remote browser.
|Ethernet Shield W5100||1|
|HC-SR04 Ultrasonic sensor module||1|
Connect the HC-SR04 with UNO as following diagram:
Download the sketch file from https://osoyoo.com/driver/ethernet_iot/lesson10/w5100-lesson10.zip
unzip the file and double click the w5100-lesson10.ino file, load the sketch into Arduino IDE.
Open your Serial Monitor, you can see your router will assign an IP address to your Arduino as following:
In above example, 10.0.0.45 is the IP address of my Arduino.
Now put an obstacle in front of the sensor and use another computer or your cell phone’s browser to visit url : http://10.0.0.45
Your browser will show following result which tells you the distance between sensor and obstacle:
DownLoad Url osoyoo.com