TinyLoad – Simple Electronic Load based on ATtiny45/85
TinyLoad is a simple electronic constant current dummy load. The ATtiny measures voltage, current and temperature of the heat sink, calculates power, energy and battery capacity, controls the fan and displays all relevant data on the OLED. The button is used to switch between power/resistance and energy/capacity display.
The electronic load control circuit, which essentially consists of a potentiometer, an operational amplifier, a MOSFET and a shunt resistor, ensures that the same current flows regardless of the voltage applied.
For this purpose, a 100 milliohms shunt consisting of three 300 milliohms resistors in parallel for proper heat dissipation is located in the load circuit, via which the current is measured. The LMV358 rail-to-rail OpAmp compares this with the target value, which is specified via a 10-turn 10k potentiometer and a 100k resistor and accordingly controls the gate of an IRL540N logic level power MOSFET, which in turn adjusts the current through its internal resistance set in this way. The current measured at the shunt is also amplified by a second OpAmp and measured by the ADC of the ATtiny. The voltage is measured using a voltage divider. The temperature of the MOSFET is measured by a 10k 3950B NTC thermistor. If necessary, the fan is switched on via a MOSFET.
For the most accurate measurement possible with maximum measurement resolution, both the 5V supply voltage and the two internal reference voltages in connection with the ADC of the ATtiny are used. First, the supply voltage and the 2.56V reference are measured using the 1.1V reference and corresponding calibration factors are calculated. For each pending measurement, it is first checked which of the three voltage references (5V, 2.56V or 1.1V) is most suitable. This is then used for the measurement via the ADC. For all ADC measurements, the ATtiny is set to sleep mode in order to avoid noise that is generated by the MCU (ADC noise canceler). To further increase the measurement resolution, 64 measurements are carried out in succession (oversampling) and the measured values are added up. The averaging is only carried out at the end of the further calculations in order not to lose any measurement resolution. The measurement accuracy depends essentially on the accuracy of the internal 1.1V reference. This can be calibrated manually if necessary.
- Project page on Github.com
- Design files in EasyEDA
- TinyCalibrator – OSC Calibrator and High-Voltage Fuse Resetter
- ATtinyCore Arduino Hardware Package
- AVRDude command-line program