This is only a preview of the March 2021 issue of Silicon Chip. You can view 36 of the 112 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. Items relevant to "High-Current Four Battery/Cell Balancer":
Articles in this series:
Items relevant to "Mini Isolated Serial Link":
Items relevant to "Battery Multi Logger - Part 2":
Items relevant to "Electronic Wind Chimes - Part 2":
Purchase a printed copy of this issue for $10.00. |
Mini Isolated
Serial Link
This tiny module (about the size of a postage stamp) provides
bidirectional, isolated, full-duplex serial communication. That makes it
ideal for when two (or more) boards running from separate supplies need
to pass information to each other. It can also carry isolated logic signals.
Among its many other uses, it can be used to join two of the Battery
Balancers (described in this issue).
By Tim Blythman
T
he High-current Four Battery
Balancer project starting on
page 21 can handle more than
four batteries (or cells) by stacking
multiple units.
But for that to work, they need to
communicate with each other, even
though their ground potentials will
be quite different; possibly as much
as 60V DC apart.
To connect their onboard serial
links so they can work as a single unit,
a serial isolator is needed. This little
device uses optoisolators to provide
thousands of volts of effective isolation while allowing the serial data to
pass through unchanged.
Another important use for a device
like this is connecting a computer to a
device that you’re testing, to prevent
any possibility of damage should the
device malfunction and feed a high
voltage to its serial pins.
If you have a single Battery Balancer
and wish to monitor or control its operation on a computer, it would be a
good idea to use this isolator between
the two, for safety.
We already published the Zero
Risk Serial Link in January 2019
(siliconchip.com.au/Article/11360)
for this purpose, but that board includes a power supply for the isolated
68
Silicon Chip
device, which often isn’t necessary.
That makes the board much larger
and more complicated than necessary.
In cases where both communicating
devices have individual power supplies, this design is a better choice.
New design
By dispensing with the power circuitry and using six passive SMDs,
we’ve managed to squeeze the required circuitry into a PCB that measures just 26.5 x 23.5mm.
That’s small enough to be connected inline with your serial link and
encased in a short length of large di-
These same-size renders of the front
(left) and rear (right) of the Isolated
Serial Link PCB show just how tiny it
is. Whether you use vertical header
pins, as shown here, or horizontal,
as shown in our photos, is up to you.
Incidentally, the renders were taken
directly from the new Altium Designer
21, which we reviewed in January
(siliconchip.com.au/article/14705).
Australia’s electronics magazine
ameter heatshrink tubing. Despite this
small size, it isn’t hard to build.
Fig.1 is the complete circuit diagram. The operation is simple. On
the transmitting side, a current loop
is formed between the TX pin and
the selected supply rail (3.3V or 5V)
via one optoisolator LED (OPTO2 for
CON1 and OPTO1 for CON2). This
is via a 220Ω current-limiting series
resistor.
So when the TX pin is high, no current flows through the LED, and when
it is low, about 10mA (for a 3.3V supply) or 18mA flows. This pulls the RX
pin at the opposite end low by activating the Darlington transistor in the
other half of the optoisolator.
When no current is flowing through
the LED, the Darlington is off, so that
pin is held high by a 1kΩ pull-up resistor.
The configuration is identical for
data flowing from CON2’s TX pin to
CON1’s RX pin as it is in the other
direction. A 100nF bypass capacitor
stabilises the voltage across the Darlington on either side.
Pin headers CON1 and CON2 are
identical, and could be soldered directly to one of the communicating
boards (eg, a Battery Balancer) using
four of the six pins.
siliconchip.com.au
Alternatively, all six pins of CON1
can be soldered to a CP2102-based
USB-serial module, allowing the
combination to plug straight into a
computer.
Note that only four pins are connected in either case. For the CP2102
module, the 3.3V, RX, TX and GND
pins are used.
JP1 gives us the flexibility to choose
which pin is used for power. If JP1 is
set to the 5V position, power is taken
from the pin next to GND on CON1.
For a CP2102 module, this is the 5V
USB supply.
However, it corresponds to the 3.3V
supply pin on the Battery Balancer;
the Battery Balancer’s serial port operates at 3.3V, so that is where we want
to connect.
For CP2102 modules, you would
generally place the jumper in the
3.3V position, which connects to the
supply pin marked 3.3V on those
modules.
Indeed, regardless of whether the
GND on either side is at the same potential, the Mini Isolated Serial
Link can also be used to provide
translation between different signalling levels.
To keep the PCB small, we have
not added a slot in the PCB to increase
the creepage distances, as this would
require a larger PCB area to prevent
the PCB from breaking when flexed.
Thus, the Mini Isolated Serial Link
is not suitable for mains voltage isolation.
Communication details
Practically all TTL serial communications we have seen have the signals
idling at a high level.
Because we have arranged the optos
Fig.1: the circuit is practically the
minimum necessary for a pair of
6N138 optoisolators. The
220Ω
Ω resistors in series
with the opto LEDs
limit the LED current
while the 1kΩ
Ω
pull-up resistor
holds the output
high when the
opto is off. The
100nF bypass
capacitors are
the minimum
specified in the
6N138 data sheet.
SC
Ó
siliconchip.com.au
Features & specifications
• Provides optically isolated bidirectional serial communications
• Baud rates up to 57,600 (using 6N138) or 1,000,000 (using 6N137)
• Each device can have 3.3V or 5V signal levels (ie, it can act as a level
shifter)
• Supply current (3.3V): between 0mA (TX & RX high) and 13mA (TX &
RX low), average ~6mA
• Supply current (5V): between 0mA (TX & RX high) and 23mA (TX & RX
low), average ~10mA
• Offset voltage: up to 100V DC or 60V AC between GND on either side
to only switch on when the input voltage is low, and because the Darlington
outputs pull low when active, the signal is not inverted across the device.
If we had terminated the TX current
loops to GND instead of the supply
rail, it would instead act as an inverter.
You might have noticed that we’re
using a different optoisolator in this
project compared to the Zero Risk Serial Link.
This option is slightly more spaceefficient for similar speeds.
Dual versions of the PC817 devices
used for the Zero Risk Serial Link exist,
but they are now obsolete, so we had
to find an alternative.
The footprint used by the 6N138 is
also very similar to that used by the
6N137 optoisolator that we used previously in the Flexible Digital Lighting
Controller (October-December 2020;
siliconchip.com.au/Series/351).
The 6N137 is a very fast device (up
to 10Mbaud), but requires a 5V supply to meet specifications.
In other words, if both sides of your
Mini Isolated Serial Link will operate
at 5V, you could replace OPTO1 and
OPTO2 with 6N137s and work at a
much higher speed, up to 1Mbaud
or possibly even more.
But because we wanted this design
to have the flexibility to work with devices using 3.3V signalling levels, as
it is very common (and a requirement
for use with the Battery Balancer), we
are using 6N138 parts instead.
The 220Ω resistor value is chosen
to work with both the 6N137 (at 5V)
and the 6N138 between 3.3V and 5V.
The 6N138 has much lower current requirements than the 6N137,
so you could increase those values
up to around 1kΩ if your transmitter
has limited current capacity, or you
l
l
MINI ISOLATED SERIAL LINK
Australia’s electronics magazine
March 2021 69
Fig.2: as suggested by
the circuit diagram’s
symmetry, the
component layout
and PCB traces are
also symmetrical if
rotated 180° about the
centre. Ensure that each
opto’s pin 1 faces towards the edge of the PCB. To keep the PCB small, we
have put the pin markings on its back. Both the overlay and photo are full size.
want to reduce the supply current
somewhat.
Similarly, the 1kΩ pull-up resistors
could be increased in value if the current consumption on the output side
is a problem. This will limit the maximum baud rate, though, as the circuit
depends on this resistor to pull the
output high promptly.
Our testing shows that this device
will work reliably up to 9600 baud
with 3.3kΩ LED series resistors (instead of 220Ω) and 10kΩ pull-up resistors replacing the 1kΩ types.
The 3.3kΩ value is the largest possible due to the nominal 0.5mA threshold current needed by the opto LEDs
for correct operation; the 10kΩ value
could go higher, but at risk of worse
interference rejection.
Maximum baud rate
and could simply be used to pass any
low-speed logic signals between two
systems, such as an error flag, reset
signal or on/off signal.
Option
The few options for this project
revolve around the connections to
CON1 (and identical CON2) and the
corresponding configuration of JP1
and JP2.
For connecting to a CP2102 module,
use a 6-way header (pins or socket)
to suit the module. In this case, the
associated jumper is set in the 3.3V
position.
While we have shown a pin header and jumper shunt, you could use a
short wire link to bridge two pads if
you will not change this configuration.
For our testing, we fitted the unit
with a 6-way female header socket
to allow a CP2102 module with a pin
header attached to plug in, as that
is how a CP2102 module typically
comes.
But you could reverse that, or just
solder the two together using a single
pin header.
For connection to 4-way header
on the Battery Balancer, it’s a case
of bridging the 5V pad on JP1 or JP2.
This means that the four central pads
on that side of the Mini Isolated Serial
Link (in the order 5V, GND, TX, RX)
are available for connection.
These four pins would also be the
preferred way of using the Mini Isolated Serial Link with jumper wires
or similar, if for no other reason but
neatness. You could use a 4-way socket header plugged into a 4-way pin
header on the Battery Balancer or even
solder it directly to the PCB.
We’ve built a few variants to show
in the photos, so you can see how
some of these options work. Since it
is a small and simple project, you can
make these selections once the other
parts have been fitted.
Construction
The Mini Isolated Serial Link is
built on a 27 x 24mm double-sided
PCB coded 24102211. Refer to the PCB
overlay diagram, Fig.2, to see where
the parts go.
If you are using SMD (gullwing)
optoisolators, fit these first; otherwise, leave the through-hole variants
until last.
Like any project using surfacemounted parts, solder flux, tweezers,
magnifiers and a fine-tipped iron are
handy to have, while solder braid
(wick) will help with solder bridges.
But this project is simple enough that
you might get away without them, as
long as your eyesight is good!
To fit the SMD optoisolators, align
the parts with their pads, noting that
pin 1 of each part is at the edge of the
PCB; the two parts are rotated 180°
relative to each other.
Tack one lead to its pad and check
that it is correct, especially that you
can access the pads on both sides of
the optoisolator and that all pins are
flat against their pads. If not, melt the
solder with the iron and tweak the part
until it is aligned and symmetrical.
Solder the remaining pins. You can
flip the board over and apply more
solder through the holes in the pads
The 6N138 datasheet indicates rise
and fall propagation delays of around
10µs and 1.6µs under typical conditions, setting a hard limit of about
100,000 baud as the bits will start to
run into each other.
A graph also indicates that the rise
delay increases with temperature,
which will further skew and distort
the data.
We did some tests with a CP2102
module plugged into each side of the
Mini Isolated Serial Link to see what
sort of speeds we could achieve with
the specified components.
This testing occurred at room temperature, so we would expect the results could be worse at higher temperatures.
Testing at 115,200 baud led to data
being corrupted about once every 20
bytes. This is not surprising given that
propagation delays noted above.
At 57,600 baud we didn’t see any
This oversize
photo show how you
errors at all, nor at 38,400 baud.
could connect two computers over
Note that the Mini Isolated Serial
Link can also be used in situations a serial link while providing opto-isolation. Two CP2102s are connected to the
where it does not carry serial data. It Mini Isolated Serial Link using female header strips at CON1 and CON2. The
jumpers JP1 and JP2 are set to the 3.3V position using blobs of solder.
will work at any speed down to DC,
70
Silicon Chip
Australia’s electronics magazine
siliconchip.com.au
Build the world’s most
popular D-I-Y computer!
ALL-NEW COLOUR
2
Again reproduced oversize
for clarity, this shows the
Mini Isolated Serial Link
with a CP2102 on one side
(with blue jumper shunt
setting this side to 3.3V) and a four-way header
on the other side. The second side has a red jumper
shunt fitted to source power from the topmost pin on the four-way header.
if you want to be sure they are connected properly.
Fit the resistors and capacitors similarly. Check each part against the photos and overlay.
Secure each part in the correct place
with one pin before soldering the remaining pin. Our photos show large
but shiny balls of solder. In this case,
as long as there are no bridges, more
solder is better than not enough.
If you are using through-hole optoisolators, fit them now. Gently bend
the leads to allow them to slide into
the holes.
You may be able to feed the leads
into one side, then use the PCB to bend
the leads so that the other side can be
rotated into place, allowing the leads
to spring back and hold the part in
Parts list –
Isolated Serial Link
1 double-sided PCB coded 24102211,
26.5 x 23.5mm
2 6N138 optoisolators (DIP or gullwing
SMD; see text for alternatives)
2 1kW SMD resistors,
M3216/1206 imperial size
(see text for alternatives)
2 220W SMD resistors,
M3216/1206 imperial size
(see text for alternatives)
2 100nF 50V X7R SMD ceramic
capacitors, M3216/1206 imperial
size
2 6-pin headers (CON1,CON2)
(see text for other options)
2 3-pin headers with jumper shunts
(JP1,JP2)
(see text for other options)
Jumper wires etc to suit your
application
siliconchip.com.au
Plastic
Case
Optional
See
SILICON CHIP
July & August
2020
place (or use flat pliers or an IC lead
straightening tool before insertion).
Check that the pin 1 markers are towards the edge of the PCB then solder
one pin. Check that the parts are flat,
then solder the remaining pins.
If you are using pin headers and
jumpers, fit these next. If setting the
supply options (JP1, JP2) permanently, use short lengths of tinned copper
wire (or component lead off-cuts you
might have from another build) and
trim the excess after soldering them
in place. Finally, fit the headers you
need and/or solder the board to another device like a CP2102 module or
Battery Balancer as needed.
480MHz,
32-bit processor;
9MB of RAM;
2MB flash memory;
800 x 600 pixel
colour display
Don’t miss your opportunity to
experience Australia’s own worldclass, world-famous single board
computer that you build and
program yourself, using the world’s
easiest programming language –
MMBASIC. Learn as you build!
Testing and usage
The Mini Isolated Serial Link is simple enough that it should just work
as long as you exercised care during
construction. If you must test it first,
use the arrangement shown with two
CP2102 modules and open two serial
terminal programs on your computer.
We find that TeraTerm is a simple but
versatile terminal program (and it’s
free to boot).
There will be more information for
use with the Battery Balancer next
month on how to connect two Balancers using the Mini Isolated Serial Link.
Essentially, once they are connected,
they should automatically detect each
other and begin communicating so
that they act as a single five-to-eightbattery (or cell) balancing unit.
Our photos show various other
ways of connecting the Mini Isolated
Serial Link.
Because of the inherent symmetry,
you can treat each side of the PCB independently to mix and match what
you are connecting to it.
SC
Australia’s electronics magazine
And it’s so easy to build
because all the hard work is done for you:
the heart of the Colour Maximite II, the
Waveshare CPU Module (arrowed) is
completely pre-assembled and soldered.
YOU SIMPLY CAN’T GO WRONG!
Short Form Kit includes:
Waveshare CPU module pre-loaded with MMBasic
the PCB – with solder mask and screen overlay
front & rear panels to suit plastic case shown above
and all other components required to build the
Does not include plastic instrument case,
Colour Maximite 2 CR12xx
cell or USB power supply/cable
14000
$
All this
for only
Plus $10.00 p&p in Aust
SILICON CHIP SUBSCRIBERS:
$AVE
10%!
Subscriber’s price just $126 plus p&p
Order now (or more information) at
www.siliconchip.com.au/shop/20/5508
March 2021 71
|