You can download the user manual from:

https://osoyoo.com/manual/2021005400.pdf

Buy from US Buy from UK Buy from DE Buy from FR Buy from IT Buy from ES ここでご購入を!
Buy from US Buy from UK Buy from DE Buy from FR Buy from IT Buy from ES Buy from Japan

Objective

In this lesson, we will show how to use the OSOYOO Smart Home IoT Kit with the Blynk app to control electronic devices such as LEDs, active buzzers, fan modules, relay modules, and more.

We will learn how to use Blynk to remotely turn an LED on or off and control its brightness. Using the same principle, you can control other electronic devices as well.

Parts and Devices

HARDWARE

SOFTWARE

How to Make

First, plug the OSOYOO MEGA-IoT Extension Board into the MEGA2560 board.

Make sure the jumper caps shown in the red circles below are installed. These two jumper caps connect A9 to ESP_TX and A8 to ESP_RX.

MEGA-IoT Extension Board jumper cap installation

Connect the LED Module to the D2 port as shown below:

LED module connected to D2 port on OSOYOO Smart Home IoT Kit

How to Code

Prerequisite:

Download Arduino IDE

To install these two ZIP files, go to Arduino IDE → Sketch → Include Library → Add .ZIP Library and load each file.Add ZIP library in Arduino IDE

Download, Edit, and Upload the Lesson 2-1 Arduino Code

Step 1: Download the code from the link below and unzip it:
https://osoyoo.com/driver/Smart_House_IoT_Learning_Kit_V2.0_code/Lesson2-1.zip

Step 2: Connect the OSOYOO MEGA2560 board to your PC with a USB cable.

Notice: Disconnect the battery or power adapter before uploading the sketch to the Arduino.

Connect OSOYOO MEGA2560 to PC via USB

Step 6: Open Arduino IDE. Select the correct board type and port for your project.

Select board and port in Arduino IDE

Step 7: In Arduino IDE, click File → Open, select the sketch file from the unzipped folder, then upload it to your Arduino.

Open sketch in Arduino IDE

Note: In the sketch, find line 13 as shown below:

char auth[] =”sM1i_rSJjDlQxesfuhOzrL0h9NiivJkn”;

Replace sM1i_rSJjDlQxesfuhOzrL0h9NiivJkn with your own Blynk token. If you do not know how to get a token, read this article.

Then find lines 22–24 and replace the Wi-Fi SSID, password, and Blynk server IP address:

char ssid[] = "***";//replace with your Wi-Fi SSID
char pass[] = "***"; //replace with your Wi-Fi password
char server_ip[]="192.168.1.81"; // replace with your Blynk server IP address

Upload the sketch to the board. Wait until you see:
Done uploading

Open the Serial Monitor (upper right corner). You should see your Arduino’s IP address and a Ready message, as shown below:
Blynk serial monitor output showing IP address and Ready message
Congratulations! Your hardware is now connected to the Blynk cloud!

If you cannot see an IP address, check your Wi-Fi SSID and password in the code. If you see the IP address but no Ready message, verify that your Blynk token and local server IP address are correctly set in the code.

Blynk (Legacy) App Project Setup

Open your project page and tap the “+” button to add a “Button” widget.

Button widget settings:

Name: You can name your button widget anything you like.

Output: D2 | 0–1

Mode: Select Switch mode.

You can adjust the other options to your preference or leave them as default.

Blynk app button widget settings

Blynk app button widget configuration

Then go back to the project page and tap the “” button to start your project.

Blynk app project play button

How to Play

Tap the Button on the project page and the LED connected to D2 will turn on.

Tap the Button again, and the LED will turn off.

In PLAY mode, you cannot drag or add new widgets. Tap “” to return to EDIT mode.

If the device appears offline, check your code, wiring, and app settings, then try again.

Blynk app LED control result

Remotely Control LED Brightness

In this section, we will show how to control the LED brightness using the kit and the Blynk app.

The wiring and code are the same as before. You only need to add a new widget.

App Project Setup

Open your project page and tap the “+” button to add a “Slider” widget.

Slider widget settings:

Name: You can name your slider widget anything you like.

Output: D2 | 0–255

You can adjust the other options to your preference or leave them as default.

Blynk app slider widget settings

Blynk app slider widget configuration

Running Result

After completing all the steps above, open the Serial Monitor to verify the connection, then open the Blynk app and tap the PLAY button “” to switch from EDIT mode to PLAY mode and interact with the hardware.

In PLAY mode, you cannot drag or add new widgets. Tap “” to return to EDIT mode.

Blynk app slider controlling LED brightness

Slide the slider to change the LED brightness. When the slider is at the far left, the LED is off; at the far right, it is at full brightness.

If the device appears offline, check your code, wiring, and app settings, then try again.

 

No. Picture Device Qty. Link
1 OSOYOO MEGA2560 Board OSOYOO MEGA2560 Board 1 Click here to buy
2 OSOYOO MEGA-IoT Extension Board OSOYOO MEGA-IoT Extension Board 1 Click here to buy
3 Photosensitive Sensor Photosensitive Sensor 1 Click here to buy
4 Temperature and Humidity Sensor Temp & Hum Sensor 1 Click here to buy
5 OSOYOO Active Buzzer Module OSOYOO Active Buzzer Module 1 Click here to buy
6 Flame Detection Sensor Flame Detection Sensor 1 Click here to buy
7 Fan Motor Module Fan Motor Module 1 Click here to buy
8 Micro Servo Motor Micro Servo Motor 1 Click here to buy
9 RGB Module RGB Module 1 Click here to buy
10 Ultrasonic Sensor Ultrasonic Sensor 1 Click here to buy
11 PIR Motion Sensor PIR Motion Sensor 1 Click here to buy
12 Microphone Module Microphone Module 1 Click here to buy
13 1602 I2C LCD Screen 1602 I2C LCD Screen 1 Click here to buy
14 RFID Module RFID Module 1 Click here to buy
15 White LED Module White LED Module 1 Click here to buy
16 Red LED Module Red LED Module 1 Click here to buy
17 Colorful Light Colorful Light 1 Click here to buy
18 Red Button Module Red Button Module 1 Click here to buy
19 Blue Button Module Blue Button Module 1 Click here to buy
20 Philips Screwdriver Philips Screwdriver 1 Click here to buy