Hello madires, indman, other members,
I am proposing addition of a Power Monitor hardware option that I have built to the main build. First of all thank you for maintaining the project and keeping such an active community around the project.
I had built a component tester and besides testing components, I also use it often to measure power consumption of devices running at different voltages. To do this, I had builtin a DCDC boost circuit on my tester. Recently, I added an INA226 module to my tester. INA226 is a popular and highly accurate shunt resistor based voltage (0-36V) and current measurement IC. It talks over I2C and, the option presented here, fully integrates with the Component Tester build on 328p. The Power Monitor menu item that I added displays 4 lines on the page - Battery Voltage, VOUT, IOUT and Power. The availability of this INA226 module seems good
https://www.aliexpress.us/item/3256807703253714.html and it can easily be added to a tester using only 4 connections - SDA, SCL, 5V and GND. Power to Shunt and Load can be externally supplied.
Functionality of Power Monitor Menu Item -
- Displays measured VOUT, IOUT and Power on lines 2, 3 and 4, respectively
- Value units automatically switch between V/A/W and mV/mA/mW
- Buzzer beeps if Power crosses a preset threshold. Single Test Button press
will disable/enable the beeps
- Displays Battery voltage on line 1
- If TP_LOGIC ADC is defined and it measures a voltage then first line changes
to Voltmeter until the voltage is present across Logic Probe resistors
- Long press will zero out current IOUT value until device power-off
- Displays negative current and power values as well. Voltage can only be positive
Memory consumption of Power Monitor Menu Item = 1936B Program + 4B Data
I have fast-forwarded my build over to 1.54m firmware. Attached are pictures of how the Power Monitor Menu looks at end of this post.
My build is here:
https://github.com/pk17r/Ultimate_Tester/tree/prash/ComponentTester-1.54m/FilesI have added writeup to readme "INA226 Power Monitor (hardware option)" here
https://github.com/pk17r/Ultimate_Tester/blob/bcab0b34073d7272fe1bae77c265b6b5dcac8bf3/ComponentTester-1.54m/Files/README#L2188I am also showing a comparison of which files have been modified.
Differences of my build with 1.54m for Power Monitor Option are:
- config.h: #define INA226_POWER_MONITOR // to enable or disable the Power Monitor option
- functions.h: added 3 functions for INA226 and function for Power Monitor menu item
- INA226.c: the C file for INA226, a modified form of open source Arduino Library created by Rob Tillaart with license attached
- Makefile: add INA226.c to build objects
- README: add INA226 Power Monitor (hardware option) description
- tools_misc.c: add Power Monitor Menu Item Function
- user.c: add Power Monitor Menu Item
- var_english.h: add strings used by Power Monitor option
- variables.h: add strings used by Power Monitor option
Other differences v/s 1.54m on my build, not relating to Power Monitor option:
- config.h: #define MAINMENU_AT_POWER_ON // to go to Main menu at startup
- main.c: skip to main menu at startup when MAINMENU_AT_POWER_ON option is enabled
- config.h: #define SW_MENUITEM_TEST_COMPONENT // to display a menu item "Test Component" at top of main menu, replaces "Exit" menu item at bottom of main menu
- user.c: add SW_MENUITEM_TEST_COMPONENT menu item
- main.c: add SW_MENUITEM_TEST_COMPONENT test component re-direct
- font_8x8_vf.h: add example of how to make number 2 and add external power symbol
- font_8x12t_win1251_vfp_h: correct example of how to make number 2 and add external power symbol
- font_8x16_vfp.h: add external power symbol
What do you think?
Thanks,
Prashant