power supply :
The first is the input source of the power supply: USB interface or single-cell lithium-ion battery (3.7V input). Both power supplies are the most common power sources. In order to better manage the two, lithium batteries and USB are used at the input end of the power supply. Automatic switching circuit, which consists of a PMOS tube, Schottky diode and resistor, can do:
When USB and battery are connected at the same time, battery power supply will be cut off.
When USB is disconnected, switch back to battery power
The schematic connection is as follows
First of all, what needs to be paid attention to is the direction of the PMOS tube. The inflow direction of the battery power is indeed from D (drain) → S (source), which utilizes the body diode of the PMOS.
One-key on/off circuit : With the help of the on/off circuit, you can realize one-key on/off by pressing the button on the lower right. Press and hold for two seconds to turn on the phone, and then press it again to turn off. The schematic is as follows
// SDK函数
wifi_uart_service();
// 温湿度采集
temp=SHT2x_GetTempPoll();//获取SHT20 温度
Humi=SHT2x_GetHumiPoll();//获取SHT20 湿度
// 温湿度上报
mcu_dp_value_update(1,(long)temp*10); //温度数据上报,采集的 float 数据转换为 long;
mcu_dp_value_update(2,(long)Humi); //湿度数据上报,float 转换为 long ;
// 温湿度OLED显示
OLED_WS_DIS(temp,Humi);
void USART1_SendByte(unsigned char data)//单字节发送函数
{
while((USART1->ISR & USART_FLAG_TXE) != USART_FLAG_TXE);
USART1->TDR = data;
}
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