[Tuya Smart] Multi-parameter ambient air quality monitoring recorder. The environmental parameters "temperature-humidity-illumination-atmospheric pressure-carbon dioxide-TVOC" are collected and displayed using broken code LCD or 3.5-inch TFT-LCD; powered by two 18650 batteries and charged via USB; real-time environmental data are transmitted to the Tuya backend through the WB3S module , environmental data can be monitored in real time through the mobile APP; environmental parameter data can be stored through FLASH.
The actual welded chip is STM32F103CBT6. The price of STM32 has skyrocketed, but I have no choice but to get familiar with it, so I grit my teeth and endure it, and try to have the opportunity to switch to domestic chips next time.
5V to 3.3V, AMS1117-3.3 remains unchanged for thousands of years. Don’t ask me why, just look at its sales on Lichuang Mall. (Tip: If you don’t know how to choose a chip, just go to Lichuang Mall to see which ones have the highest sales of the same type of chips!!!)
Using AT24C04, IIC bus driver, classic chip, storage system parameters.
Of the four function buttons, only KEY1 is actually used as the network distribution button. There is no time to write the programs for the other three buttons.
The WB3S module was used in the last training camp, so I brought it over directly this time. It has BLE & WIFI dual-mode and is easy to configure the network! This time I used the MCU SDK development mode.
It is used to store environment monitoring parameters. I originally planned to make the file system FATFS, but the time was tight and it was too late. I just tested the storage function of FLASH.
All sensors have IIC interfaces and are connected to the same bus. External sensor interfaces CN1 and H7 are also reserved. As long as the device is powered by 3.3V and has an IIC interface, it can be connected to it for testing.
(1) Temperature and humidity sensor. SHTC3, Shengshi Ruian's chip, is very good, with high precision and low power consumption. (2) Light sensor. OPT3001, the first time I used it, I found it at Lichuang Mall. Jialichuang can do patch welding, so I chose it. (3) TVOC sensor. SGP40, a new replacement for SGP30, is also a chip from Shengshi Rui, but it needs to be ordered and I didn’t have time to debug it. I used the previous SGP30, which can monitor TVOC and carbon dioxide. Please note that SGP30 is powered by 1.8V, so be sure to do this when using it. Level conversion circuit. (4) Atmospheric pressure sensor. SPL06-007, monitors atmospheric pressure and can calculate altitude. This is my first time using it, so I don’t know if it’s accurate.
The purpose of choosing this LCD is because it comes with a matching casing. I don’t know much about 3D printing, so I could only buy a finished common-mode casing. After adjusting it for a long time, I finally chose it. It costs 40 yuan for a set, casing + display, which is a bit expensive. I heard that it is easier to win prizes if you have a shell, so I gritted my teeth and endured it.
The HT1622 is used to drive the segment code LCD screen, and the AW9364 is used as the backlight adjustment (but the debugging was not successful, so we can only wait for the future, embarrassing!)
Using the IP5306 chip and referring to the designs of other experts on the open source platform, it was quite successful. However, I tried to detect the battery power through the three control pins of the charge and discharge indicator, but failed!
The main program is called every 10 seconds to update the environmental monitoring data and upload it, and the timer is set to 500 milliseconds.
The specific implementation of the all_data_updata() function is in protocol.c. This is very critical! ! !
Link: https://github.com/GitHubXieZY/Termp-Humi-Recorder .
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