Dummy electronic Load v2.0

Introduction:

Previous version of electronic load was good, but it had a small power dissipation capacity and without proper enclosure or display. So I decided to make a newer one in a grander scale.

Enclosure:

I am hands-on with electronics, but mechanical workmanship is something that I lack. So I try to take the easy way. For most projects that I had worked on, enclosure (or lack of) was the reason for abandoing them half the way. So, this time, I started with the solution for the hardest part.

I started looking into online stores for enclosure, but most of them are too expensive. Instead, consumer items like -- power stabilizer, solar chargers, battery chargers were cheaper. So I figured out a battery charger, with appropriate size and has fan and heatsink inside it. Following is the picture of the charger:

As you can see, the box is perfect sized and has oppening for cooling purpose. The price is way lesser than an enclosure for project purpose.

Inside the box, there are 2 heatsinks and a cooling fan that I can use for electronic load. There are nice mounting holes as well.

Removing the components for salvaging purpose:

Since the PCB was useless for me, I thought of salvaging the parts for my future use. Also, the bare PCB helps me in measuring the mounting-hole dimension, that I can use on my electronic load PCB.

Picture below shows the PCB of battery charger with all components removed:

Designing of schematic for electronic load:

  1. The schematic design consists of 2 identical branch to divert the current into two branches and increase the power dissipation capability.

  2. The transistor used is power BJT. I did not use MOSFET, as the BJT (bipolar junction transistors) are more suitable for DC current, unlike the MOSFET, which are mostly suitable for pulse current (refer to SOA curve of any MOSFET versus TIP122).

  3. Also, I used a power danlington transistor = TIP122, as the base current needed is pretty small.

  4. TIP122 is rated for 100V, so adequate for my need of 35V max.

  5. Used a MCP4921 12-bit DAC with TL431 Vref set to 2.5V. This is done to match the shunt resistor used. The 12-bit DAC set the current reference to be set.

  6. 2 pieces of shunt resistors used = 100milli Ohms.

  7. MCP6002 opamp for current control.

  8. Voltage measurement circuit (potential divider with diode protection). This is neeed, if we need to implement a constant-power control.

  9. 2 NTC are used for measuring the temperature of heatsinks.

  10. Simple transistor circuit for speed control of cooling fan (PWM).

  11. dsPIC33CK32MC202 is used for overall control. The dsPIC has 2 internal opamps, which are used for measurement of physical current. Hence, the current command is not just controlled via external opamp (MCP6002), but is also monitored (not controlled) via the internal opamps. Opamps are needed to scale the current measurement (I * shunt), to use the entire range of dsPIC ADC, which has a reference voltage of 3.3V.

  12. RGB LED for debugging.

  13. Being lazy, I did not make any cut-out on the enclosure for fixing a display of keypad. Indead, I fixed a bluetooth module (HC05) and decided to perform all control via python script.

Schematic:

Layout:

PCB fabricated:

Once the blank PCB arrived, it mounted inside the enclosure perfectly.

NTC with lugs:

For temperature measurement of heatsink, I procured these 10K NTC with 3mm lug mounting perfect for heatsink/ transistor temeprature measurement.

After receiving these parts, I did a basic test by measuring the resistance with room temperature, and it was indeed close to 10K.

And then, tested the resistance by holding the NTC in my fist, and the resistance indeed decreases.

Picture of complete assembled board (without BT module mounted):

Picture of electronic load inside enclosure (with BT module installed):

Description of dsPIC code:

Following are the logical steps followed in the code:

  1. Initialize peripherals -- oscillator, GPIO, SCCP3 (for fan speed control PWM), SPI (interfaceing with DAC), Internal opamps, ADC, UART, SCCP4 (for triggering ADC at 100Hz).

  2. ADC interrupt is generated at a rate of 100Hz. Inside the ISR, 5 ADC buffers are read -- current-1 and current-2 (optput of 2 internal opamps), DC bus voltage (voltage of power supply, which is to be loaded), temperature of NTC-1, temperature of NTC-2.

  3. In the main loop, the communication with python script happens over UART (via BT module HC05).

  4. Protocol used for communication is: Single unique ASCII character (command), followed by 5 digits (data), followed by '\n'. This simple protocol uses fixed length with no checksum or parity.

  5. Commands are of 2 types: -

    1. Write by python script -- examples are = setting the fan speed, setting the current command, glow red LED, green LED, or switch off the LEDs.

    2. Read by python script -- examples are = reading current-1, current-2, temperature-1, temperature-2, voltage

  6. Following is the code use for main loop:

Description of python code:

Python code does all the heavy lifting:

  1. It reads the raw values from dsPIC and converts the values to physical format:

    1. Receives the ADC measurement of voltage across each NTC, applies the non-linear equation for conversion of NTC resistance to temperature and displays the temperature in deg-C.

    2. Received current and voltage as raw ADC measurement and then converts to physical values by applying appropriate calculations.

    3. Also has the possibility of extending functions such as protection of electronic load, in case of over temperature, over current or running a constant temperature algorithm, by modulating the set current, based on measured temperature of heatsinks. Also, fan speed can be modulated based on temperature rise.

  2. Converts physical current to be set into 12-bit value, that can be used by dsPIC to send to MCP4921 to set the current.

  3. Log the data into excel sheet. Parameters to be logged are configurable in the code.

  4. Use the load as mAH meter for testing the battery capacity and plot the voltage/ current over time in excel sheet. This will be part of future enhancement.

  5. Presently, the output of python is on command prompt, but I am also working on a Tkinter based GUI for easy viewing and live plot of data.

  6. Python code queries the dsPIC board every 1 second (configurable, I have tested till 100mSec, but that is too much of redundant data).

  7. Following is the python code:

Demo video: