ATtiny814 Power Analyzer

1 year ago 2254
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

Description

1. Overview

The Power Analyzer is a programmable electronic constant current dummy load with two high side voltage and current sensors for an automatic analysis of power supplys, DC/DC converters, voltage regulators, batteries, chargers, power consumers and others. The device can be controlled via USB serial interface using a serial monitor or the provided Python skripts. Data can be exported to spread sheet programs or directly be analyzed by the Python skript.

Project Video: https://youtu.be/q4-aywmeqHs

IMG_20200418_124716_x.jpg

2. Working Principle

The ATtiny814 controls the electronic dummy load with its internal digital to analog converter (DAC). All of its 5 internal reference voltages are being used in order to get the maximum accuracy and resolution of the DAC. The DAC is connected to an OpAmp which acts as a unity gain amplifier controlling the resistance of the MOSFET. Voltage and current are measured via a high side 8 mOhm shunt resistor connected to an INA219 with a resolution of 4mV/1mA. A second INA219 is connected to another 8 mOhm shunt resistor between the PWR-IN and PWR-OUT terminal. The Power Analyzer is connected via USB to a PC or a RaspberryPi. Commands to the Analyzer can be sent via a serial monitor or by the GUI-based Python skript. The Analyzer has different built-in automatic test algorithms. The collected data is sent back via the serial interface/USB to the PC/RaspberryPi. The ATtiny814 constantly measures power and temperature of the heatsink. It controls the fan and cuts off the load when the temperature gets too hot.

analyzer.png

3. Test Algorithms

  • Using a serial monitor: Test algorithms can be started by sending the corresponding command via a serial monitor. The collected data will be displayed in the serial monitor and can be exported to a spread sheet program for further analysis.
  • Using the GUI-based python application: This is the easy way. Everything should be self-explanatory. All following example pictures are created by this application.

Load Test

PA_load.png

  • Command: "l maxloadcurrent[mA: 17..5000] minloadvoltage[mV: 0..26000]"
  • Example: "l 2500 4200"
  • The Power Analyzer continuously increases the load from 17 mA up to maxloadcurrent. It stops automatically if the voltage drops below minloadvoltage. It continuously transmits the measured values via the serial interface in the format: current[mA] voltage[mV] power[mW] (seperated by the SEPERATOR string).

Powerbank_load_x.png

Voltage Regulation Test

PA_load.png

  • Command: "g maxloadcurrent[mA: 17..5000]"
  • Example: "g 3000"
  • The Power Analyzer changes rapidly the load between 17 mA and maxloadcurrent. It continuously transmits the measured values via the serial interface in the format: time[ms] current[mA] voltage[mV] (seperated by the SEPERATOR string).

FP6277_regulation_x.png

Efficiency Test

PA_efficiency.png

  • Command: "e maxloadcurrent[mA: 17..5000] minloadvoltage[mV: 0..26000]"
  • Example: "e 4000 2500"
  • The Power Analyzer continuously increases the load from 17 mA up to maxloadcurrent. It stops automatically if the voltage at TEST-IN drops below minloadvoltage. It continuously transmits the measured values via the serial interface in the format: current[mA] voltage[mV] efficiency[% * 10] (seperated by the SEPERATOR string).

MP2307_efficiency_x.png

Battery Discharge Test

PA_battery.png

  • Command: "b maxloadcurrent[mA: 17..5000] minloadvoltage[mV: 0..26000]"
  • Example: "l 1000 2700"
  • The Power Analyzer sets a constant current load of maxloadcurrent. If the voltage drops below minloadvoltage it constantly decreases the load to maintain minloadvoltage. It stops automatically if the load current drops to 0mA. It continuously transmits the measured values via the serial interface in the format: time[s] current[mA] voltage[mV] capacity[mAh] (seperated by the SEPERATOR string).

discharge_x.png

Long-Term Multimeter

PA_multimeter.png

  • Command: "m interval[ms: 2..65535] duration[s: 1..65535]"
  • Example: "m 18000 18000"
  • The Power Analyzer measures voltage, current and power delivered to the test device at every interval for a total of duration. It continuously transmits the measured values via the serial interface in the format: time[ms] current[mA] voltage[mV] (seperated by the SEPERATOR string).

TP4056_charge_x.png

Commands for Direct Control

Command Function
"i" transmits indentification string ("Power Analyzer")
"v" transmits firmware version number
"x" terminate current test program
"s loadcurrent[mA]" set load to a constant current of loadcurrent
"r" reset the load to minimum
"t" read current and voltage of both sensors and transmit them

4. Notes

  • Use a good heatsink with a 5V fan for the MOSFET! Attach a 10K 3950B NTC thermistor to the heatsink close to the MOSFET!
  • Be careful with high power loads! Make some tests to figure out what can be achieved with your cooling solution!
  • Due to the limitations of the cheap OpAmp the minimum load current is around 17mA. You can choose a better OpAmp if you like (must have same pinout, must be rail-to-rail and unity gain stable), but for most cases this is not necessary.
  • The maximum load current is 5A, however for small voltages it might be less.
  • The maximum PWR-IN/PWR-OUT current is 8A.
  • Do not exceed the maximum voltage of 26V on all connectors !
  • In order to make the design much simpler all connectors including USB share a common ground. Keep this in mind when making your test setup in order to avoid ground loops or shorts. Using a USB isolator between the Analyzer and your PC is not a bad idea!
  • Windows users may need to install a driver: http://www.wch.cn/download/CH341SER_ZIP.html. This is not necessary for linux users.
  • You need a UPDI programmer for uploading the firmware. You can find one in my projects (https://easyeda.com/wagiminator/y-updi-programmer) or you can use an Arduino as a jtag2updi. Further information can be found at https://github.com/SpenceKonde/megaTinyCore.
  • The Python skript was only tested on Linux, but it should also work on other operating systems.
  • The software is still in development. There might be some minor bugs. New functions and test algorithms will be added in the future.

5. License

license.png

This work is licensed under Creative Commons Attribution-ShareAlike 3.0 Unported License. (http://creativecommons.org/licenses/by-sa/3.0/)

Documents

Power Analyzer

PowerAnalyzer_v1.0

BOM

ID Name Designator Footprint Quantity BOM_Manufacturer Part BOM_Supplier BOM_Supplier Part
1 47u C2 1206 1 1206F476M160NT LCSC C30300
2 100n C1,C3,C4,C6,C7,C8,C9,C10 0603 8 CC0603KRX7R9BB104 LCSC C14663
3 1u C5 0603 1 CL10A105KB8NNNC LCSC C15849
4 SS54 D1 DIODE-SMA(DO-214AC) 1 SS54 LCSC C123946
5 1N4148W D2 DIODE-SOD-123 1 1N4148W-E3-08 LCSC C241939
6 Header EXPANSION,I2C HDR-4X1/2.54 2 220S-1*4P H=8.5MM Ytype Gold-plated LCSC C124413
7 Header FAN,NTC HEADER_2X1 2 826629-2 LCSC C86471
8 KF301-2P PWR-IN,PWR-OUT,TEST-IN KF301-2P 3 KF301R-5.0-2P LCSC C474883
9 IRL540NPBF Q1 TO-220-3_L10.0-W4.5-P2.54-T 1 IRL540NPBF LCSC C111607
10 SI2302 Q2 SOT-23_L2.9-W1.3-P0.95-LS2.4-BR 1 SI2302 LCSC C344009
11 1k R2,R3,R4,R5,R6,R13 0603 6 0603WAF1001T5E LCSC C21190
12 R300 R7,R8,R9 2512 3 CR2512F0R3E04 LCSC C176052
13 10k R10,R14,R15 0603 3 0603WAF1002T5E LCSC C25804
14 4k7 R1,R11,R12 0603 3 0603WAF4701T5E LCSC C23162
15 1k5 R16 0603 1 0603WAF1501T5E LCSC C22843
16 R008 R17,R18 2512 2 MRF6432(2512)LR008FTS LCSC C76241
17 LED BUSY,PWR,RDY LED-0603 3 19-217/BHC-ZL1M2RY/3T LCSC C72041
18 ATTINY814-SSN U1 SOIC-14_150MIL 1 ATTINY814-SSNR LCSC C182202
19 CH330N U2 SOP-8_150MIL 1 CH330N LCSC C108996
20 LMV321 U3 SOT-23-5_L3.0-W1.7-P0.95-LS2.8-BL 1 LMV321B-TR LCSC C248567
21 INA219 U4,U5 SOT-23-8 2 INA219AIDCNR LCSC C87469
22 Header UPDI HDR-3X1/2.54 1 Header2.54mm 1*3P LCSC C49257
23 USB-B-Female USB USB-M-49 1 USB-B-Female-90-TH LCSC C46393

Attachments

Filename Download
PowerAnalyzer_firmware_v1.0.zip
Success
The owner does not allow comments in this project now

Comments (2)

UserSupport Reply

Good sharing, many thanks. :)

Stefan Wagner Reply

@UserSupport You're welcome!

goToTop
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow