siza1BYFS

#9th LCSC Electronics Design Contest# Indoor Thermometer and Hygrometer

 
Overview
Note: * Required fields,
please fill them in during the registration phase ↓
 
* 1. Project Function Introduction

Design an indoor thermometer and hygrometer with a time function;
support OLED display (128X32);
support SHT40 temperature and humidity acquisition;
support clock display and setting;
support alarm clock display and setting;
support buzzer response;
equipped with a lithium battery and support charging function;
support low battery reminder;
support LED charging indicator.
*2. Project Attributes

This project is being publicly disclosed for the first time and is my original work. I have not participated in any other competitions.
 
* 3. Open Source License

Support All hardware is open source.
 
 
*4. Hardware Part

This project has simple functions and uses LCSC EDA for design. The overall design is as follows, and each part will be introduced in detail later.
Main Control
Circuit The main control circuit uses STM32F103C6. The reason for choosing this chip is as follows:
STM32F103C6 is a mainstream enhanced ARM Cortex-M3 microcontroller (MCU). The following is a detailed summary of its characteristics and parameters:

Core parameters:

32-bit RISC core, based on ARM Cortex-M3 architecture.
Maximum operating frequency up to 72 MHz.
Performance of 1.25 DMIPS/MHz (Dhrystone 2.1) with zero-wait memory access.


Memory:

High-speed embedded memory, including 32 KB Flash memory and 6 KB SRAM memory.


Peripherals and Interfaces:

Two 12-bit ADCs (Analog-to-Digital Converters) for analog signal acquisition.
Three 16-bit general-purpose timers plus one PWM timer for precise timing and motor control applications.
Abundant communication interfaces, including up to two I²C, SPI, three USARTs, one USB, and one CAN interface for easy communication with external devices.


Power Supply and Temperature:

Supply voltage range of 2.0 to 3.6 V.
Operating temperature range of -40 to +85 °C, extended temperature range of -40 to +105 °C.


Energy Saving and Security:

Provides a comprehensive set of energy-saving modes suitable for low-power application designs.
Hardware encryption and access control functions protect system security.


Package and Pinout:

Available in different package types from 36 pins to 64 pins to meet different application requirements.


Other features:

Supports multi-channel PWM output, which can be used for controlling devices such as LEDs and motors.
Interrupt and DMA functions enable efficient data transmission and processing.
Internal clock and reset circuits are integrated to provide stable clock signals and reset functions.



The STM32F103C6 is widely used in motor drives, application control, medical and handheld devices, PC and gaming peripherals, GPS platforms, industrial applications, and many other fields due to its high performance, rich peripheral interfaces, and flexible configuration options. The
pin assignment and minimum system of this main controller are shown in the figure below:
To make the RTC more accurate, an external crystal oscillator is used.
For time-loss retention, VBAT is separately brought out and powered by a reference voltage chip.
 
The charging circuit
uses the TP4057. The reason for choosing this chip is as follows:
The TP4057 is a constant current/constant voltage linear charger chip designed for single-cell lithium-ion batteries. The following is a detailed summary of the characteristics of the TP4057:

Package and pinout:

Common package types are SOT23-6 or SOT23-6L.
It has fewer external components, making it very suitable for portable products.


Charging Characteristics:

The charging voltage is fixed at 4.24V (or labeled 4.2V).
The charging current can be set via an external resistor, with a maximum charging current of 500mA or 600mA (depending on the version).
It uses C/10 charging termination, meaning the chip automatically ends the charging process when the charging current drops to 1/10 of the set value.


Temperature and Power Management:

It features intelligent thermal regulation, automatically reducing the charging current under high-power operation or high ambient temperature conditions to limit chip temperature.
When the input voltage is disconnected, the TP4057 enters sleep mode, and the battery leakage current drops below 1uA (or labeled 3uA, depending on the status).
In standby mode, the chip's quiescent current drops to 25uA or 40uA (depending on the version and status).


Protection and Safety Features:

