Authorized Online Retailers:

Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

Authorized Online Retailers:

AMAZON
AMAZON-jp
amzuk

1) Overview

This lesson is our final project which is a little bit complicated and more exciting.  In previous lesson, we only use browser or cell phone to make human talk. In this lesson, we will one mainboard to talk with another mainboard through Internet UDP protocol. You need to buy two set of our  IoT learning kits.
We  will use  first OSOYOO basic board(call basic A) to connect PIR motion sensor and another OSOYOO basic board((basic B) to connect buzzer.   When an intruder is detected by PIR motion sensor in basic A, an Alarm signal will be sent from basic A to basic B and make  the buzzer   beep.

2) Hardware Preparation

Quantity
OSOYOO basic board( 2
Ethernet Shield W5100 with RJ45 cable 2
USB cable 1
HC-SR501 PIR motion sensor 1
buzzer sensor module 1
Jumper wires Several
Breadboard 1

3) Hardware connection

Hardware A) OSOYOO basic board A+W5100 shield connects to PIR motion sensor
Motion Sensor Central OUT pin connect to D3 as per following graph:

Hardware B)OSOYOO basic board B+W5100 shield connects to buzzer
Buzzer I/O pin connect to D4 as per following picture:

4 ) Sketch File Download

Use the following link to download the sample code: https://osoyoo.com/driver/ethernet_iot/lesson13/w5100-lesson13.zip
After unzip above file, you will see a folder “w5100-lesson13” , enter this folder, you will see two sub-folders(buzzer and motionsensor).

Step A)Enter buzzer folder and double click the buzzer.ino file, upload the sketch into mainboard which connected to buzzer.

Open your Serial Monitor, you can see message as following:

Your mainboard IP address is 10.0.0.244

This. IP address is assigned by router to your buzzer mainboard . You have to write down this IP address in a paper. We need to use this IP address to change the sketch code in motionsensor.ino file.  You can unplug this mainboard from PC and use some other USB adapter to power this buzzer mainboard .

Step B)Now connect your PIR motion sensor mainboard to your PC, open the folder motionsensor and open the motionsensor.ino file.
You need to change the line 41 remoteIp[] variable , replace the IP address with the one your recorded from Step A.
Then you can compile and upload the motionsensor.ino file to mainboard .

Test:

Make sure both W5100 shield are connected to Router. When you move your hand in front of the motion sensor, the remote buzzer will beep.