ohahaha

# Fifth Lichuang Electronic Design Competition# Battery charge and discharge capacity tester

 
Overview

* 1. If you design independently, the latest schematics, original PCB files, software codes, and STM32CubeMX configuration projects will be announced. You can directly copy the reference design.

* 2. I have been working for almost 10 years and work overtime every day to make hardware, software, and WIFI-IOT. Everyone says that the hardest part is that engineers, especially R&D personnel, have too many things to worry about every day. Everyone knows this. The worst time to worry about batch problems caused by poor design is when there are batch problems in the production line. I worry to death that I can't sleep well, for fear that it is a problem with my own hardware.

3. This shows that the design stage is very important. In the past, every time I have a new project, I always look for solutions on the Internet, in QQ groups, forums, etc. I always want someone to help me look at my own. Is there something wrong with the schematic, but in reality? There are only a few people who have masters. Most of them rely on their own efforts little by little. In this design, I have posted a lot of very practical designs. Most of them have been used in actual projects. I will also give them to you. Let me explain my design ideas. Of course, this is just a temporary design for more than a month with the help of this Lichuang Electronics Competition. After all, it is normal for products that are not mass-produced to have defects. I will try my best to avoid them. I hope those big Guys, please show mercy.

4. I have wanted to make something for a long time, but I never have time to do it. I just used this competition to test the battery capacity because I have a lot of lithium batteries on hand, but some batteries lose a lot of capacity after being stored for a long time. , some capacity is not lost at all. In order to select these good batteries, this battery capacity testing instrument was designed.

5. Test various parameters such as battery capacity and charging time. Design a circuit board by yourself to measure: charged battery capacity, discharged battery capacity, charging time, discharging time, real-time charging current, real-time discharge current, and real-time voltage.

< br> [Please fill in during the competition stage↓]   1. Describe the project details. This project can test the charged battery capacity, discharged battery capacity, charging time, discharge time, real-time charging current, real-time discharge current, and real-time voltage of 1S lithium battery. . Then there are the discharge data of non-rechargeable batteries.   2. Describe the challenges faced by the project and the problems solved. This project encountered many problems at the beginning, of course they were all small problems and were solved one by one: (1) The first problem is TP4056 display problem: TP4056 indicator light problem:

image.png

After testing, it was found that only the last status was wrong. The phenomenon of this board was that the green light was on and the red light was slightly on. Later, it was found that it was caused by a problem with the circuit behind it.image.png

Not connecting the battery is equivalent to a resistor of tens of K connected in parallel to the battery, so there will be this situation. This can be ignored, as long as we know the problem.

image.png

(2) The second problem encountered is that the discharge current cannot be detected: in the first version of the design, only a detection resistor was placed at the charging place. As a result, it could only detect the charging current but not the discharge current. This is a low-level The error was not discovered at the time, as shown in the picture below:

image.png

The resistor R6 can only detect the current during charging. We can find that the left side of R6 is a positive voltage during charging, but the left side of R6 is a negative voltage during discharging (this microcontroller will definitely not be able to detect it). This obvious low-level error was ignored at the time. Later, I solved this problem by threading a detection resistor through the discharge end. As shown below

image.png

For PCB drawing, this is what I think. The first version can work normally if the repairs are made, and then the second version can work normally without any flying wires or the like. This is the most basic requirement. Otherwise, some leaders will look at you differently, hehe. Look at the picture below. The second version has been modified so that there will be no flying lines.

image.png

< br> (3) Another reason is that I was careless when drawing the picture and got the network label wrong. Alas, it resulted in another flying line. Of course, the second version must be corrected. These problems will not exist in the second version. .

image.png

(4) Another problem is that the digital tube on the top was placed upside down. It was only discovered during soldering that it was changed in the second version. The second PCB picture is posted below.

image.png

This 3D packaging comes with it. For me, after working for so many years, 3D packaging is completely useless. After the agency gives you the CAD drawing, you can just ask it for the height limit and other bytes.

(5) I encountered a very depressing problem that the TM1637 could not read the key values. This was very strange. Then I wrote a program using stm8l051 and it could read the key values ​​in one go, but when I switched to stm32f030, it did not work. It was very depressing. After working on it for a day, it didn't come out, so I stopped working on it. The second board used the microcontroller to directly read the buttons. Regarding this problem, when I was writing the second version of the program, I suddenly discovered that it turned out to be a problem with my program:image.png

It turned out to be such a simple question, alas! As a result, I searched for a day and couldn't find the problem, but I have read the second version with a microcontroller, so I will pay attention next time.

* 3. Describe the key points involved in the hardware and software parts of the project

< br> Hardware: 1. The key points involved are the detection of charge and discharge current, voltage detection, and digital tube display. The second version adds the functions of battery boosting and battery system power supply. Look at the KK4 switch. Turn it to the left to charge the battery, and turn it to the right to boost the battery voltage and supply power to the system.

image.pngME2159AM6G can still provide 12V2A discharge and has been used in mass production products. 2. Another key thing is that the VDDA of the microcontroller ADC uses REF3030, which has a super accuracy of 0.2%, but it is a bit expensive (the batch size is 2.1 yuan), hehe

image.png3. There is also a classic mos driver circuit that has been used in many of my products. I feel it is the most reliable and I would like to share it with you so that you can use it directly. See the picture below: image.pngThis is an absolutely stable classic that I started with. I learned it from a master craftsman, but I can’t find a good driver on the Internet. Some netizens have made optocoupler isolation + transistor + mos. I think it is completely useless for ordinary products. My circuit is fully qualified. No problem with this circuit has ever been seen among hundreds of thousands of products produced in mass production. 4. Next is the TM1637 driver circuit: image.pngThis TM1637 can be said to be relatively stable when used in my three mass-produced products, and the driver is relatively simple. I list the .C/.H files separately in my code, and you can copy them directly. It's ready to use. It's a simple and clear structure with no load. It's easy for beginners to understand. Of course, I'm mainly engaged in hardware and software, but I'm only part-time. Don't complain if you're a big guy. .

5. I have also considered the microcontroller for a long time and found that this is the most cost-effective STM32F030K6. The batch size is only 3.6, and the performance is still very strong. The hardware design also uses STM32CubeMX. This software is very comprehensive in terms of pin arrangement. It also automatically generates the initialization of the software. It is simply an artifact. This is the pin assignment of the microcontroller: image.pngSoftware aspect: 1. The software design is quite complicated and wastes a lot of time. The initialization is of course STM32CubeMX, which saves me a lot of time. The software project of STM32CubeMX will also be provided for everyone to modify. image.png2. After the software was generated, I added the tm1637 driver program, and then started programming. After several days of programming, it was best to complete a set of system charging tests. Currently, I only use one side of the test. 3. Another thing is that the AD detection must be set up, otherwise there will be occasional sharp waves or something. In addition, the whole system is quite complicated. You have to consider how to unplug the battery and start the cycle again. First of all, initialize and fully charge---"discharge---"then fully charge---"circle display. During the initialization process, the battery is fully charged first and then the start-up test is officially started (charging voltage and charging current are displayed during the period). In the second step, the battery is discharged to 2.8V (discharge time, discharge current, and discharge maH are displayed). In the third step, the battery is charged again. (Discharged time, discharged maH, charging current, charged maH, charged time), the fourth part displays the indicators of each stage in a cycle (discharged time, discharged maH, charged maH, charged time) . Added detection of battery removal midway in the first three parts. The picture below is the test data I made over the past few weeks, which shows that the consistency is quite good and can barely be used. image.png* 4. Project material list display

The materials for the project are all available to Jialichuang, and the PCB is also prototyped by Jialichuang. The BOM has also been uploaded and can be downloaded freely.

* 5. Upload project pictures

5.1. Pictures of the front and back of PCB (specially made with a big logo)

image.png

< br> image.pngThe following is a picture of the actual welded object:image.png

image.png

5.2. The files to upload other pictures of the project are image.pngimage.png* 6. Demonstrate your project and record it as a video for uploading

6.1. The official website of the video upload contest has been uploaded. 6.2. Video title and link of station B. Because the upload size of Lichuang website is limited, the time is not very long and the introduction is not very complete. I will introduce it in detail in the video link below. If you are interested Friends, you can take a look at the 5th Lichuang Electronic Design Competition: "Battery Charge and Discharge Capacity Tester" project - Mingming

https://www.bilibili.com/video/BV1xy4y1k78f?share_medium=android&share_plat=android&share_source=QQ&share_tag=s_i×tamp=1600441586&unique_k=V90q3m The 5th Lichuang Electronic Design Competition: "Battery Charge and Discharge Capacity Tester" Project - Mingming

https://www.bilibili.com/video/BV1FZ4y1N7xy?share_medium=android&share_plat=android&share_source=WEIXIN&share_tag=s_i×tamp=1600048934&unique_k=K6fwPN < br> < br> < br> < br>

* 7. Whether it is released to the public for the first time

This is the first time that it has been released publicly through the Jiali Chuang Competition.

7.1. Please indicate whether the project has been published or won awards before.

< br> This is my first design and has never been published online.

< br> 7.2. If the project is optimized on the original basis, please explain the optimization part

< br> Designed and released for the first time.

< br>

* 8. Open source documents

I can find the BOM of the chip in my accessories, and I can find the chip manual in Jialichuang.

* 9. References

I did not refer to any literature, I designed it based on my own experience. If there is any, it is analog electronics and digital electronics that I studied in school before (referred to as analog electronics and digital electronics).

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-15 04:15:21

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号