Based on a special internal MOSFET architecture and reverse charging protection circuit, no external sense resistor or isolation diode is required.
Features include battery temperature monitoring, undervoltage lockout, and automatic recharge.
When the ambient temperature is too high, thermal feedback can adjust the charging current to reduce the chip temperature.


Status Indicators:

Features two open-drain status indicator outputs: CHRG (charging status indicator) and STDBY (battery charging complete indicator). CHRG is pulled low when the charger is charging; STDBY is pulled low when charging is complete.


Applications:

Suitable for portable devices such as mobile phones, PDAs, MP3/MP4 players, Bluetooth headsets, GPS devices, charging docks, digital cameras, and mini speakers.


Other Features:

Can directly charge single-cell lithium-ion batteries from a USB port.
Preset charging voltage accuracy reaches ±1%.
Supports two-lamp mode for clearer charging status.



In summary, the TP4057 is a powerful, safe, and reliable lithium-ion battery charger chip widely used in various portable electronic devices.
Charging via a TYPE-C interface is shown in the design diagram below.
Power Conversion Design
: Due to the unstable power supply voltage of lithium batteries, an LDO is used for conversion. The system requires 3.3V. Therefore, the XC6220B331MR-G was chosen. Details are as follows:
The XC6220B331MR-G is a power management integrated circuit (PMIC) manufactured by Torex Semiconductor, specifically a low-dropout linear regulator (LDO). The following are the detailed parameters and characteristics of the XC6220B331MR-G:

Basic Parameters:

Manufacturer: Torex Semiconductor;
Product Model: XC6220B331MR-G
RoHS Status: Compliant with RoHS 2011/65/EU (6 substances)
Lead Free: Pb-free
Product Status: Available for sale (Lifecycle Status: In production)


Electrical Characteristics:

Regulator Type: Positive, Fixed
Output Voltage (Fixed): 3.3V
Maximum Input Voltage: 6V
Maximum Output Current: 1A
Voltage Drop (Max): 0.655V @ 1A
Quiescent Current (Iq): 18 µA
Supply Current (Max): 108 µA
PSRR (Power Supply Rejection Ratio): 50dB @ 1kHz


Protection and Control Characteristics:

Control Characteristics: Enable
Protection Functions: Overcurrent, Over-temperature


Operating Environment:

Operating Temperature: -40°C ~ 85°C
Mounting Type: Surface Mount


Package and Dimensions:

Package/Case: SOT-25-5 (SC-74A, SOT-753)
Supplier Device Package: SOT-25


Other:

