Authorized Online Retailers:


1 Overview

In this lesson, we will use OSOYOO Uno board , PIR motion sensor and buzzer to make a home alarm system. When an intruder is detected by PIR motion sensor, the buzzer will beep and Osoyoo Uno board will send alarm notification by email through Internet.

2 Hardware Preparation

UNO Board 1
Ethernet Shield W5100 1
USB cable 1
HC-SR501 PIR motion sensor 1
buzzer sensor module 1
Jumper wires Several
Breadboard 1

3 Hardware connection

4 Sketch File

Use the following link to download the sample code: :the sample code in here!

Please copy the code to the IDE and be sure to switch your stuff below.

The username, password and clientID of the MQTT can be logged in to the cayenne site ,checked on the Arduino UNO Configure page.

we specified Channel 21 with the Widget earlier, so we change the VIRTUAL_CHANNEL number in the code to 21 as well.

the motion sensor and the buzzer connect pin 3 and 4 in Arduino board, please input motionSensorPin and buzzerPin in the code correctly.

In Arduino IDE, select the board type for Arduino Uno, select the correct port number, click the Upload button, and upload it to the Arduino UNO board. With a bit of time, the data is displayed on the Cayenne dashboard:

Click the “+” button to add it to datasheet.

Click the setting button and enter settings. Please set as follows:

5 triggers setting

Click the “setting” button on the upper right of Channel 21 and click “Trigger”::

The Create Trigger screen appears. Please set, it is necessary to fill in all the details necessary for creating Trigger.

In this department, we created the following Trigger: If “Motion Sensor” (1), we will send an email or short message.

1)trigger Name: Osoyoo

2) Drag Arduino UNO board to the IF statement. Please select Channel 21 and click setup notification.

3) ) Please refer to the following image, please input (Please do not switch your own e-mail advice.),Please click on SAVE .

Once the trigger is created, you can go back to the My Triggers list and see the trigger you created.

When any human motion detected by PIR motion sensor, the buzzer will beep and Osoyoo Uno board will send alarm notification by email.