当前位置:网站首页>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
边栏推荐
- CVPR 2022&NTIRE 2022|首个用于高光谱图像重建的 Transformer
- Plato farm - a game of farm metauniverse with Plato as the goal
- World Book Day: I'd like to recommend these books
- decast id.var measure.var数据拆分与合并
- 4.DRF 权限&访问频率&过滤&排序
- 云原生KubeSphere部署Redis
- Timing role in the project
- C, calculation code of parameter points of two-dimensional Bezier curve
- 22. 括号生成
- Common problems of unity (1)
猜你喜欢

MySQL supports IP access

产品开发都应该知道的8个网站,增强工作体验

STM32 project transplantation: transplantation between chip projects of different models: Ze to C8

风尚云网学习-input属性总结

Custom nail robot alarm

4.DRF 权限&访问频率&过滤&排序

梳理網絡IP代理的幾大用途

98. Error s.e.errormvcautoconfiguration $staticview reported by freemaker framework: cannot render error page for request

CVPR 2022 & ntire 2022 | the first transformer for hyperspectral image reconstruction

Importerror after tensorflow installation: DLL load failed: the specified module cannot be found, and the domestic installation is slow
随机推荐
Go language array operation
leetcode-791. 自定义字符串排序
Web17 -- use of El and JSTL
The continuous construction of the Internet industry platform is not only able to collect traffic
JDBC connection pool
有趣的IDEA插件推荐,给你的开发工作增添色彩
World Book Day: I'd like to recommend these books
Luogu p3236 [hnoi2014] picture frame solution
Introducing vant components on demand
leetcode:437. 路径总和 III【dfs 选还是不选?】
云原生KubeSphere部署Redis
使用Source Insight查看编辑源代码
XinChaCha Trust SSL Organization Validated
ZigBee CC2530 minimum system and register configuration (1)
Unlock openharmony technology day! The annual event is about to open!
内核错误: No rule to make target ‘debian/canonical-certs.pem‘, needed by ‘certs/x509_certificate_list‘
风尚云网学习-h5的input:type属性的image属性
BUUCTF WEB [BUUCTF 2018]Online Tool
[daily question] chessboard question
Record some NPM related problems (messy records)