RoHS compliant, lead-free and environmentally friendly
packaging method is tape and reel The XC6220B331MR-G is a stable, well-protected 3.3V fixed output voltage low-dropout linear regulator
suitable for applications such as optical drives, disk drives, digital cameras/camcorders, and digital audio equipment . In summary , it is suitable for various applications requiring stable power supplies. The LDO conversion circuit is shown in the diagram below. The buzzer circuit uses an active buzzer QMB-09B-03, whose basic parameters are as follows, driven by PWM. The QMB-09B-03 is a buzzer manufactured by Jiangsu Huaneng Electronics (HNDZ). The following are the detailed parameters and characteristics of the QMB-09B-03: Basic Information: Device Model: QMB-09B-03 Device Category: Buzzer Manufacturer: Jiangsu Huaneng Electronics (HNDZ) Technical Specifications: Drive Method: Passive (External Drive) Construction Type: Electromagnetic Rated Voltage: 3V Operating Voltage: 2V~5V Frequency: 2.7kHz (or marked as 2700Hz) Sound Pressure Level (SPL): 85dB Physical Dimensions: Diameter (φD): 9mm Height: 5.7mm Package: Through-hole, D=9mm Other Parameters: Datasheet: PDF datasheet available for download Manufacturer's Website: http://www.huawha.com/ (Please note that the link provided here may need to be verified or updated based on actual conditions) Price and Stock: Price: Varies depending on the quantity purchased; please consult the supplier for specific pricing. Stock: A certain amount of stock is available in our mainland warehouse; please consult the supplier for specific stock levels. Applications: The QMB-09B-03 buzzer is widely used in various electronic devices that require sound cues, such as alarms, timers, and electronic toys. Please note that the above information is for reference only, and the actual product may vary depending on the supplier and production batch. When purchasing and using the product, it is recommended to consult the latest product manual and the supplier for accurate information. The relevant design is as follows: Note: D2 does not require soldering. The temperature and humidity sensor used here is the SHT40. The SHT40 is a high-performance temperature and humidity sensor launched by Sensirion, featuring low power consumption, high accuracy, fast response, and stable reliability. The following is a detailed introduction to the SHT40: I. Main Features High Accuracy: The SHT40 performs excellently in temperature and humidity measurement, with a temperature accuracy of ±0.2°C (typical) and a humidity accuracy of ±1.8%RH (typical). This allows the SHT40 to accurately monitor environmental changes, meeting the needs of applications with high accuracy requirements. Low Power Consumption: The SHT40 is optimized for power consumption, making it more suitable for low-power applications such as Internet of Things (IoT) devices and energy-sensitive systems. Its average current is only 0.4μA at a 1 Hz measurement rate, helping to extend the device's battery life. **Fast Response:** The SHT40 is optimized for response speed and sensitivity, especially in humidity measurement, enabling faster response times and quicker detection of environmental changes. Its relative humidity response time (tau 63%) is typically around 6 seconds. ** Stable and Reliable:** The SHT40 exhibits excellent long-term stability and incorporates enhanced internal self-calibration features. These features better compensate for sensor aging and temperature drift, maintaining high accuracy throughout the product lifecycle. ** Strong Anti-interference Capability:** The SHT40 boasts enhanced anti-interference capabilities, better resisting the effects of electromagnetic interference (EMI) and other environmental factors, ensuring reliable measurement results even in complex environments. **Technical Specifications :** The SHT40 is housed in a small QFN package, measuring 1.5 x 1.5 x 0.5 mm³, facilitating integration into various designs. ** Power Supply Voltage Range:** The SHT40 offers a wide power supply voltage range, from 1.08 V to 3.6 V, suitable for diverse power supply environments. ** Operating Range:** Temperature measurement range: -40°C to +125°C; Humidity measurement range: 0% to 100% RH. Communication Interface: The SHT40 features a true I2C interface, allowing for easy connection to microcontrollers or other processing devices using only two wires (plus a power wire and a ground wire). III. Application Scenarios: Thanks to its superior performance, the SHT40 is widely used in smart buildings, smart homes, weather stations, warehouse storage, and animal and plant farming. In smart buildings, the SHT40 can monitor indoor temperature and humidity, providing a comfortable living or working environment; in smart homes, it can control humidifiers, dehumidifiers, and other devices to maintain suitable indoor humidity; in weather stations, it can monitor atmospheric temperature and humidity, providing data support for weather forecasts. IV. Summary: As a high-performance temperature and humidity sensor, the SHT40, with its high accuracy, low power consumption, fast response, and stable reliability, has broad application prospects in the Internet of Things, smart homes, and environmental monitoring. With continuous technological advancements and market expansion, the SHT40 will continue to leverage its advantages, providing more accurate temperature and humidity monitoring solutions for various industries. Here, an I2C interface is used, sharing one interface with the display screen, as designed below: Display Screen





 








































































 
 

This uses a 0.91C monochrome LCD screen with the following performance characteristics:
The HS91L02W2C01 is a 0.91-inch OLED display from the HS (Hansheng) brand. The following are detailed parameters and features of the HS91L02W2C01:

Product Overview:

The HS91L02W2C01 is an OLED display using the I2C communication protocol, featuring a 4-pin black background and white backlight.
It is primarily suitable for various electronic devices requiring display functions, providing clear and delicate display effects.


Main Parameters:

Size: 0.91 inch;
Pixel Resolution: 128x32;
Interface Type: I2C;
Operating Temperature: -40℃~+70℃;
Gross Weight: Approximately 4 grams (g);
Packaging: Bagged;


