Here, we will demonstrate how to use this kit to remotely collect the data detected by the ultrasonic ranging sensor and display it on the OSOYOO IOT UDP APP.
First, please plug OSOYOO MEGA-IoT Extension Board into MEGA2560 board:
Build the circuit as below:
Here we connect the Echo to port D25, connect the Trig to port D26.
If you haven’t installed following libraries in previous lessons, You also need to download them from following link:
In Arduino IDE, click Sketch→Include Library →Add .ZIP library and upload the library zip file to the IDE.
Download and Edit Lesson2-4 Arduino code:
Step 1 After installing the above library, please download the code from the following link, and unzip it:
Step 2 After the above operations are completed, connect OSOYOO MEGA2560 Board to PC with a USB cable.
Step 6 Open Arduino IDE: Choose corresponding board type and port type for your project.
Step 7 Arduino IDE: Click file – Open, then choose code in the folder, load up the sketch onto your Arduino.
Note: In the sketch line 13,14, find these lines as following:
In the sketch code and replace *** with your Wi-Fi ssid/password
char ssid = "***";//replace this line with your Wi-Fi ssid char pass = "***"; //replace this line with your wifi password Upload the sketch to the board. Wait until you see something like this:
Now open your Serial Monitor, you will see Arduino IP address
APP Installation and Setting:
Step 1) If you haven’t installed OSOYOO IoT Robot APP, please search OSOYOO IoT Robot Car APP in Google Play or Apple Store to install this APP.
You read following tutorial link for more information about APP install :
Step 2):Make sure your Cell phone is in the same Local Network of Arduino. Open the APP, click Settings, enter your Arduino IP address from Step F and Port to 8888 in settings:
Now open your OSOYOO IoT UDP APP (if you don’t have it, search OSOYOO IoT UDP Robot APP in Apple Store or Google Play Store).
You will see the Object Distance value in the text field. If you can’t see the value, click any key, it will show the distance value.
|1||OSOYOO MEGA2560 Board||1||Click here to buy|
|2||OSOYOO MEGA-IoT Extension Board||1||Click here to buy|
|3||Photosensitive Sensor||1||Click here to buy|
|4||Temp & Hum Sensor||1||Click here to buy|
|5||OSOYOO Active Buzzer Module||1||Click here to buy|
|6||Flame Detection Sensor||1||Click here to buy|
|7||Fan Motor Module||1||Click here to buy|
|8||Micro Servo Motor||1||Click here to buy|
|9||RGB Module||1||Click here to buy|
|10||Ultrasonic Sensor||1||Click here to buy|
|11||PIR Motion Sensor||1||Click here to buy|
|12||Microphone Module||1||Click here to buy|
|13||1602 I2C LCD Screen||1||Click here to buy|
|14||RFID Module||1||Click here to buy|
|15||White LED Module||1||Click here to buy|
|16||Red LED Module||1||Click here to buy|
|17||Colorful Light||1||Click here to buy|
|18||Red Button Module||1||Click here to buy|
|19||Blue Button Module||1||Click here to buy|
|20||Philips Screwdriver||1||Click here to buy|
DownLoad Url osoyoo.com