Arduino based digital Interface for Power Supply

here is my custom made digital interface for an analog power supply with all informations needed to build it . Unfortunately only final pictures are available. The power supply is build around Atmega1284P-AU MCU with Arduino bootloader.


The Power Supply:

 I was looking few years ago for a simple power supply with current limiter and this one was my pick. It is 0-30V, 0-3A driven by a power transistor and regulated with op-amps as comparators.



It was one of my first things I build and is still working perfect. All I wanted is to add a digital interface. There is 2 of them for two independent channels.

Here it is:

 It has three boards. The power supply for all the electronics, The main Control Board and the board that is placed at the front with all LEDs, 7 segment displays and 128x64 GLCD.

 Power Board:





 Simple schematics copied from LM2576-5 datasheet. Whats on it:
230V is going from the mains switch through glass fuse on transformer 230/12V, the rectified and filtered. Small 7812 linear voltage regulator to power 12V FAN and LM 2576-5 PWM regulator to supply 5V for everything else. It has TC77  sensor on-board to monitor temperature (2Wire interface) and Mosfet for PWM driving FAN. Also LEDs to monitor if a voltage is present at the output. The relay is there for switching 230V output that powers the transformer for the 0-30V power supply. I had to add filter capacitors for the 230V (around 220nF with resistor across) to filter the peaks and the capacitor are sraight across the EuroSocket  L and N pins. Communication with relay, FAN PWM and TC77 is through the 5pin header. At full power consumption (all LEDs on) temperature reaches approximately 45 degrees Celsius. No heatsink is needed.

Front panel:




Front panel made to fit Aluminium case from Maplin. If you want to use it, you'll probably have to modify holes and placing of the GLCD display to fit your. I bought mine on eBay for €7.

Whats on it:
As mentioned before: 168x64 GLCD display with blue backlight, 6x common anode 7-segment display (2x3) for displaying voltage or current, 16 information LEDs to provide status, active channel, Limit reach, Voltage or Current mode driven by TLC5925, cutoff for USB female socket (connected to LM2576) used for charging or to power your Arduino, FTDI header for easy frogramming, can be used with LR6 bluetooth COM adapter. Rotary encoder with switch (24 "clicks" on 360degrees) and  five tactile swithces. Rotary  Encoder and switches are connected through 8-3 priority encoder reducing the amount of wires needed to 4 (Q0-2, GS). All the capacitors and resistors on the Q and GS lines were added later for precision and to get it to work on every turn.

Front panel printout: (printed on white sticky paper and laminated)
Created with GIMP and GIMP file is included for easy edit. Matches the holes for the front panel (exported from EAGLE)


Main Interface Board:



Something about the Control Boards:
The heart is AtMega1284P-AU microcontroller at 16MHz with original Mighty1284 bootloader (credits to OP). AtMega2560 (Arduino Mega) would be a better choice but is out of my manufacturing skills as the pins are too close together. To add more IO pins I reached for SN74CBT3245 bidirectional BUS drivers, therefore all ~CS or ~LE pins have external pullups. It has ICSP header for uploading the bootloader (I used Arduino UNO as ISP) and FTDI header on the front panel for further programming.
4 relays to control output of the channels (One for Voltage and second is shorting the output to set Max. Current)
MCP3428, 4 channel delta sigma ADC for acquiring the voltage readings (to sense voltage and current). It has 16 bit resolution (AtMega has onyl 10bit) and is able to do 15 readings / second
The precision is surprisingly good and with my prediction algorithm I was able to reach precision of +-1mA and +-1mV on the entire scale (roughly). I'll come back to that later.
1x AD5204  four channel 10k digital potentiometer  for coarse adjusting voltages and curent and 1x AD8402 two channel 1k potentiometer for fine adjustment of the voltages. That means:
256 x 256 step precision for voltage adjustment and 256 step precision for current adjustment.

Connectors clockwise:
- 5V in from PSU
- PSU communication (FAN PWM, TC77, relay for 2nd transformer)
- Heatsink connector (2x TC77 for monitoring temperature of the Power Transistor Heatsink)
- Front display & interface board connector, 2x Led above CH1 and CH2 to show if voltage is present at each channel
 - 2x interface connector for each channel of the 0-30V 0-3A poer supply

Note: On the power supply is used a TCP voltage reference at 2V for op-amps so the voltage can't go over pot working parameters (check datasheet before application). The current through the pots is in uA.

Some might ask why I didn't build a PWM power supply. Answer is simple: No adjustment from 0V, the speed isn't as good as on the analog (with the similar simplicity), short proof, speed, and the most important reason is:  I didn't want to.

Pictures of the assembled supply:

I lost all of my pictures from build due to HDD crash

Pictures of the supply running:

The Program:

Just a few highlights:
- When the channel is inactive, you can select voltage and current - adjustment is automatic and power supply will find the values itself (approximately 3 sec)
- It will keep fine-tuning the voltage when running until it will find value +-0.001V
- It is driven by op-amps = no voltage drop when the load is changed
- calibration data are stored to EEProm - the power supply is accurate as when you calibrate it
- Probability algorithm for non-linear range of the voltage / current (very low voltages & currents)
- Good accuracy
- LED tester - it can drive any 20mA (standard), 1W LED and 3W LED without resistor
- LED analyzer - it will measure voltage for different currents and then calulate resistors for Voltage requested (3.3V, 5V, 9V, 12V ...)
- Hardware Current Limiter
- Serial communication
- Driven by ONE encoder with push button


Because the MCP was messing with currents I had to connect grounds of the Left and right channel
 - this is to be solved as at this point it has a common ground and can't be used to deliver negative voltage
 - with high voltages and current - the readings are not filtered and the PSU is showing the ripple on the output (noise of the power supply, not the ADC)


Note: I managed to damage the background of the LCD itself, that why the right hand side is bleading a little bit . cleaning with solvent near LCD is really not a good idea :( 


Eagle files, Libraries, Arduino Code

16 komentářů:

  1. BTW this is my fourth electronics projects