Buy from US | Buy from UK | Buy from DE | Buy from IT | Buy from FR | Buy from ES | ここでご購入を! |
In this lesson, we will learn how to use the HC-SR04 Ultrasonic sensor to measure distances and send data to a remote APP.
OSOYOO Basic board x 1
OSOYOO ESP8266 WIFI Shield x 1
HC-SR04 Ultrasonic sensor module x 1
USB cable x 1
Jumper wires several
OSOYOO Basic Board | HC-SR04 |
5v | VCC |
GND | GND |
D8 | Trig |
D7 | Echo |
Software Installation:
Step A) Install the latest IDE from https://www.arduino.cc/en/Main/Software?setlang=en. If you have IDE version 1.1.16 or later, please skip this step.
Step B) Connect the OSOYOO Basic board to the computer via a USB cable.
Step C) Open the IDE and choose the corresponding board type and port type for your project.
Step D) Download the sketch file from https://osoyoo.com/driver/wifi-iot/lesson9/wifi-lesson9.zip,
char ssid[] = "******"; // your network SSID (name) char pass[] = "******"; // your network password
Please replace the ****** with your correct wifi SSID and password; otherwise, your project cannot connect to the internet.
Step E) After changing the above lines, load the sketch into the IDE.
Open your Serial Monitor, and you can see that your router will assign an IP address to your IDE, as shown below:
Step F) Open your OSOYOO IOT UDP Robot APP. If you haven’t installed this APP, please read the APP installation section in Lesson 2.
Now press any key on your APP, and your screen will display something like the following picture.
DownLoad Url osoyoo.com