This is only a preview of the March 2019 issue of Silicon Chip. You can view 34 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Ultra low noise remote controlled stereo preamp, Pt.1":
Items relevant to "Our new DAB+ Tuner with FM and AM – Part 3 ":
Items relevant to "Touch controlled all-diode checker and plotter":
Items relevant to "Versatile Trailing Edge Dimmer – Part 2 ":
Items relevant to "El Cheapo Modules 23: Galvanic Skin Response":
Purchase a printed copy of this issue for $10.00. |
Handles signal diodes, rectifier diodes,
Zeners, Schottkys, LEDs,
photodiodes, etc!
By
Tim Blythman
Multi
Diode Curve Plotter
Our new Diode Curve Plotter is way better than any diode testers we’ve
published in the past; it’s very versatile and fits in the palm of your hand.
It automatically tests diodes in both directions and plots the resulting
current/voltage curve on a colour LCD screen. It tests zener diodes up
to about 100V, but it can also test LEDs, schottky diodes, regular diodes,
transient voltage suppressors and more.
O
ur last Zener Diode Tester,
published in the November
2011 issue (siliconchip.com.
au/Article/1219), was beautiful in its
simplicity.
But it was only able to provide a
measurement of the zener voltage,
and it required a separate multimeter
to display the result.
This new unit utilises the same 2.8inch colour LCD touchscreen as used
in the Micromite BackPack from February 2016 (siliconchip.com.au/Article/9812), but this time it’s being
paired with an Arduino Mega board
62
Silicon Chip
and a custom PCB which provides the
test interface.
What it can do
The main feature of the Diode Curve
Plotter is that performs a full bidirectional current/voltage (I/V) sweep of
a connected diode (or another component!) and display the results in
graphical form.
For zener diodes, the zener voltage
and current are displayed on the screen,
along with the zener impedance at that
point. You can move the test point to
get different voltage, current and imAustralia’s electronics magazine
pedance readings along the curve.
The unit can produce up to 100V at
up to 30mA for testing diodes, providing a wide testing range. For devices
like LEDs, you can limit the test voltage and current to avoid damaging
them during testing. It also has a specific LED testing mode, to make that
job even easier.
The plot data can also optionally be
sent to a connected computer as rows
of CSV (comma-separated value) data,
allowing plots to be stored and analysed further if necessary. You can plot
and analyse this data on your PC using
siliconchip.com.au
just about any spreadsheet program.
Getting back to the unit itself, cursors on its screen allow the operating
point to be varied, by selecting either
a voltage or current, allowing the operating conditions can be examined
across the range of the plot.
For example, you could investigate how a zener diode performs at
points away from the ‘knee’ of the zener curve.
The hardware scans the diode in
both quadrants. It shows the full plot
on the display, but only the forward
operating point conditions are displayed in detail. A “Reverse” button
allows the plot to be flipped so that the
reverse characteristics can be checked
without rerunning the test.
This is handy if the diode is connected backwards, or to check its behaviour in both forward and reverse
directions.
The unit has adjustable current,
voltage and power limiting parameters. But given that each test takes a
few seconds to complete, even if these
limits are set slightly high, any overcurrent or over-voltage condition is
quite brief and unlikely to cause any
damage.
The LED test mode is essentially
a constant current mode, which provides a set output current and it shows
the forward voltage, power and voltage/current ratio for the connected
device.
The current and voltage limits can
be set to the nearest milliamp and volt
respectively, so even unknown devices
can be probed without risk.
If a resistor is connected, the voltage/current ratio will, of course, cor-
Features & specifications
•
•
•
•
•
•
•
•
•
Tests zener diodes, LEDs, TVSs, silicon diodes, schottky diodes and more
Colour touchscreen interface
Tests up to 100V/30mA from 12V DC supply (can run from 5V, including USB)
Automatically plots I/V curve in both quadrants
Reads out current, voltage, power and impedance at any point in the curve
Adjustable current/power limit for smaller devices with 0.4W and 1W presets
Simple LED testing mode
On-screen button to show reverse characteristics
Based on an Arduino Mega with custom shield
respond to the resistance, and thus the
diode tester can even be used as a very
basic ohmmeter.
How it works
The Diode Curve Plotter is a sandwich of three boards: an Arduino Mega
or compatible board forms the bottom layer and provides the processing power, the LCD touch panel is the
top layer, providing display and user
interface, and the custom PCB in the
middle contains the other parts which
measure the parameters of the connected diode.
By the way, the reason we are using
an Arduino Mega rather than an Arduino Uno in this project is that we need
the extra flash memory space provided
by the larger chip on the Mega. We are
not using any of the extra pins.
High voltage generator
As we noted, the unit can test diodes
up to 100V but it runs from 5V DC,
so it needs a way to generate higher
voltages to apply to the device under
test (DUT).
The circuit diagram of the Curve
Plotter is shown overleaf in Fig.1.
The plotter mounted in a
UB3 Jiffy Box, with a laser-cut front panel
(available from the SILICON CHIP ONLINE SHOP) to reveal the touchscreen display.
siliconchip.com.au
Australia’s electronics magazine
Inductor L1, N-channel Mosfet Q1
and diode D1 operate as a standard
boost converter which is driven by
IC2, an LM311N comparator.
It runs from a 5V DC supply which
is convenient, because that means you
use a USB power bank, USB charger or
even a PC/laptop USB port. But note
that it may draw more than 500mA
when testing higher-voltage, higherpower devices, so a computer USB
port may drop its bundle under these
conditions. A 1A+ charger or battery
bank is recommended.
The boost regulator draws power
from the Arduino’s VIN pin, which
is connected directly to its DC power
jack. In case the unit is powered via
the USB socket instead, the 5V supply flows through schottky diode D2
into the VIN rail, powering the boost
converter instead.
IC2, the LM311 comparator, is used
both as an oscillator to drive the gate
of Mosfet Q1 and also as a current limiter. Since an LM311 can only sink current at its pin 7 output, pin D3 of the
Arduino (“BOOSTCTL”) must be high
to enable the oscillator. This pulls pin
7 up via the 1kΩ resistor; normally, it
is held low by a 10kΩ resistor, so Q1
is off by default.
Since the Arduino’s D3 output is
capable of generating a low-frequency
PWM signal, we can switch the boost
circuit on and off rapidly with a varying duty cycle to control the resulting
boosted voltage.
The circuit around IC2 is not a fixed
oscillator, but instead, it monitors the
current passing through inductor L1
using the 1Ω 1W series resistor. When
Q1 switches on, the voltage across the
1Ω resistor increases as the current
through L1 builds and its magnetic
field charges up, until the threshold
set by the comparator’s resistor network is reached. At this point, Q1 is
switched off.
The 100kΩ feedback resistor proMarch 2019 63
+5V
+3.3V
1 0 0nF
MOSI
+5V
+5V
D/C
MOSI
SCK
LED
MISO
T_CLK
T_CS
T_DIN
T_DO
T_IRQ
SD_CS
SD_MOSI
SD_MISO
SD_SCK
4
RLYCTL
5
LCDDC
6
LCDRST
7
LCDCS
8
9
4
6
2
8
1
ADC3
5
IO 3/PWM
ADC2
IO 4/PWM
ADC1
IO 5/PWM
ADC0
36k
IO7
IO8
IO 9/PWM
12
ARDUINO MEGA
OR EQUIVALENT
A
14
D2
1N5819
15
TP3
+5V
+3.3V
IO 13/SCK
RESET
GND
17
A
K
+5V
SDA
TO LCD
SCL
IPA60R520E6
G
LK1
VIN
1 1W
VIN
IC2: LM311
10k
10k
62
2
5
6
8
IC2
3
4
1 0 k
A
100nF
10k
10k
TP1
L1
100 H
100k
7
Q1
IPA60R
520E6
1
62
D1
1N4004
D
S
TP2
CON1
1 F
250V
TEST
TERMINALS
OPTO1 PC817
2
D
K
1
100 F
4.7k
D1, D2
AREF
6x
1k
18
36k
GND
IO 11/MOSI
16
1k
6
VIN
IO 12/MISO
K
IC1b
GND
IO 10/SS
13
4.7k
5
7
470
11
1k
2
4
MISO
10
3
IC1a
IO 6/PWM
SCK
+5V
ICSP
IO 2/PWM
3
3
BOOSTCTL
ADC 5/SCL
ADC 4/SDA
DC VOLTS
INPUT
RESET
5x
470
2
IO 1/TXD
USB TYPE B
CS
IO 0/RXD
TOUCHCS
OPTOCTL
GND
1
1
CON2
VCC
IC1: LM358
MOD1
4
1M
1M
100k
30k
10nF
RLY1
3
10nF
30k
1k
3k
1 0 0nF
OPTO2 PC817
1
1 3 k
10k
2
4
IC1, IC2
3
100
SC
20 1 9
PC817
+
ZENER/ DIODE /LED CURVE PLOTTER
4
8
1
4
1
2
Fig.1: the Multi Diode Curve Plotter is based on an Arduino Mega (MOD1), a boost regulator (IC2/Q1/L1), two optoisolators which operate as a controlled current source (OPTO1 & OPTO2) and a relay to reverse connections to the DUT
(RLY1). The test voltages and current are fed back to the Arduino so it can plot the curve and display measurements.
vides hysteresis, allowing the current to drop a small
amount before Q1 switches on again and the cycle repeats.
The resulting waveform has a high duty cycle, as required
for a boost circuit with such a high output/input ratio.
When Q1 switches off, the voltage at the end of inductor
L1 that’s connected to its drain shoots up and so diode D1
becomes forward-biased, charging up the 1µF capacitor to
a much higher voltage than the incoming supply.
This voltage is divided by 100kΩ /3kΩ resistors, filtered
by a 100nF capacitor and fed to analog input ADC1 of the
Arduino. The divider provides a voltage which is within the
0-3.3V range of the Mega’s analog-to-digital converter (ADC).
While the Mega’s ADC has a 0-5V range by default, we
64
Silicon Chip
are using its onboard 3.3V regulator as a more precise reference, and so we can measure up to around 108V with this
divider. Jumper JP1 usually feeds 3.3V into its AREF pin.
This divider also discharges the 1µF capacitor, so that its
charge will not persist after the boost converter is switched
off. With the capacitor charged to 100V, the 100kΩ resistor dissipates around 100mW, well within the ratings of a
small 1/4W resistor.
Note that the 13kΩ resistor connected to pin 2 of IC2 via
a 10kΩ resistor sets the maximum inductor current (ie, in
L1) which effectively determines the maximum voltage
that the boost generator can produce, and also affects the
maximum current that the unit will draw.
Australia’s electronics magazine
siliconchip.com.au
So if you want to reduce the maximum test voltage (eg,
to allow the unit to run from a USB port that can only supply 500mA) then you can drop the value of this resistor
to 12kΩ or even slightly lower, down to as little as 11kΩ.
Test circuitry
The test voltage is fed to the DUT via two optoisolators,
OPTO1 and OPTO2, and relay RLY1. At the other end, the
DUT is connected to ground via a 100Ω resistor.
OPTO1 and OPTO2 are configured as a controllable current source, with both collectors connected directly to the
high voltage supply and both emitters to the DUT. Their
photo-transistors are connected in parallel to enhance the
amount of current they can supply to the DUT.
Their LEDs are connected in series, so that the effective
current transfer ratio (CTR) is doubled. They are controlled
by a PWM signal from pin D10 of the Arduino which is fed
to the two 62Ω resistors. The 100µF capacitor smooths the
PWM signal, in combination with those resistors, so that a
steady, controllable current flows.
The modulated current goes to the DUT via relay RLY1.
When its coil is energised, it reverses the connections to
the DUT. The 100Ω resistor operates as a current shunt,
allowing currents up to 33mA to be measured against the
3.3V reference voltage. The voltage across this shunt is
monitored at the Arduino’s A2 analog input.
In practice, while testing a device, the unit sweeps the
test voltage with the relay switched on, monitoring both
the current and voltage, then performs another sweep with
the relay switched off, so that current flows through the
device in both directions during a single test pass.
Screen1: the splash screen/main menu allows you to select
between the two different types of tests (I/V Test or LED
Test) and access the Settings and Calibration menus. Our
logo is rendered with the glorious “Back to the Future”
colour scheme!
Measuring circuitry
There are four main parameters which are measured by
the Mega’s internal 10-bit ADC. Two have already been
mentioned: the voltage on the 1µF capacitor and the test
current, as measured using the shunt. The other two parameters measured are the voltages at each end of the DUT.
Both are fed into 1MΩ /30kΩ voltage dividers, giving the
same 108V maximum reading.
These voltages are fed into the two halves of IC1, an
LM358 op amp. By default, these are configured as unity
gain buffers, with the 36kΩ resistor in the feedback path
having little effect. In this mode, voltages up to 108V can
be measured with around 0.1V resolution (108V / 210).
But there is also a 4.7kΩ resistor and 1kΩ resistor from
the inverting input of each op amp to two digital pins on
the Arduino. These are initially left floating and in this
case, do not affect the op amp’s operation.
But if either is pulled low by its corresponding pin on
the micro, that changes the op amp gain to either 8.66 times
(36kΩ÷4.7kΩ + 1) or 37 times (36kΩ÷1kΩ + 1). This amplifies the sensed voltages, giving resolutions of around 10mV
and around 3mV respectively, with the maximum readings
being about 12.5V and 3V. So the gain is only increased
when measuring lower voltages, to improve resolution.
All ADC measurements are sampled 16 times and averaged to improve precision and stability.
Any error due to input offset will be taken care of during calibration stages.
Touchscreen interface
The touchscreen plugs into header socket CON2. The
siliconchip.com.au
Screen2: the typical result of the I/V Test run on a 75V
zener diode. A 250mW operating point is identified and
indicated on the graph.
Screen3: here we have selected the I/V Test option with
a LED connected to the unit and it has performed the
measurements and plotted the graph. It’s showing that
10mW is achieved a forward voltage of 2.05V and a test
current of 4.89mA.
Australia’s electronics magazine
March 2019 65
Screen4: in the LED test mode where the forward voltage,
current, power and zener impedance are continuously
updated. You can adjust the maximum voltage and current
applied to the LED directly with the arrows below.
screen is powered from the 3.3V regulated supply while
the backlight is powered from the 5V rail. The Arduino
controls it over two SPI (serial peripheral interface) buses. One is used for updating the screen and one for getting
data from the touch sensor.
Their MISO and MOSI (data) and SCK (clock) lines are
connected together to share the same set of hardware SPI
pins on the Arduino, via its six-pin ICSP header. The screen
and touch controller have separate chip select (CS) pins, at
pins 3 and 11 on CON2, so the Arduino can select which
one it is communicating with by pulling one of the two
digital outputs D7 or D2 low.
These five lines, plus the data/control line on pin 5 of
CON2, have 1kΩ resistors connected from each pin to
ground plus 470Ω series resistors between the LCD pins
and the Arduino. These form voltage dividers, reducing
the 5V swing on the Arduino outputs to a 3.3V swing, to
suit the LCD electronics. The MISO line is driven by the
LCD so no level shifting is needed, as the Arduino will
read 3.3V as a high level.
The remaining five pins on CON2, the interrupt request
line from the touch controller (T_IRQ) and the four SPI
control lines for the SD card socket, are unused and so are
left disconnected.
Software operation
Screen5: in the Settings screen where you can select the type
of device being tested, the maximum power and the target
(nominal) power. The four buttons at the bottom change
these values, then you press the Back button when finished.
Screen6: the Calibration screen reads out one of seven
parameters, as measured by the Arduino, allowing you to
compare them to readings made with a DMM and calculate
coefficients to provide more accurate measurements.
66
Silicon Chip
While testing, the boost converter is modulated by the
PWM signal from pin D3 to maintain a voltage at TP1 that’s
slightly higher than the desired test voltage, but within the
programmed limits. Then, the current through OPTO1/
OPTO2 is varied across the testing range.
The difference between the voltages measured at both
ends of the DUT plus the current through the 100Ω shunt
are recorded in an array.
RLY1’s state is toggled to reverse the polarity of the DUT,
and the test is repeated, after which the results are plotted
in a graph on the screen.
The Arduino Mega interpolates the data points to find
the voltage and current at which the device power equals
the selected operating point. The relevant figures are then
shown in a small box on top of the graph, as well as drawing lines which show where that point is on the curve.
The box display includes the voltage, current and power at the operating point, as well as the zener impedance,
derived from the gradient of the voltage/current curve at
that point. The raw I/V data is then dumped to the serial
port, where it can be read by the PC and used for additional analysis.
The details of a second operating point can be analysed
by touching the graph along the right-hand axis. If the
graph is touched in the first quadrant (top right), then the
current level is selected according to the vertical position
of the touch.
A second info box is displayed, showing conditions at
the new operating point.
Similarly, touching the graph in the fourth quadrant
(bottom right) sets the voltage according to the horizontal
touch position and displays a similar box.
The LED test page is much simpler, and in this mode,
tests are run continuously. The current is modulated to the
limit set on that page, and the voltage is maintained within
these limits by controlling the boost circuit.
With more screen space available, the statistics are shown
Australia’s electronics magazine
siliconchip.com.au
in a larger font and they include voltage, current and
power at the instant of measurement, as well as the
ratio of voltage to current. This will not correspond
to the zener impedance, but will be a fair measurement of the resistance of a fixed resistor.
Construction
All of the components mount on a shield PCB, as
shown in Fig.2. Use this overlay diagram as a guide
while building the board. Start by fitting the small
(1/4W or 1/2W) resistors where shown. It’s a good
idea to measure the value of each batch before fitting them, as the colour bands can sometimes be
ambiguous.
Solder diodes D1 & D2 in place next. They are
different types and also orientated differently. Make
sure that you don’t mix them up and that the cathFig.2: this component overlay echoes the silk-screen printing
ode stripes face in the directions shown in Fig.2.
on the PCB surface as shown below – between the two you
You can then fit the larger 1Ω 1W resistor.
should have no problems constructing the shield.
Now install the seven capacitors, making sure
that for the electrolytic types, the longer (+) lead
goes into the pad marked with a + sign on the PCB
overlay diagram and the PCB silkscreen printing.
Since the LCD stacks above this board, all components must project less than 12mm above the top
surface of the PCB. If any of your electrolytic capacitors are 12mm high or taller, you will need to lay
them over on their side when you fit them.
Note that we give two options for the 1µF capacitor, a polyester ‘greencap’ and an electrolytic type.
While both should work, we prefer using the greencap, despite the fact that it needs to be installed
with its leads bent over to keep it under 12mm high.
Greencaps have better performance than electrolytics. But either should work, so it’s up to you.
Fit the two ICs next. They are different types but
come in the same package so don’t get them mixed
Note that you could use a stackable header set, such as
up. Fig.2 shows where they go and the correct orientation of each. Make sure the pin 1 notch or dot is facing as Jaycar’s HM3208, rather than the standard pin headers
shown before soldering the pins. Then fit the two optoiso- specified. But that is likely to change the overall height
lators, again taking care that their orientation is as shown. of the unit, and it may no longer fit in the specified case.
Use a similar technique to fit the 14-way female header
Now mount Mosfet Q1. You will need to bend its legs
90° to allow the body of the Mosfet to sit flat. Before at- which connects the LCD to this PCB. It goes on top of the
taching to the board with a 6mm machine screw and nut, board. Plug it onto the LCD header, then mount the LCD
check whether that screw will foul the USB socket on your on the shield board using three 12mm tapped spacers and
Mega board once the two are plugged together. If so, you six 6mm long M3 machine screws – don’t attach it in the
upper-right corner, ie, there is no spacer mounted near IC2.
will need to omit the mounting screw.
Once you’ve sorted that out, ensure the writing on the Then solder the header in place.
The 2-way female header is used for CON1, which contab is facing upwards and then solder its leads. Telecomstyle relay RLY1 is installed next, with its pin 1 stripe the nects to the device under test. We found this type of header
left as shown. Then fit inductor L1, which is not polarised, ideal for this purpose, as most smaller component leads
so its orientation is not critical. Ensure that it is not too tall simply plug into the sockets. However, you could chassiswhen installed; it may need to be laid on its side to keep it mount banana sockets instead, and wire them back to the
pads for CON1.
under the 12mm limit. Then solder pin header JP1 in place.
You may wish to solder extension leads to the pins of
The four SIL pin headers for connection to the Arduino
can all be snapped from a single 40-pin header. The easiest CON1 before fitting it, to make the top of the socket level
way to mount them to the board is to plug them into the with the top of the LCD once assembly is complete. That
Mega board, the slot the shield PCB over the top to ensure allows it to project through the hole provided in the lathat everything is square and flush before soldering them ser-cut lid. But if you do so, insulate the wires with short
in place. Note that they are inserted through the bottom of pieces of heatshrink tubing or similar, keeping in mind that
there can be around 100V between them during operation.
the PCB and soldered on the top side.
That completes the assembly of the shield board. Once
Use the same technique to solder the 2x3 female header
this is done, double check your soldering. Given that the
to the board; again, it is mounted on the underside.
siliconchip.com.au
Australia’s electronics magazine
March 2019 67
This photo, along with the one opposite,
shows how the three boards are
“sandwiched” together – the Arduino
Mega board on the bottom; the new
shield board in the middle (green) and
the 2.8-inch LCD touchscreen on top.
It is designed to fit in a UB3 Jiffy box
with a new laser-cut Acrylic lid. Note
the connectors on the Mega board in the
photo opposite – the USB on the left,
and the DC power input at right.
board can generate over 100V, you don’t want a small error on the PCB to feed that back into your computer. You
may wish to use a USB Port Protector such as the one we
described in May 2018 (siliconchip.com.au/Article/11065)
a kit is available – SILICON CHIP ONLINE SHOP Cat SC4574).
Unplug the shield/LCD assembly from the Arduino Mega
now, as it’s best to keep the boards separate until the Mega
has been programmed, especially if the Mega has previously been programmed for another project.
Connect the Mega to a computer using an appropriate
USB cable; most Megas have USB Type-B full-size sockets
so you will need a Type-A to Type-B cable.
Installing the software
To install the software on the Mega, you need the Arduino IDE (integrated development environment) installed
on your computer. The IDE includes a compiler and serial programming software, allowing the source code to be
compiled and sent to the Arduino. The IDE can be downloaded from www.arduino.cc/en/Main/Software
We are using Arduino IDE version 1.8.5 but a newer
version may be available by the time you check the download page.
Since we have written many of the libraries for this project ourselves, we have included all the necessary files in
the sketch folder. Download the zip file from the SILICON
CHIP website and extract the contents to a suitable location
such as your “Documents” or home folder.
Open the “Zener_Diode_Tester.ino” sketch file using the
IDE. From the Tools menu, under Board, select “Arduino/
Genuino Mega or Mega 2560”. Then choose the appropriate serial port from the Tools -> Port menu. Click Upload
or press Ctrl-U to start the compile and upload process.
This may take a minute or two.
Unplug the USB cable and place the jumper shunt over
the two pins of JP1 so that it is closed. Plug your shield
PCB onto the Arduino Mega and then attach the LCD to the
top of the PCB (if it isn’t already attached). You are then
ready for testing.
Testing and touchscreen calibration
Plug the USB cable back into the computer or if you have
a 12V DC plugpack handy, use it instead. Ensure that the
screen illuminates and displays the main menu page with
the SILICON CHIP logo. The Mega can have a start-up delay,
so don’t be alarmed if nothing happens for a few seconds.
The sketch is written with a default touch panel calibration. Try pressing some buttons on the touchscreen and
check that they respond as expected. If you find that they
don’t, or the touchscreen calibration seems inaccurate, or
it is not responding to touch at all, you will need to use our
provided calibration sketch to calculate new touch panel
calibration parameters.
By the way, we’ve seen some 2.8-inch touchscreens which
look more or less identical to others but the touch panel
axes are reversed. If you have one of those, you will definitely need to go through the calibration process.
To do this, open the “AVR_LCD_BackPack_Touch_
Parts list – Arduino-based Multi Diode Tester
1 double-sided PCB coded 04112181, 99mm x 60mm
1 Arduino Mega R3 board or equivalent [Jaycar XC4420, Altronics Z6241]
1 2.8-inch LCD touchscreen [SILICON CHIP ONLINE SHOP Cat SC3410]
1 UB3 Jiffy box (included lid not required)
1 3mm laser cut Acrylic lid [SILICON CHIP ONLINE SHOP Cat SC4927]
1 2-pin female header (CON1)
1 14-way female header (CON2)
1 2-pin header with jumper shunt (JP1)
1 6-pin, 2 8-pin & 1 10-pin header (to connect to Arduino)
1 2x3-pin female header (to connect to Arduino ICSP header)
1 100µH bobbin type inductor (L1)
1 DPDT relay with 5V DC coil and 250VAC-rated contacts, DIP-10 (RLY1)
1 12V 1A (or higher) plugpack with centre positive 2.1mm tip
2 M3 x 20mm Nylon panhead machine screws
:
3 M3 x 12mm tapped Nylon spacers
4 M3 x 10mm panhead machine screws
Do not touch any component
7 M3 x 6mm panhead machine screws
leads while the unit is
2 M3 Nylon hex nuts
operating. 100V is enough
2 M3 hex nuts
to give you a bite!
WARNING
68
Silicon Chip
Australia’s electronics magazine
Semiconductors
1 1N4004 400V 1A diode (D1)
1 1N5819 schottky diode (D2)
1 LM358 op amp, DIP-8 (IC1)
1 LM311N high-speed comparator, DIP-8 (IC2)
2 PC817 optoisolators, DIP-4 (OPTO1,OPTO2)
1 IPA60R520E6 700V N-Channel Mosfet (Q1)
[SILICON CHIP ONLINE SHOP Cat SC3298]
Capacitors
1 100µF 10V electrolytic
1 1µF 450V electrolytic or
250V polyester “greencap”
3 100nF MKT or ceramic
2 10nF MKT or ceramic
Resistors (all 1/4W 1% unless otherwise stated)
2 1MΩ 2 100kΩ
2 36kΩ
2 30kΩ
1 13k
6 10kΩ
2 4.7kΩ
1 3kΩ
9 1kΩ
6 470Ω
1 100Ω
2 62Ω
1 1Ω 1W 5%
siliconchip.com.au
Calibration.ino” sketch and upload it to the Mega using
the instructions above. Open the Serial Monitor from the
Tools menu (or by pressing Ctrl-Shift-M) and set the baud
rate to 115,200.
Following the instructions on the screen, use “1” (followed by Enter to send the command) to perform the calibrations. Then use “2” to test that the new calibration is
accurate. Copy the new calibration constants from the Serial Monitor to the clipboard, as shown in Fig.3.
Now re-open the original “Zener_Diode_Tester.ino”
sketch and open the “backpack.h” tab. Find the lines in the
code which are shown in Fig.4. Replace the existing calibration constants with the new values you copied earlier,
save the updated sketch and then upload it to the Mega.
You are now ready for final testing.
Fig.3: after running the touch calibration sketch and
following the instructions, the highlighted text appears on
the serial console.
Checking voltages and currents
Note as you read the following, that if you are using a
computer USB port to power the unit during testing and
calibration, some of the voltages mentioned below may
not reach 100V and the unit may reset, due to the limited
current capabilities of that port.
Start by clicking the Calibration button and use the Previous and Next buttons to scroll through the various items.
In the top-right corner, the display shows where to connect your multimeter test leads to read the appropriate voltage. The second line indicates the name of the value being
tested. The third line indicates whether the test terminals
should be open or short-circuited.
They should be short-circuited for the current test (eg,
using your DMM in current measurement mode); otherwise, there is no path for the current to flow.
The first item to be checked is the output of the highvoltage generator, and this should be up around 100V, with
an ADC value in the 900s. If this is the case, the high voltage system is working. If not, check (after powering off the
unit) for wiring faults around the right-hand edge of the
board, particularly around Q1 and L1.
The next three items measure the voltage at the positive test terminal with various gain settings. Using a DMM,
measure the voltage at the positive terminal of CON1
(shown in Fig.2 and on the PCB) relative to TP3 (GND)
and check that you get a reading that’s close to the one
shown on the screen.
The three following items are the negative test terminal
voltage at its three different gain settings. Use the same technique as above to compare your readings to those shown
on-screen. Any significant deviation in these voltages from
reality indicates a problem in the vicinity of IC1.
The final item is the current reading, and as noted, it
will only work if there is a path for the current between
the test terminals. So switch your DMM to current meassiliconchip.com.au
Fig.4: you then replace this portion of the main sketch
with the text copied from Fig.3 above so that it uses the
new touchscreen calibration.
Fig.5: this is the section of the main sketch where you can
change the calibration parameters, just below the comment
reading “//Calibration constants”
Australia’s electronics magazine
March 2019 69
urement (milliamps) mode and connect it across CON1. The displayed
current should be around 30mA, with
an ADC reading around 900. Compare
this to the reading on your DMM. It
should be close.
If you don’t get any current reading
or it is wildly off, then you may have
a problem with the circuit around the
optoisolators.
To calibrate the unit, step through
each reading and record the ADC value shown and an accurate measurement of the voltage (or current) using
your DMM. Then divide the voltage
or current value by the ADC reading,
and write this value down.
The unit is then calibrated by modifying the scaling values in the sketch
itself. This part of the code is shown in
Fig.5. It’s near the top of the file. Find
those lines and change the values to
those you wrote down.
If the values you have are significantly different from the defaults, you
may have a problem with your board,
or you might have made a mistake in
calculating these values.
Performing this calibration adjusts
the software to be accurate with the
particular components on your board
(eg, the exact resistor values).
After the values have been edited,
the sketch will need to be uploaded
again, as per the earlier instructions,
to allow the new values to take effect.
Completing assembly
Once you are satisfied that the unit
is calibrated and working correctly, it
can be fitted in its case. Start by removing the screws holding the LCD screen
onto the tapped spacers, then temporarily unplug the screen.
Now plug the shield into the Arduino Mega and secure the two together
using the specified Nylon machine
screws and nuts, through the mounting
holes near Q1 (adjacent to the Arduino
SCL pin) and near the Arduino A5 pin.
Next plug the LCD back into the
shield but don’t attach it using screws
just yet. Slot the laser-cut lid panel
over the LCD screen, then feed 10mm
machine screws through the panel and
LCD, into the three tapped spacers
below.
Use the fourth 10mm machine
screw and single nut to hold the lid
onto the LCD screen using the remaining mounting hole, in the upper-right
corner.
If you aren’t planning to read meas70
Silicon Chip
urement data out to a computer via
the serial port and you are using the a
plugpack supply, then you only need
to make a hole in the box base for the
DC power jack. Otherwise, you will
also need to make a cut-out to access
the USB socket.
Make the holes in the lower half of
the UB3 case as using the drilling diagram (downloadable from siliconchip.
com.au) as a guide. Finally, attach the
lid to the top of the box using the supplied self-tapping screws.
Using it
This device will test just about any
type of diode including standard silicon diodes, schottky diodes, LEDs and
unidirectional or bidirectional transient voltage suppressors.
Having connected the device to both
of the test terminals, press the I/V Test
button on the screen.
You should hear two clicks and the
graph will be displayed. If you have
inserted the component backwards,
press Reverse to swap the plot around.
You can also touch the graph on the
touchscreen to display figures for various voltages and currents. Cursors appear to show the point being touched
and the relevant information is displayed in a second box on the bottom
left of the screen.
Pressing Back returns to the main
menu page. From there, press the LED
Test button to start the LED test.
The voltage and current limits are
set using arrow buttons at the bottom of
the screen. These are soft limits which
are controlled by the microcontroller,
so the readings may occasionally drift
above these settings. If this occurs, a
small red asterisk is shown to alert
you to that fact.
The high voltage rail value is shown
at the bottom of the screen, and the
current device operating conditions
are shown along the right-hand side
of the screen.
Press Back again and then press Settings to go to the settings page. This
sets the various parameters for the
I/V Test mode (the LED test mode has
its settings shown on that screen, as
explained above). The Previous and
Next buttons scroll between various
items, while the Up and Down buttons change the values of those items.
There are seven settings available.
The first allows you to select either a
400mW or 1W zener; it automatically
sets the maximum and target power settings. If this is set to “Manual” instead,
the next two items can be used to set the
maximum and target power manually.
The following two items allow you
to manually set a conservative current
and voltage limit for I/V tests. When
running I/V tests, the test is stopped
if either of these limits is exceeded.
The final two items set the scale of
the graph. If, for example, the voltage
scale is set to 10V, then the horizontal
axis of the graph will span -10V to 10V.
Any time the “Back” button is
pressed from the Settings page, the
settings are saved to EEPROM. The
program uses a clever update method
so that EEPROM is not rewritten unless necessary, so going into the Settings menu and then exiting without
making any changes will not cause any
wear on the EEPROM.
In any case, the EEPROM is rated
for at least one million rewrites per
cell, so you would have to spend a
very long time making changes before
you’re likely to run into any problems
with the EEPROM!
SC
Resistor Colour Codes
Qty. Value
4-Band Code (1%)
5-Band Code (1%)
2 1MΩ
brown black green brown
brown black black yellow brown
2 100kΩ
brown black yellow brown brown black black orange brown
2 36kΩ
orange blue orange brown orange blue black red brown
2 30kΩ
orange black orange brown orange black black red brown
1 13kΩ
brown orange orange brown brown orange black red brown
6 10kΩ
brown black orange brown brown black black red brown
2 4.7kΩ
yellow violet red brown
yellow violet black brown brown
1 3.0kΩ
orange black red brown orange black black brown brown
9 1kΩ
brown black red brown
brown black black brown brown
6 470Ω
yellow violet brown brown yellow violet black black brown
1 100Ω
brown black brown brown brown black black black brown
2 62Ω
blue red black brown
blue red black gold brown
1 1.0Ω (1W, 5%)
brown black gold gold
Australia’s electronics magazine
siliconchip.com.au
|