This week, I will continue the development of this project by working on the coding for the battery indicator system, as I am responsible for managing this system. With a clear vision in mind, I began working diligently on the code, carefully planning each step of the process. The goal was to create a reliable and accurate battery indicator system to provide real-time updates on the battery's voltage and percentage.
I started by setting up the necessary variables and defining the input and output pins for the battery indicator components. The code must interact with the TP4056 battery charger module, the LiPo rechargeable battery, the I2C OLED display, the LED traffic light module, and the voltage divider circuit. Next, I focused on the logic of the code. The battery voltage was accurately measured and converted into a percentage value using appropriate conditional statements and mathematical calculations. This value would determine the battery level on the OLED display and the LED traffic light module. To ensure the code was robust and user-friendly, I implemented error-handling mechanisms. This allowed the code to handle unexpected situations, such as incorrect readings or communication failures, ensuring the reliable operation of the battery indicator system.
After countless days of coding, debugging, and testing, I succeeded. The battery indicator system flow was fully functional and provided accurate and real-time information about the battery's status. With a sense of accomplishment, I integrated the code into the mini-cleaning robot by making a circuit installation connecting all the components and observing the battery indicator system in action. However, as with any complex project, there were also some challenges. During the testing phase, I encountered an issue where the OLED display intermittently showed incorrect battery readings. The displayed voltage and percentage would fluctuate rapidly or display inaccurate information. Therefore, the troubleshooting process and the addition of IoT features will continue next week using the Blynk IoT platform.
No comments:
Post a Comment