By pressing the "Disconnect" button the serial interface is closed down and then the thread stops because the accessed resource is missing. I used the python module "thread" which is able to execute functions as a separate thread. The above named thread is executing an endless loop which is not able to terminate itself. The parameters "current current" and "used capacity" is additionally shown via progress bars.īy pressing the "GetData" button a separate thread is stared which communicates with the monitoring board (via UART-TTL). The data provided by the board is displayed via labels. Then I wrote a Python App with a tkinter GUI to display the data on my computer. ![]() GUI for Data evaluation and visualization If serial data is available, the function will execute the contained code and then continue with the "void loop()". This function is called every time "void loop()" is at its end and checks wether there is serial data received by the UART. The serial port handling is not really done with an interrupt, it is done with the "serialEvent" function. Is the max capacity taken out of the battery, a warning signal is going to play. ![]() Then the software totals the measured values and compares this to the batteries capacity. The value returned by measuring one time per second (assuming that the current will not change that fast) is treated as mAs (mA*second) and is transformed into mAh by the ♜ firmware. Then I used the ♜ (with C++/Arduino language) to record the voltage the current sensors output is connected to one of the ATmega’s 328 adc inputs. The current sensor I used (INA169 on a breakout board) returns a voltage between mV. The batterie's balancer connector is plugged into the "Lipo-Cell-Input", the current sensor is plugged into "I-Sensor-Input". I decided not to solder a sensor to the board because depending on the application the max current is different.
0 Comments
Leave a Reply. |