Professional Documents
Culture Documents
EE-494
Group# 16A
Group Members:
1.
2.
3.
4.
5.
Mohd Khan
Emran Nur
Naved Akhter
Boson Ruan
Jianfeng Sun
Contents
I.
Introduction .......................................................................................................................................... 3
II.
III.
A.
B.
C.
Prototype ....................................................................................................................................... 17
I.
I.
Introduction
A DC power supply is typically used to power-up electronic circuits for testing and
diagnosis. The traditional DC power supply uses the AC power supplied by a wall outlet in order
to provide the user-desired DC voltage output. However, this AC input requirement makes testing
of electronic circuits on the go more difficult, where AC wall outlet is not readily available. The
ultimate goal of this project is to build a DC power supply that is powered by a typical USB 2.0
port found in commonly used devices such as laptops or any devices with USB slots. This USB
DC power supply will provide DC output according to user-defined parameters, thus, making
testing of electronic circuits on the go convenient for the user. Users will most certainly will be
able to take advantage of the portability of a DC power supply, which works as similar as the one
at an electronic lab.
II.
Project Design
*The terminologies USB 2.0 Type B and USB are used interchangeably.
Concept 1
Concept 1 was to use a 555 timer to convert DC voltage to AC voltage. The pin configuration
and the function of the circuit is given in Figure 1, 2 and 3
Pin 2 and 6 get triggered itself and capacitor C1 charges through R1+R2 and R4 gets discharged
and output a 5VAC V (p-p) output and connects with a step-up transformer to achieve 10V. After
observing unstable output voltage from circuit simulation using NI Multisim software it was
decided not further proceed with concept 1. Apart from maximum current supply of 50mA there
are lot of loss within the system. [3]
Concept 2
Two of DCP020XXP ICs will take the power input from USB 2.0 Type-B and produce a
dual unregulated output of positive and negative voltage. The layout of a DCP020XXP IC is PDIP
with a total of 7 Pins. The output was connected with two voltage regulator in order for the voltage
to evenly distributed and attain two isolated constant voltage. After the implementation and
multiply attempt of regulating the voltage using voltage regulator the isolated voltage came out to
be +5V and -5V. However the isolated voltage was not persistent.
The following steps describe the working of DCP020XXP IC: 1. An oscillator takes the DC voltage input and converts it to AC voltage of 800 kHz
frequency.
2. The output of the oscillator follows a divide by-2 block to produce 400 kHz AC
voltage.
3. A three-terminal transformer is connected with the power controller as well as two
diodes to convert the stepped-up AC voltage to unregulated DC voltage output.
Finally, there are three pins +VOUT, COM and VOUT that are connected with two
positive/negative voltage regulators. A positive voltage regulator is connected with +VOUT to
LM337 to get +10V. On the other hand, VOUT will be connected with the negative voltage
regulator LM317 to get -10V as the output of the power supply COM is common in both the
positive and negative output pins. Later on a combination of relays and IC switch will be
implemented to have controlled output values.
Concept 3
The gradual difference on the isolated voltage along with other technical challenges with the
previous concepts directed to choose concept 3. This concept is to use a flyback regulator, which
is not only designed to boost the output isolated voltage but also to adjust it at the same time [1].
LM2587 flyback regulator has a unique feature that perform as enhanced regulator than any other
boost or buck regulator in the market. Along with the flyback regulator there are six sub concepts
that were being implemented to reach the final goal. The main properties of this concept are
i.
ii.
iii.
iv.
v.
LM2587-flyback regulator
Single step-up Flyback transformer
Positive and negative voltage regulators
LCD display with MCU
Solid state relays for protection
Voltage
Regulation
Max.
Voltage
Peripherals
Drawbacks
More
Maximum current
output is only 50mA.
II. Poor loading effect
III. Complicated setup
15.00V
DCP020XXP IC
I.
10.00 V
More
II.
Unregulated voltage
Significant drop of
voltage when load is
attached
Negative
Feedback
Regulator
Maximum voltage
does not exceed 12.00
V using a single
flyback transformer.
However, voltage can
be further increased
using a series
transformer.
I.
12.00 V
Less
Please note that a test bench DC power supply in lab was initially used for testing the designs until
the final prototype is fully developed for the purposes of getting accurate measurement of the
voltage and current limit of a USB female port so as to prevent USB port damage while testing
prototype circuit. Moreover, it also provides a wide range of power than the actual USB to fully
test the circuit for overvoltage, overcurrent protection.
III.
Progress Summary
A USB 2.0 Type B connection from any portable device will provide a maximum of 5V at 500mA
(P = 4.5W MAX) to the USB based Power supply unit. The power supply unit produces two
isolated voltage outputs of 12.00 VDC. The voltage can be adjusted by the user using a precision
potentiometer connected to the positive and negative voltage regulators for a stable positive and
negative output. A microcontroller unit of ATMEL328U based Arduino is used to for user
interface and circuit protection of the PSU. Furthermore, two solid-state relays are used to provide
an interface between the microcontroller unit and the PSU circuit. Moreover, the MCU is used in
order to ensure the overall circuit protection and an operating circuit for the user to power
electronics circuits for the purposes of testing on the go.
A. Circuit Design
Power Supply to the Main Circuit Via USB Connection
Connection from any portable devices with USB 2.0 Type B port will attach to a simple circuit
board that consists of the following parts [2]
Parts Description
USB 2.0 type B connector
TO-220 Voltage Regulator (LM317
1.5A max current)
PTC Resettable Fuse
100uF 35V Capacitor
10uF 25V Capacitor
0.1uF 50V Capacitor
Power LED
SPDT Slide Switch
0.1" Header Pins
330 Resistor 1/6W
390 Resistor 1/6W
240 Resistor 1/6W
Bare PCB with Silkscreen Indicators
Quantity
1
1
1
1
1
1
1
1
4
2
2
2
1
This integrated circuit is capable of delivering 5V with 500mA to the flyback regulator. Not only
it is capable enough to supply the required voltage and current, but also it can protect its own
circuitry with a resettable fuse. Careful action towards soldering each component is taken in order
to affix components onto the PCB board.
As the minimum requirement for this project is to achieve 10V, choosing LM2587 is certainly
ideal both in terms of power boost, regulation and protection. Only a few components such as
capacitors, diodes and single flyback transformer are required to obtain desired output. A 5V
power is supplied to LM2587 at port 5 from the USB power module. The switch port (port 4) is
the output of LM2587 which generates AC signal that is later stepped-up using a flyback
transformer. Feedback (port 2) is used to continuously monitor the output voltage for a stable
output. A small portion of the output is fed back to the chip that uses a comparator to measure the
changes and adjust accordingly.
LM2587 contains a feature when pin 4 (switch) is energized, there is a flow of current being
supplied to the primary side of the transformer in order to create a strong electromagnetic energy.
The primary winding of transformer is energized when the switch is turned-on by the internal
circuity of flyback regulator. As a result, voltage is induced in secondary winding due to
electromagnetic induction. The stored energy in the secondary winding get discharged through
two rectifying forward biased diodes to have two isolated output of 12.00 VDC. In order to
receive output of two polarities, D1 of figure 5 from the secondary side of the transformer is in
positive polarity and D2 in figure 5 is in negative polarity [1]. This diode setup generates 180
degrees out of phase output. The equation below justifies the operation behind the switch and the
output results.
&
Here max input is Vin (5V), Max out Vout , Ratio of the transformer turns N and VF is the output
voltage for the forward biased diode.
The LM2587 converts the DC input to AC output at 100 KHz frequency. The switch of the
LM2587 is turned-on and turned-off at the rate of 100,000 times per second to generate AC signal.
The AC signal is fed through fly back transformer to step-up the AC signal by ratio of 1:2.5
(5.0*2.5 = 12.0 V). The external current limit of 5A is set as the maximum switch current of the
device. The frequency of the AC signal drop from 100 KHz to 25 kHz when the output voltage
from the transformer drops to 75% of maximum output. The switch turns on initially with zero
current at its switch port (pin-4). In this condition, the switch current limit will limit the peak
current, saving the device.
10
The maximum power rating of a single Coilcraft Q4337-B flyback transformer is 3.6W. The
transformer is able to supply maximum of 12.0 V at 0.3 A (P = VI = 12.0*0.3). However, when
two transformers are connected in series, we obtained twice the voltage at half the current rating
following the same power rating of the device. Even though voltage from two transformers should
add up and produce 24V at 0.15 A, after the series connection of two Q4337-B the output voltage
came out to be 16.0V in the actual circuit. Figure 6 shows the schematic for two tap transformer
11
The circuit was designed to provide an adjustment with a power supply that is designed while
providing a voltage range of 1.25V to 30V. LM317 an adjustable 3-terminal positive voltage
regulator capable of supplying in excess of 1.5A over an output voltage range of 1.2V to 37V and
requires only two external resistors to set the output voltage due to its internal current limiting,
thermal shutdown and safe area compensation, constant current regulators and an adjustable power
supplies due to its features such as protected output from short circuit, product enhancement tested,
current limit constant with temperature, guaranteed thermal regulation, adjustable output down to
1.2V, guaranteed 5A, and guaranteed 7A peak output current.
The adjustment pin serves as a voltage adjustment reference for the output. This pin can be
attached to a resistor divider circuit to adjust to a user desired voltage level. The voltage dropout
for any regulator states the minimum allowable difference between output and input voltages. For
example, if a LM337 regulator is to provide 5V at its output, the input voltage must be no lower
than 5v +2.5V =7.5V. This reference voltage can also be adjusted to regulate the current and this
constant current flows through R2 from ground. Following equation comprises R1 and R2, where
R1 is fixed resistor value and R2 is used as adjustable resistance depending on the need of the
regulated value. The output that will be provided by the negative voltage regulator can be
calculated by the given formula.
A positive and negative voltage regulator is used to provide user-desired stable output. LM317
and LM337 consists of a 1.25 V voltage reference circuit. The output voltage is determined using
the ratio of R2 and R1 where R1 is fixed to 900ohms [4] [5].
= +. +
= . +
12
The INA219 chip monitors three values 1) bus voltage, 2) current and 3) shunt voltage.
These values are displayed in LCD and further used for overcurrent protection. The MCU
interfaces to the power supply unit circuit using a solid state relays. We used two solid state relays
for positive and negative terminal outputs. The user sets the maximum limit using the push buttons.
The maximum current limit is displayed on the LCD as part of the user interface. For current limit
protection, the circuit current is compared to the maximum current limit set by the user. The
INA219 chip is more reliable than a resettable fuse because it takes time for the fuse to cool down
and begin to normally operate again. Moreover, the user can monitor the actual voltage that is
outputted to the testing circuit.
Solid state relays are typically smaller, lighter and have faster response time than generic
relays that are larger and work based on electromagnetics. The relays are always set low and the
Vout is always set high. When a digital signal of max. 5v is applied i.e. high the Vout is LOW.
The MOSFET switch in solid-state relays is turned-off when input pin is set high. When the
MOSFET is in off-state it bypasses the voltage to and whereas when it is set low the MOSFET is
turned-on current takes the part of the least resistance which is towards Vout (testing circuit).
Figure 7 shows the block diagram of the digital display system. Source code of the MCU is
provided in Appendix B.
13
Solid state relays are very imperative for small application like portable USB power supply.
G3VM-61A1/D1 series MOSFET relays comes with the features where they get to communicate
directly with the MCU and the operation condition comes very reliable for this particular power
supply. Two relays are connected in this project, where one is associated with positive regulator
and the other to the negative regulator. It consists of 4 pins, where pin 2 and 3 are connected
together to the ground and send signals to pin 4 for the safety operation. Pin 4 has two connections,
VDD which is connected directly from the voltage regulator and VOUT is the output terminal. Pin
1 is connected with INA219 by an MCU which will monitor the fault in the system. The MOSFET
inside this relay acts as a switch, when pin 1 reads low current the switch is on and it communicates
with pin 4 to the output. On the other hand, when pin 1 reads high current, the switch is off and
pin 4 will allow the current to bypass it to the ground. The schematic and the ON and OFF
operation of this specific relays is given in figure 8.
B. Circuit Simulation
Voltage regulator
The following figures illustrate positive and negative voltage regulation simulated circuits:
14
Analysis of Digital Potentiometer: The use of digital potentiometers was considered as an alternative means of adjusting voltage at
the output terminals with high precision. Digital potentiometers are controlled by MCU via digital
signals. For the analysis, a digital potentiometer of 10K-ohm with 128 steps are tested for exact
precision delivery. However, after careful analysis it is found that error associated with using
digital potentiometer is very high compared to using manual precision potentiometer that is
initially used. The analysis below is based on the data in Appendix C.
Given a voltage (x), the following formula is the output of the number of steps required to attain
the correct resistance in order to obtain the desired voltage illustrated in Appendix C.
= . . ;
15
The following graph illustrates the error associated on using digital potentiometer in potential
divider circuit.
():
= .
:
= . + . =
=
, =
16
17
C. Prototype
I. Problems Encountered and the Solution
Problem encountered
Solution
Max current, =
XY
V.W
]X
= .3
= .15
12
10
+Vout
8
6
0
0
10
15
Resistance value
20
25
18
D. Cost Analysis
Comparison between Distributors
Part Name
Mouser
Digi key
Other
LM2587
$ 4.4400 $ 4.4438
LM317
$ 0.0830 $ 0.0735
LM337
$ 0.2140 $ 0.2600
$ 0.3280 $ 0.1300
$ 0.3770 $ 0.7044
Precision Potentiometer
$ 7.6300 $ 7.3073
Flyback Transformer
$ 0.6800
Diodes
$ 0.0090 $ 0.0055
Banana Jacks
$ 0.3250 $ 0.3125
Resistors
$ 0.0890 $ 0.0950
Capacitors
$ 0.0150 $ 0.0230
LCD Screen
$ 3.9800
Quantity
LM2587
LM317
LM337
USB Type B Port
USB Type B Cable
Precision Potentiometer
Flyback Transformer
Diodes
Banana Jacks
Resistors
Capacitors
LCD Screen
1
2
1
1
1
2
1
2
3
15
10
1
Total Cost
Unit Price
Total
$ 4.4400 $ 4.44
$ 0.0735 $ 0.15
$ 0.2140 $ 0.21
$ 0.1300 $ 0.13
$ 0.3770 $ 0.38
$ 7.3073 $ 14.61
$ 0.6800 $ 0.68
$ 0.0055 $ 0.01
$ 0.3125 $ 0.94
$ 0.0890 $ 1.34
$ 0.0150 $ 0.15
$ 3.9800 $ 3.98
$27.02
19
E. Project Requirements
Satisfied/Not
satisfied
Minimum Requirements
Adjustable voltage in 10mV
increments ranging from -10V
to +10V DC.
Adjustable current limit setting
for overcurrent protection in
10mA increments.
Fixed percentage overvoltage
protection (no more than 20%)
i.e. when the output voltage
goes above the specified value
by a certain percent, the output
is switched off.
Isolated voltage output
User interface that displays
voltage setting, voltage reading,
current setting, and current
reading.
Selectable on/off for voltage
output.
Output via banana connector
and/or screw terminal.
Cost per unit less than $5 (>1M
units).
Remarks
The output voltage is connected with a
precision potentiometer in order to have
10V DC in 10mV increments
Push buttons associated with MCU are
used to set maximum current limit for the
circuit being tested
(Pending)
Loading effect
(Pending)
20
From the power supply, set a voltage to generate from its output.
Ensure that the power supply is turned on and running.
The recorded voltage from the testing instrument should be within 5% of the set voltage.
The voltage range of the power supply should be from -10V to +10V in 10mV
increments.
*The 10mV requirement was verified using the display of digital multimeter in lab.
Adjustable current limit setting for overcurrent protection in 10mA increments (Satisfied)
Measure the output current and compare to the user set current limit.
Connect the testing instrument (multimeter) in series to the electronic load.
Figure 2 below demonstrates the connection of the multimeter (labeled I) in series to the
load.
21
Ensure that the power supply has warmed up for at least 30 minutes.
Connect an external DC power source in series with the power supply that has a rating of
at least 20% of the set output voltage.
Measure the output voltage and compare to the user set output voltage.
Upon connecting the external DC power source, the voltage across the load is the sum of
the external source and the set user voltage from the power supply.
This causes the voltage across the load to be greater than the overvoltage threshold and
the power supply should automatically be switched off.
Ensure that the power supply has warmed up for at least 30 minutes.
Measure the output voltage and current without an electronic load.
Measure the output voltage and current while under an electronic load.
The output power is equal to:
abc = abc abc
The ratio between the output power with an electronic load and the output power without
an electronic load should be no less than 0.75.
22
The length of the power supply should be no more than 5.5 inches.
The width of the power supply should be no more than 3.5 inches.
The height of the power supply should be no more than 3 inches.
23
Precision Pot
Flyback Regualtor
Circuit
Voltage
Regulators
Transformer
Circuit (only one in
use)
24
Appendix B.
Source Code
#include <Wire.h>
#include <LiquidCrystal.h>
#include <Adafruit_INA219.h>
Adafruit_INA219 sensor219;
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); //lcd pins
const int
const int
const int
buttonPin = 2;
buttonPin1 = 4;
buttonPin2 = 3;
//declare pins
//int relayPin0 = 13;
//int relayPin1 = 15;
//end of declare pins
// Relay 0
// Relay 1
void setup(void)
{
Serial.begin(250000);
sensor219.begin();
lcd.begin(16, 2);
pinMode(buttonPin, INPUT);
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(LEDOutput, OUTPUT);
}
void loop(void)
{
//relay code
digitalWrite(relayPin0, HIGH);
// sets the relay 0 on
delay(1000);
// waits for a second
digitalWrite(relayPin1, HIGH); // sets the relay 1 on
delay(1000);
// waits for a second
//end of relay code
25
buttonState = digitalRead(buttonPin);
Serial.println(buttonState);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
if (buttonState == 1)
{
counter = counter + 5;
}
else if (buttonState1 == 1)
{
counter=counter - 5;
}
/*else if (buttonState2 == 1)
{
counter = 0;
}*/
Serial.println("Counter " + (String) counter);
float busVoltage = 0;
float current = 0; // Measure in milli amps
float power = 0;
char outstr[15];
//read sensor
busVoltage = sensor219.getBusVoltage_V(); //voltage in V
current = sensor219.getCurrent_mA(); //current in mA
power = busVoltage * (current/1000); // power in W
//end of read sensor
String msg1 = "";
String msg2 = "";
//lcd refresh
lcd.setCursor(0, 0);
lcd.print("");
lcd.setCursor(0,1);
lcd.print("");
//end of lcd refresh
//lcd 1st line
lcd.setCursor(0,0); //16x1
msg1 = "";
//dtostrf(busVoltage,4, 1, outstr); //converts the value to one value
after decimal
msg1 = (String) busVoltage;
Serial.println(busVoltage);
lcd.print("");
//lcd.print(msg1+"
"+counter);
26
//end of lcd 1st line
Serial.println(counter);
//lcd 2nd line
lcd.setCursor(0, 0); //16x2
msg2 = "";
msg2 = (String) (current);
lcd.print("");
lcd.print(msg1+" "+msg2);
//end of lcd 2nd line
lcd.setCursor(0, 1);
lcd.print("");
lcd.print("C= " + (String) counter);
Serial.println("Current " + (String) current);
Serial.println("Counter " + (String) counter);
if(current>counter)
{
digitalWrite(LEDOutput, HIGH);
}
else
{
digitalWrite(LEDOutput, LOW);
}
//serial print
Serial.println(msg1);
Serial.println(msg2);
Serial.println("");
//end of serial print
delay(2000);
/*
for (int i = 256; i >= 0; i--)
{
digitalPotWrite(i);
delay(10);
}
delay(500);
*/
/*
delay(10);
digitalPotWrite(8);
delay(10);
Appendix C
27
28
29
30
31
32
33
34
IV.
References