This system is mainly composed of a variety of sensors, including temperature and humidity sensors, light intensity sensors, human body induction sensors, flame sensors, touch sensors, light sensors, sound sensors, alarm modules, OLED display modules, four-way dial switches, and ART expansion modules The system structure is shown in the figure below:
According to the application scenario, this project is divided into three parts: environmental monitoring, intelligent security, and intelligent light control. The system function structure diagram is as follows:
The environmental monitoring part consists of DHT11 temperature and humidity sensor and BH1750 sensor, the intelligent security consists of SR602 human body induction module and flame sensor, and the intelligent lighting control consists of sound sensor and light sensor.
The system hardware connection is shown in the figure below
ART-Pi | hardware | ART-Pi | hardware |
---|---|---|---|
PC2_C | SR602 human body sensing module | PA5 | DHT11 temperature and humidity sensor |
PH15 | flame sensor | PH13 | buzzer |
PA6 | touch sensor | PC6 | Photosensitive sensor |
PH11 | BH1750_SCL | PH12 | BH1750_SDA |
PH11 | OLED_SCL | PH12 | OLED_SDA |
PD13 | KEY11 | PH7 | KEY2 |
PH9 | KEY3 | PH14 | KEY4 |
PG7 | LED1 | PH8 | LED2 |
Use the PA5 pin to connect the DHT11 output port, read the temperature and humidity data measured by the DHT11, and use the IIC bus method to calculate the data measured by the BH1750 light intensity. When the temperature and humidity data or light intensity data exceed the threshold, the alarm module starts and the system Alarm, and at the same time perform response actions and adjust environmental data. The flow chart is as follows:
Use the SR602 human body sensing module. This sensor is an analog sensor. After AD conversion, the voltage value is converted into a digital quantity. When the flame sensor detects a flame, it outputs a high level signal. When a flame is detected or someone enters, the system alarm module is activated. The flow chart is as follows:
Use sound sensors and light sensors to turn on the lights when there is no light (night) and there is sound.
~~~~
Source code: Link: https://pan.baidu.com/s/1E4UNztR-j6fNze8NFPNrkA
Extraction code: bauv
1. The functions completed by the project are: DHT11 temperature and humidity sensor acquires temperature and humidity data and displays it on the display screen. The flame sensor detects whether there is a flame and generates a trigger alarm (LED3 lights up and the buzzer sounds). The photosensitive sensor determines Whether there is light in the environment, the LED light will be turned off if there is light, and the LED light will be turned on if there is no light. The touch sensor is used to determine whether someone touches it. If it is touched, the LED light will flash.
2. Difficulties encountered: I didn’t have much contact with microcontrollers before. This time I have some understanding of microcontrollers and RT-Thread. Some functions like ADC and IIC peripherals are not very clear about the bottom layer. I also understand the RT-Thread operating system. I will use events to slowly make up for it in the future, and I want to continue using this board to continue research. 3. I also took a lot of notes while learning RT-Thread, summarized them and wrote them on the blog. Although they are all entry-level, I took them seriously. I hope I will understand them more and more in the future. Blog link: https://blog.csdn.net/jiangyingh/category_10770427.html
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet