For example in the GIS-Pi project, every minute I am recording the battery power being used and it logs the data to a CSV file. When the script notices that a suddenly the battery voltage is much higher than before, a python script is called and uses matplotlib to plot a line graph of the battery performance over time. I thought it would be a neat method of automatic tracking battery deterioration of time.
Yes, there are many people popping up on Hack-A-Day who have done something like this before, but I wanted to build my own. This is based on a spare Raspberry Pi B that I had lying around and has been a nice weekend project. Rough BOM:
- 1 x Adafrout INA219 i2c based voltage/current sensor board
- 1 x dx.com SSD128x32 i2c based OLED display
- 1 x MTP3055VL MOSFET
- 1 x opto-isolator
- 4 x 100 ohm resistors
- 2 x 10K ohm resistors
- 1 x push switch
- 1 x red LED
- a few 10 ohm 50W load resistors
Here is the circuit diagram:
Of course I first started with a breadboard circuit to test it all out:
Then I moved it all onto a perfboard:
One initial issue I had was that I had the load resistor swapped around with the MOSFET. This caused it to not turn on properly, and get very hot. With Stephen's IR camera, I tracked it to over 100 deg. C before chickening out and turning the load off.