In this lesson, we will make a complex Capstone project which will use many of our previous knowledge. We will make two groups of sensors and actuators installed on two MEGA-IoT shields (to make things simple, we call Device A and Device ). We also need use ArduinoJson Library which can use short string to transfer data through json format.
The project has following functions:
Device A has DHT 11 temperature sensor which will send data to Device B and display temperature/humidity value in 1602 LCD in Device B.
Device A has Gas Sensor which will send data to Device B . If Gas is detected , buzzer in Device B will alarm.
Device A has RFID module which can send IC card ID to Device B 1602 LCD .
Device B has Red LED which can be turned on/off by push buttons in Device A.
OSOYOO MEGA2560 Board x 2
OSOYOO MEGA-IoT extension board x 2
USB Cable x 2
Red LED PnP module x 2
Push Button PnP Module x 2
I2C 1602 LCD PnP module x 1
Gas detection PnP module x 1
RFID modules x 1
Buzzer PnP module x 1
First please plug OSOYOO MEGA-IoT Extension Board into MEGA2560 board:
Then connect the modules with two OSOYOO MEGA-IoT Extension Boards (Device A&Device B) with PnP cables as below.
(Jumper Cap should connect ESP8266 RX with A8, TX with A9)
Modules – Device A
DHT11 – D2
RFID Module – RFID
Gas Sensor – A3
Push Button Module – D7
Modules – Device B
1602 LCD Module – I2C
Buzzer Module – D5
Red LED Module – D11
Step3 Open Arduino IDE ->Sketch ->Include Library ->Add ,Zip library to load above zip files into Arduino IDE.
In sketch deviceB, you need change Wifi SSID and password in Line 22,23, you also need set device A IP address in line 26.
Step 1) please load deviceA.ino to Sender Arduino device.
Make sure have changed line 22,28,32 with correct wifi password,ssid and device B IP address.
If you don’t know receiver device IP address, you need run sample code in lesson 3
Open serial monitor, put a IC card to RFID module, you will see following screen:
As receiver Arduino sketch is not running, you can not get any action at this moment.
Step 2) please load deviceB.ino to device B Arduino board, also change the wifi ssid ,password and device A Ip address properly.
Open serial monitor, you will see following screen:
At the beginning , there is some error because no IC card detected in device A. After you Put an IC card to device A RFID moduel, it will show RFID number in serial monitor.
Now check the LCD which is connected to I2C 1 slot of Device B, it will show Temperature, Humidity and RFID# which is sent from Device DHT11 sensor and RFID module.
Red LED in Device B which can be turned on/off by push buttons in Device A.
let’s use a gas lighter to leak some gas to gas sensor, buzzer in Device B will alarm.
You can add some more sensors and actuators in this project and make far more complex IoT projects. If you have any question, feel free to contact [email protected] to get help.
DownLoad Url osoyoo.com