The IoTGuard consisted of a Nucleo-144 and Wiznet W5300-TOE-Shield. And It is connected with Fire, Gas, Door sensors and TFT-LCD. It collects sensor data and publish alarm message to registered devices when an abnormal operation is detected and also receive an image data from registered devices. Below image summarized whole IoTGuard’s data flow. You can understand more easily.
To perform this operations, The IoTGuard use two TCP ports(#1883, #5000) in W5300-TOE-Shild. TCP port 1883 uses for MQTT service to publish/subscribe MQTT topic messages. and TCP port 5000 uses to receive an image data from the registered android mobile devices.
The IoTGuard performs below three main functions to protect your life and property.
- The IoTGuard collects data from three types of sensors (fire/gas/door), and send a notification message to the registered devices when an abnormal operation is detected.
- The IoTGuard periodically monitors GPS data from the registered devices to let you know where they are.
- The IoTGuard receives an image data from the registered device. This image data can be used to understand in their circumstance more easily.
# Connect Nucleo-144 with W5300-TOE-Shield
1. Remove SB5 and SB6 from the top of the STM32 Nucleo-144 board.
2. Connect PC10, PC11 of the W5300 TOE Shield and CN5 TX, RX of the top of the STM32 Nucleo-144 board with jumper cables.
# Make a simple miniature for demonstration
As shown in the image below, you can test and monitor fire/gas/door alarm event and received an image
# Make an interface PCB to connect miniatures and demo board easily
A simple interface board was made to connect various types of sensors and LCD easily.
This interface board used like below. All sensors can be connected easily.
# MQTT broker setting implementation
I used HiveMQ service for IoTGuard demonstration. The HiveMQ can be used without site registration. And easy to access using your web browser. Connect to https://www.hivemq.com/demos/websocket-client after then click connect button.
Added ig_sub and ig_pub topics on right side in Subscritpios tab.
When IoTGuard boot-up, It will be published start-up message like below.
Alarm messages are published by IoTGuard.
Update GPS data periodically.
# IoTGuard (Nucleo-144 + W5300-TOE-Shield) implementation
The IoTGuard is developed based on Wiznet example from https://github.com/Wiznet/W5300-TOE-C
Create two threads for handling each service (MQTT and Image receive).
MQTT topic and TCP data transfer following specification.
[Info] Avoid privacy information, I used below two dummy GPS data for this demonstration.
1. [ 37.5797, 126.9772 ] – Gyeongbokgung Palace in Seoul, South Korea
2. [ 21.276339, -157.827073 ] – Waikiki Bay in Hawaii, USA
Porting ILI9844 TFT-LCD driver after then IoTGuard Monitor display alarm, Device name, GPS data and Received image on TFT_LCD.
When alarm event detected, Alarm icon will be changed to red like below.
# IotGuard android application
I made a dedicated android application for demonstration.
- Main and Setting screen of IoTGuard android application.
- After set up, Device name shows in Mobile list window. Few times later, GPS data will be updated like below.
- Received alarm event from the IoTGuard
- Mobile device’s location display on the map.
- Launch camera application and take an image.
- Send an image to IoTGuard then update received image on TFT-LCD
# Demo on youtube
Comments