Product Features:

High Performance: Utilizes advanced OLED technology, featuring low power consumption, high contrast, and fast response.
Wide Temperature Range: Can operate stably within a wide temperature range of -40℃ to +70℃.
Easy Integration: The I2C communication protocol makes the HS91L02W2C01 easy to integrate with various microcontrollers and processors.


Application Scenarios:

The HS91L02W2C01 is suitable for various electronic devices requiring display functions, such as smart meters, industrial control equipment, and medical devices.


Purchase Information:

Brand: HS (Hansheng)
Manufacturer Model: HS91L02W2C01
Product Number: C5248081
Inventory Status: 259 in Jiangsu warehouse, 67 in Guangdong warehouse, 67 in Guangdong SMT warehouse.
Price Information: Prices fluctuate depending on the quantity purchased. For example, the unit price is ¥13.77/unit for 1-10 units; the unit price is ¥8.33/unit for over 1000 units.


Additional Information:

Datasheet: The HS91L02W2C01 datasheet can be downloaded via the specified link for more detailed specifications and technical information.
Shipping and After-Sales Service: Fast shipping service is provided, and genuine product guarantee and material traceability are supported.



In summary, the HS91L02W2C01 is a comprehensive and stable 0.91-inch OLED display suitable for various electronic devices requiring display functions.
The interface is very simple, and the design is as follows:
Button design:
Physical buttons are used here, and anti-shake is required. The design is as follows . Other circuits
include:
Switch; Charging port;
Lithium battery power acquisition:
 
PCB design
: LCSC EDA is used for the design. Due to the small size of the board, batteries need to be installed.
The following issues need attention:
1- Component avoidance
2- Interface distribution
3- Installation design
. The overall design and routing are as follows.
A 4-layer board design is used here.
 
 
3D shell design:
LCSC EDA is used for the design.
The following issues need attention:
1- Reasonable height design
2- Accurate opening position
3- Reasonable screw size selection
4- Appropriate opening size
5- Accurate calculation of component mounting height.
 
The design is shown in the figure below:
 
The actual picture is as follows:
 
Panel design
: LCSC EDA is used for the design, which is very simple.
The following issues need attention:
1- Accurate hole opening
2- Back adhesive cutout
3- Aesthetic design 4- Appropriate
color scheme. As
an engineer, this is barely usable and is for reference only.
The design effect is as follows .
I didn't have a coupon, so I couldn't make it.
*5. Software part:

The software is developed based on Keil 5 and programmed in C language.
The main components are as follows:
1- The OLED driver
can be written according to the official driver manual.
The effect is as follows:
The main functions involved are as follows:
#define OLED_CMD 0 // Write command #define OLED_DATA 1 // Write data
void OLED_ClearPoint(u8 x,u8 y); void OLED_ColorTurn(u8 i); void OLED_DisplayTurn(u8 i)
; void I2C_Start(void); void I2C_Stop(void); uint8_t I2C_WaitAck(void); void I2C_Ack(void); void I2C_NAck(void); void Send_Byte(u8 dat); u8 Read_Byte(void);
void OLED_WR_Byte(u8 dat,u8 mode);void OLED_DisPlay_On(void);void OLED_DisPlay_Off(void);void OLED_Refresh(void);void OLED_Clear(void);void OLED_DrawPoint(u8 x,u8 y,u8 t);void OLED_DrawLine(u8 x1,u8 y1,u8 x2,u8 y2,u8 mode);//void OLED_DrawCircle(u8 x,u8 y,u8 r);void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size1,u8 mode);void OLED_ShowChar6x8(u8 x,u8 y,u8 chr,u8 mode);void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 size1,u8 mode); void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size1,u8 mode); void OLED_ShowChinese(u8 x,u8 y,u8 num,u8 size1,u8 mode); void OLED_ScrollDisplay(u8 num,u8 space,u8 mode); void OLED_ShowPicture(u8 x,u8 y,u8 sizex,u8 sizey,u8 BMP[],u8 mode); void OLED_Init(void); //void OLED_DrawREC(u8 x,u8 y,u8 w,u8 h);
 
