当前位置:网站首页>Design and manufacture of 51 single chip microcomputer solar charging treasure with low voltage alarm (complete code data)
Design and manufacture of 51 single chip microcomputer solar charging treasure with low voltage alarm (complete code data)
2022-04-23 13:00:00 【Outside Jinguan City】
The device uses solar panels to automatically supply power to lithium batteries from time to time , Simultaneous addition 51 Single chip computer through adc0809 Chip analysis of lithium battery power supply , And can carry out low-voltage alarm , Support two ways 5V1A Simultaneous discharge , Add three buttons , Support menu switching display and other functions . And the module data used in relevant design .
The module used :
STC89C51 Minimum system of single chip microcomputer
1602LCD
ADC0809 Analog to digital conversion chip
DC-DC Boost chip
Solar panels
Lithium battery charge and discharge management module
3.7V The lithium battery (1S)
A physical picture :
Solar charging module :
Boost module :
void Hardware_Init(void)
{
TMOD=0x02; // Set timer T0 Operation mode
TH0=216; // utilize T0 Interrupt generation CLK The signal
TL0=216;
TR0=1; // Start timer T0
ET0=1; // To configure adc0809
STR=0;
OE=0;
EA=1; // General interruption
delayms(50);
LcdInit(); //lcd initialization
for(i=0;i<14;i++)LcdWriteData(welcome[i]);
led_warn(); // Small light alarm
delayms(100);
LcdWriteCom(0x01); // Clear the screen
for(i=0;i<12;i++)LcdWriteData(instruction1[i]);
LcdWriteCom(0x40+0x80);
for(i=0;i<9;i++)LcdWriteData(instruction2[i]);
LED=1;
delayms(100);
}
/******************************************************************************* Function name : key_scan() work can : Key scan function *******************************************************************************/
uint update=0;
void key_scan(void)
{
if(KEY1==0)
{
delayms(5);
if(KEY1==0)
{
while(KEY1==0);
LcdWriteCom(0x01);
for(i=0;i<15;i++)LcdWriteData(I_Disp[i]);
update=1; // Turn on real-time update flag bit , Update in the main function
}
}
if(KEY2==0)
{
delayms(5);
if(KEY2==0)
{
while(KEY2==0);
LcdWriteCom(0x01);
update=0; // Turn off real-time update flag bit
LcdWriteCom(0x80);
for(i=0;i<12;i++)LcdWriteData(instruction1[i]);
LcdWriteCom(0x40+0x80);
for(i=0;i<9;i++)LcdWriteData(instruction2[i]);
}
}
if(KEY3==0)
{
delayms(5);
if(KEY3==0)
{
while(KEY3==0); // Additional tasks can be added
LED=!LED;
}
}
}
/******************************************************************************* Function name : battery_check() work can : Battery detection and alarm function *******************************************************************************/
void battery_check(void)
{
AD(); //adc Data analysis
if(update)
{
LcdDisplay();
delayms(4); // It is suggested to add delay , Otherwise, the two digits after the decimal point change too fast to see clearly
}
if(KEY1&&KEY2&&KEY3) // Due to the key pin and adc Pin time-sharing multiplexing , So when keys use pins , stop it adc Use
{
// otherwise adc The data is not accurate , Will affect the accuracy of the alarm
if(disbuff[0]<=3&&disbuff[1]<=2)led_warn();// Alarm function , Preset 3.2V
}
}
/******************************************************************************* Function name : main() work can : The main function notes It means : In the main function, due to the addition delay , Therefore, the key scanning needs to be pressed for a long time to respond ( Non interrupting key trigger ) *******************************************************************************/
void main(void)
{
Hardware_Init(); // System initialization
while(1)
{
key_scan(); // Key scan
battery_check(); // Voltage detection display 、 Call the police
}
}
This post is original !
Time :2021/01/
I wish good !
版权声明
本文为[Outside Jinguan City]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230613382926.html
边栏推荐
- BaseRecyclerViewAdapterHelper 实现下拉刷新和上拉加载
- XinChaCha Trust SSL Organization Validated
- Summary of JVM knowledge points - continuously updated
- Hanlp word splitter (via spark)
- Customize the shortcut options in El date picker, and dynamically set the disabled date
- 内核错误: No rule to make target ‘debian/canonical-certs.pem‘, needed by ‘certs/x509_certificate_list‘
- [daily question] chessboard question
- Record a website for querying compatibility, string Replaceall() compatibility error
- Go language mapping operation
- Kubernetes 入門教程
猜你喜欢
软件测试周刊(第68期):解决棘手问题的最上乘方法是:静观其变,顺水推舟。
[Blue Bridge Cup] April 17 provincial competition brushing training (the first three questions)
22. 括号生成
Software testing weekly (issue 68): the best way to solve difficult problems is to wait and see the changes and push the boat with the current.
The quill editor image zooms, multiple rich text boxes are used on one page, and the quill editor upload image address is the server address
mysql8安装
5 free audio material websites, recommended collection
Date time type in database
数据库中的日期时间类型
Use compressorjs to compress pictures, optimize functions, and compress pictures in all formats
随机推荐
Important knowledge of transport layer (interview, retest, final)
About the 'enum' enumeration type and structure.
Bert base Chinese Download (SMART)
decast id.var measure.var数据拆分与合并
Go language: passing slices between functions
Introduction to kubernetes
Homomorphic encryption technology learning
Object.keys后key值数组乱序的问题
Use compressorjs to compress pictures, optimize functions, and compress pictures in all formats
V-model binding value in El select, data echo only displays value, not label
Install nngraph
产品开发都应该知道的8个网站,增强工作体验
Remote access to raspberry pie at home (Part 1)
Importerror after tensorflow installation: DLL load failed: the specified module cannot be found, and the domestic installation is slow
SSM framework series - JUnit unit test optimization day2-3
Golang implements a five insurance and one gold calculator with web interface
Go language slicing operation
SSM framework series - data source configuration day2-1
Recovering data with MySQL binlog
STM32 is connected to the motor drive, the DuPont line supplies power, and then the back burning problem