The final chapter of the Immortal Bird
Needless to say, the Immortal Bird series is my first successful project in open source, and it has also run through most of my college career. I have spent a lot of time and experience in this work. I would like to thank my senior brother Zi Xie and all the friends who helped me!
This time, Immortal Bird and New are based on this project in Lichuang Kaiyuan Plaza [ CH32V_PD ] - mainly the OPA part and the current detection part.
——Cavendish Monster 2022.11.22
| parameter | value | unit | source |
|---|---|---|---|
| Input voltage | 8-26 | V | INA199 maximum voltage withstand voltage 26V |
| Output maximum current | 12 | A | 3.0 / 50 (β) / 0.005 = 12A |
| Theoretical maximum power | 312 | W | 26*12 = 312 |
| Recommended power | 96 | W | 12 * 8 = 96 |
| 5V output power | 15 | W | 5 * 3 = 15 |
| No load power consumption | 0.2 | W | |
| Current detection accuracy | 0.0032 | A | 12/[3/3.3 * 4096] = 0.0032A |
| Overload protection time (short circuit) | 1 | ms | |
The input voltage divider circuit maximum read 3.3*(10 + 1.5) / 3.3 = 25.3v
5S lithium battery max = 5 * 4.2 = 21v
The self-locking circuit starts with one button, and the loss when closed is almost 0.
Battery identification: If the connected device is an integer multiple of 3.7V - 4.2V, then it can be considered as a lithium battery. If the multiple is 2, then it is considered as a 2S battery, 3 times that is 3S battery. If it is recognized as a lithium battery, the corresponding minimum voltage drops out during use, and the over-discharge protection will be activated ( switching off the system ). For example: [Example 1]
Current detection: Use the difference signal of the sampling resistor to amplify the INA199 by 50 times and output it to the MCU and other ICs. For example: [Example 2]
Current hardware overload protection: Use the current signal detected by INA199 to compare it with a reference voltage of 3.0 in LMV358. If the current signal is greater than 3.0V, the op amp output is low ( switching the system off ).
Current software overload protection: Using the current signal detected by INA199, the MCU's ADC is used to read the voltage value into the program, and compare it with the maximum current value set by the program (the MCU outputs the low level to shut down the system ).
Temperature protection: Thermistor-built temperature and output voltage are positively correlated. Use the MCU's ADC to read the voltage value into the program and compare it with the maximum temperature set by the program (the MCU outputs the low level to shut down the system ).
DC-DC: The VCC output from P-mos is reduced to the TPS5450 to a fixed 5V, and is used for IC power supply and output.
USB-OUT output: plain output 5V (provided by DC-DC).
Display: LCD full color screen.
Communication: Can be used as a slave IIC for other devices.
//【例1】
#define Bat_min 3.7
#define Bat_max 4.2
float vol = 11.7 ; //假设获取到电池电压是11.7
char Bat_S ;
int temp = vol / Bat_min ;
if ( Bat_max * temp >= vol )
{
Bat_S = temp ;
}
else
{
Bat_S = 0 ;
} //【例2】
#define RES_Sample 0.005 //采样电阻是0.005欧姆
float Vol = 2.4 ; //假设获取到运放后面的电压是2.4
float Source_Vol = Vol / 50 ; //因为运放的倍率β固定是50倍
float Elec = Source_Vol / RES_Sample ; //真实电流值
//计算结果为 9.6ARipple diagram