Due to the limited main control flash, only 8x6 and 24x12 fonts are retained.
 
2- The sensor driver
must be written strictly according to the following specifications:
Note that the IIC address and the specific chip model must correspond.
The IIC read/write timing control must strictly follow the following:
Command as follows:
Data read verification:
 
3-Lithium battery power acquisition is
acquired through the chip's ADC.
DMA mode storage.
Timed acquisition, function as follows:
HAL_ADC_Start_DMA(&hadc1,(uint32_t *)(&(adc_value[0])),1);
Acquisition effect:
 
Here the power has a quantitative standard, found online:
Program implementation as follows:
4-Time setting:
RTC time setting and acquisition. Function as follows:
    HAL_RTC_GetTime(&hrtc,&myTime,RTC_FORMAT_BIN); sprintf(ss,"Time %02d:%02d:%02d",myTime.Hours,myTime.Minutes,myTime.Seconds); OLED_ShowString(0,8,ss,8,1);//6*8  
This needs to be saved by power off.
The results are verified as follows:
 
5- The LED light display
is controlled by PA2, as shown in the figure below.
6- The buzzer
is driven by PWM:
HAL_TIM_PWM_Stop(&htim1,TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_1);
 
 
 
 
 
Note: If your project involves software development, please upload the corresponding project source code as an attachment. Here you can explain in detail your software flowchart, functional module block diagram, explanation or popularization of relevant algorithms, source code structure, compilation environment setup and configuration, source code compilation method, program burning method, etc. It is recommended to introduce your ideas to others in a graphic and textual format.
 
*6.

Please enter the BOM list...



No.
Quantity
LCSC Price
Designator
Footprint
Value
Manufacturer Part
Manufacturer
Supplier Part
Supplier
 


1
1
0.675889
BUZZER1
BUZ-TH_BD9.0-P4.00-D0.6-FD
2.7kHz
QMB-09B-03
Huaneng
C96256
LCSC
0.675889


2
13
0.013981
C1,C4,C5,C6,C7,C8,C11,C13,C16,C18,C19,C20,C21
​​C0603
100nF
CC0603KRX7R9BB104
YAGEO
C14663
LCSC
0.181753


3
2
0.105541
C2,C3
C0603
10uF
CL10A106MA8NRNC
SAMSUNG (Samsung)
C96446
LCSC
0.211082


4
2
0.027184
C9,C14
C0603
12pF
CL10C120JB8NNNC
SAMSUNG (Samsung)
C38523
LCSC
0.054368


5
4
0.059151
C10, C12, C15, C17
C0603
4.7uF
CL10A475KO8NNNC
SAMSUNG (Samsung)
C19666
LCSC
0.236604


6
2
0.05112
D1, D2
SOD-323_L1.8-W1.3-LS2.5-RD
 
1N5819WS
Hottech (Hotech)
C191023
LCSC
0.10224


7
1
0.070826
LED1
LED0805-R-RD
 
KT-0805G
KENTO
C2297
LCSC
0.070826


8
1
0.124743
LED3
LED0805-R-RD
 
NCD0805G1
Guoxing Optoelectronics
C84260
LCSC
0.124743


9
1
13.77
OLED1
OLED-TH_L38.0-W12.0_HS91L02W2C01
 
HS91L02W2C01
HS (Hansheng)
C5248081
LCSC
13.77


10
1
0.246979
Q1
SOT-23-3_L2.9-W1.4-P1.90-LS2.6-BR
 
AO3401
TWGMC (Taiwan DGA)
C727156
LCSC
0.246979


11
1
2.94
Q2
SOT-25_L3.0-W1.6-P0.95-LS2.8-TL
 
XC6220B331MR-G
TOREX (TOREX)
C86534
LCSC
2.94


12
1
0.088502
Q3
SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BR
 
SS8050
CJ (Jiangsu Changdian/Changjing)
C2150
LCSC
0.088502


