current load at the same time, I can plot the I-V curve.
This should look like a straight line, with an intercept at
the DC voltage and a slope equal to the internal resistor.
From this curve, I can fit these two terms.
I used a simple transistor follower circuit as a resistive
load. The input voltage to it will control the current. I
wanted to ramp the current up so I could measure a few
different values from 0 to a maximum. So, how do I get a
ramp voltage from an Arduino?
Even though the specs for an Arduino say it has
analog output, this is not quite correct. There are six
digital pins — usually designated with a little squiggly line
(“~”) next to them — which can be set up as pulse width
modulated (PWM) signals. The duty cycle of a 500 Hz
square wave is adjusted so the integrated value — or
average value — can be changed.
However, to use these pins as an analog voltage — for
example, to ramp up the voltage and the current load —
would require a long integration time and they would still
have some ripple on them.
I decided to use another approach to generate a ramp
signal. I know I can get a precisely controlled digital
output signal which is basically a square wave pulse. I
could use a simple RC filter to turn the digital signal into a
ramp. The output of the digital pin would charge up a
capacitor through a resistor.
This voltage would then control the current through
the transistor and the load on the power supply. Figure 9
shows this simple circuit.
For this application, I used a 2N6040 — an NPN
Darlington transistor. By adjusting the load resistor, RL, I
can get any range of current I want. Given the limited
number of time constants I wanted to wait and the
forward drop through the transistor, the maximum voltage
I would see across the resistor is about 3.5V. With a 10
ohm load resistor, the current will range from 0V to
3.5V/10 ohms = 350 mA.
I know I can set up an Arduino to sample the analog
July 2015 57
FIGURE 9. Transistor follower circuit with an RC integrator.
How Not to Generate Smoke
A resistor is really a component which is very efficient at
turning electrical power into thermal power and getting hot. The
power dissipation in a resistor can be estimated from:
If we measure voltage in volts, current in amps, and
resistance in ohms, the power dissipated in the resistor is in
watts. Resistor sizes are generally based on the power they can
easily dissipate before getting too hot. Small physical size
resistors have a small surface area and can't get rid of the heat
fast enough before getting hot. Large body sizes have a large
surface area and are more efficient at getting rid of the heat.
Large size axial lead resistors can easily dissipate one
watt; the next smaller size is 1/2 watt, and the next smaller is 1/4
watt. The tiniest axial lead resistors are generally rated for only
1/8 watt. It's possible to get larger body size resistors rated for
even higher power dissipation. Figure A2 shows examples of
resistors with six different power ratings. It's all about their size.
Generally, if the power source is under 15V, to dissipate
less than 1/2 watt and not worry about the power consumption
requires a resistor greater than:
If you use a resistor less than about 500 ohms, be sure to
put in the numbers to check if power will be a concern. If it is,
watch out for smoke or engineer a solution that can adequately
dissipate the power.
Figure A2. Resistors with six different power ratings: 10 watts,
five watts, one watt, 1/2 watt, 1/4 watt, and 1/8 watt.
V2 P= =I2R=VxI
V2 152 R = = = 450 ohms