Wiznet makers

Love_yourself

Published August 20, 2023 © 3-Clause BSD License(BSD-3-Clause)

0 UCC

0 VAR

1 Contests

0 Followers

0 Following

Intelligent building system

Implement an intelligent building system that can be monitored from the cloud with WIZ830MJ

COMPONENTS Hardware components

WIZnet - WIZ830MJ

x 1

Software Apps and online services

WIZnet - WIZnet io Library

x 1


PROJECT DESCRIPTION

Intelligent building system

Intelligent building system is a system that monitors in real time whether the environment in the building is safe, it detects whether the concentration of combustible gas in the various areas exceeds the set threshold, when the threshold is exceeded, the fresh air system is turned on and a warning message is sent to the aliyun platform. When a flame is detected in the area, the fire extinguishing device is turned on and a buzzer sounds to warn people in the area. It also counts the number of people entering the building and the number of people leaving, and this information is displayed on the LCD screen in real time. When an area is in danger, the administrator can handle it and clear the alarm after the handling is complete. Devices within the system can also be controlled and monitored directly from the cloud platform.

COMPONENTS

Hardware components

  1. STM32F103ZET6                                           x 1
  2. WIZ830MJ                                                        x 1
  3. Infrared sensor                                                x 2
  4. MQ-4 sensor                                                     x 3
  5. Fire sensor                                                        x 3
  6. Buzzer                                                                x 3
  7. Motor                                                                  x 3
  8. Water pump                                                      x 3
  9. Button                                                                 x 3
  10. 4 x 4 Matrix keyboard                                     x 1
  11. 4In LCD screen                                                 x 1
  12. 6 Relay Module                                                 x 1

Development environment and online server

  1. STM32CubeMX
  2. Keil5
  3. Alibaba Cloud platform

Project description

The Intelligent building system consists of STM32F103ZET6 and WIZnet's WIZ830MJ. It collects sensor data and performs logical processing to send an alert message to the cloud platform via WIZ830MJ when an anomaly is found. Monitoring data can also be displayed on the LCD screen at any time. The following is the system block diagram of the whole project. It can help you better understand the operation of the entire system.

The system is connected to the WIZ830MJ by BUS. WIZ830MJ IP address mode is configured as DHCP mode, so that you can easily and quickly connect the system to the network environment. Because a public MQTT server is used, DNS is also configured to automatically resolve the MQTT server domain name for easy connection. Because the MCU uses a 16bit BUS and WIZ830MJ connection, high-speed data transmission capabilities can be obtained. Its w5300 chip also supports 8-way sockets, which can meet almost any industrial demand.

Hardware implementation

The MCU and WIZ830MJ are connected via a 16bit BUS, and then the sensor data is read by configuring the GPIO port and ADC. The MCU controls a 6-way relay via GPIO to turn on and off the fresh air system and fire extinguishing device in each area. The following is a schematic diagram of the entire system connection.

Software configuration

You can configure the way pins or peripherals work on the STM32CubeMX tool according to your needs. It will automatically help you generate standard projects based on the HAL library, you only need to write logical code.

 

System model

 

Software implementation

MQTT server side Settings

I use the MQTT server of Alibaba Cloud platform. After simple registration, you can use most of the functions on its server.Alibaba Cloud - Computing, for the incalculable value(aliyun.com)

After registering your account and logging in, you can create your product in the iot console, which I've already done in advance.

Next, we create a device under the created product

After everything is in place, we can define the functionality of the product to present and monitor data in the cloud.

Here, we can find the MQTT connection parameters connected to Alibaba Cloud platform.

The next step is to record the subscription and publication topics for MQTT

The/sys/ieojDDNl2aE / ${deviceName} / thing/event/property/post for the release of the theme of the equipment, mainly used to report information. / sys/ieojDDNl2aE / ${deviceName} / thing/service/property/set to subscribe to the topic of the equipment. (Note: we need to replace ${deviceName} with the name of the device we created.)

In this way, we can issue commands to control the system through the cloud platform.

You can view the system data reported by the device in real time, as shown in the following figure.

If the system detects that the concentration of combustible gas in zone 1 exceeds the standard, we can issue instructions through the MQTT server to open the fresh air system in Zone 1. As shown in the picture below, I controlled the start of the fresh air system in Zone 1.

Now, let's simulate that there is a fire warning in area 1, and let's control the fire extinguishing device in area 1 through the command issued by the server (since it is only a model, I will use a small water pump to simulate the fire extinguishing device). Of course, any device in the entire system can be controlled through the cloud platform.

You can see the operating status of the system on the cloud platform and the LCD screen of the model

Of course, you can also alarm by pressing the alarm button in each area, at this time the buzzer will issue a warning, and the fire extinguishing device starts to work. When the danger is relieved, the administrator can eliminate the alarm in each area through the three buttons in the first row of the 4x4 matrix.

This system is briefly introduced here. Thank you all for watching!!!

Project link:Intelligent building system

YouTube Video demo link:

Documents
  • Intelligent building system project

    Project complete file

  • main.c

    main file

  • Intelligent building system Schematics

Comments Write