13
1
0.015448
R1
R0805
5kΩ
RTT055001FTP
RALEC (Wanquan)
C332873
LCSC
0.015448


14
3
0.005579
R2,R11,R12
R0603
10kΩ
0603WAF1002T5E
UNI-ROYAL (Housheng)
C25804
LCSC
0.016737


15
1
0.006057
R4
R0603
2kΩ
0603WAF2001T5E
UNI-ROYAL (Thick Sound)
C22975
LCSC
0.006057


16
3
0.005579
R5,R8,R10
R0603
 
0603WAF1002T5E
UNI-ROYAL (Thick Sound)
C25804
LCSC
0.016737


17
1
0.006179
R6
R0603
33Ω
0603WAF330JT5E
UNI-ROYAL (Thick Sound)
C23140
LCSC
0.006179


18
1
0.006141
R7
R0603
100kΩ
0603WAF1003T5E
UNI-ROYAL (Thick Sound)
C25803
LCSC
0.006141


19
1
0.006263
R9
R0603
1MΩ
0603WAF1004T5E
UNI-ROYAL (Thick Sound)
C22935
LCSC
0.006263


20
2
0.006472
R13,R14
R0603
4.7kΩ
0603WAF4701T5E
UNI-ROYAL (厚声)
C23162
LCSC
0.012944


21
1
0.13947
SW1
SW-TH_SK12D07VG4
 
SK12D07VG4
SHOU HAN (首韩)
C393937
LCSC
0.13947


22
3
0.213678
SW2,SW3,SW4
SW-TH_4P-L6.0-W6.0-P4.50-LS6.5
 
TS-1002-07026
XUNPU (迅普)
C455095
LCSC
0.641034


23
1
26.56178
U1
LQFP-48_L7.0-W7.0-P0.50-LS9.0-BL
 
STM32F103C6T7ATR
ST (STMicroelectronics)
C2054899
LCSC
26.56178


24
1
0.2464
U2
SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BR
 
TP4057
UMW (Yutai Semiconductor)
C725791
LCSC
0.2464


25
1
1.3016
U3
CRYSTAL-SMD_L3.2-W1.5
32.768kHz
FC31M2-32.768-NTLNNDTL
HCI (Hangjing)
C5120559
LCSC
1.3016


26
1
1.4835
U4
SOT-23-3_L2.9-W1.6-P1.90-LS2.8-BR
 
REF3030AIDBZR
TI (Texas Instruments)
C38423
LCSC
1.4835


27
1
0.478589
U5
HDR-TH_3P-P2.54-HF-W10.0-N
 
PM254-1-03-W-8.5
HCTL (Huacan Tianlu)
C2897385
LCSC
0.478589


28
1
11.24
U6
DFN-4_L1.5-W1.5-P0.80-TL-EP
 
SHT40-CD1B-R3
Sensirion (Switzerland)
C7461852
LCSC
11.24


 
 
 
 
 
 
 
 
 
Total:
60.881865



Note: Bill of Materials (BOM) list for the project. After generating/uploading the design files in JLCPCB EDA, the BOM will be automatically generated in the project details; it is recommended to include model number, brand, name, package, procurement channel, and purpose. The specific content and format should clearly express the project structure.
 
*7. Competition Logo Verification:

 
 
Please upload a project image containing the competition logo. The logo is silkscreened on the PCB.
Click the zip file to download the competition logo! (Competition Logo).zip
 
*8. Demo your project and record a video, then upload it

as shown in the attachment.
You can also watch it on Bilibili.
https://www.bilibili.com/video/BV1cGvUeXES8/?vd_source=e36622a05269c0356d6cd566056a2488
 
Video Requirements: Please shoot in landscape mode, with a resolution of at least 1280×720, in Mp4/Mov format, and a maximum file size of 100MB per video;
Video Title: LCSC Electronics Competition: {Project Name} - {Video Module Name}; e.g., LCSC Electronics Competition: "Autonomous Driving" - Team Introduction.
 
Go to view more details >
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-27 07:12:54

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号