This is only a preview of the March 2022 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
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.
N
ext month, we feature a
High-current Four Battery Balancer project that 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.
We will reference the Battery Balancer throughout this artice, but it is
of course useful in many diverse applications. 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 2020 for this
purpose, but that board includes a
power supply for the isolated device,
which often isn’t necessary.
That makes the board much larger and more complicated than nec14
essary. In cases where both of the
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
diameter heatshrink tubing. Despite
this small size, it isn’t hard to build.
By Tim Blythman
These same-size renders of the front
(left) and rear (right) of the Mini
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
shown above were taken directly from
the new Altium Designer 21.)
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Ω pullup 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.
Alternatively, all six pins of CON1
can be soldered to a CP2102-based
USB-serial module, thereby allowing the combination to plug straight
into a computer.
Note that only four pins are connected in either case. For the CP2102
Practical Electronics | March | 2022
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 to.)
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 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.
The sharp-eyed among 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.
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
Features and 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 and RX high) and 13mA
(TX and RX low), average ~6mA
• Supply current (5V): between 0mA (TX and RX high) and 23mA
(TX and RX low), average ~10mA
• Offset voltage: up to 100V DC or 60V AC between GND on
either side.
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 have used
previously. 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 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. However, this will
limit the maximum baud rate because
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
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
l
l
Mini Isolated
INI ISOL
S ISerial
L LINLink
Practical Electronics | March | 2022
15
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.
we would expect the results might 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
errors at all, nor at 38,400 baud.
Non-serial data uses
Note that the Mini Isolated Serial
Link can also be used in situations
where it does not carry serial data. It
will work at any speed down to DC,
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 simply
use a short wire link to bridge two
pads if you are sure you won’t 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
than general 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 and available from
the PE PCB Service. Refer to the PCB
overlay diagram, Fig.2, to see where
the parts go.
Parts li s t –
I s olated S eri al L i nk
1 double-sided PCB coded 24102211,
26.5 x 23.5mm available from the
PE PCB Service
2 6N138 optoisolators (DIP or gullwing
SMD; see text for alternatives)
2 1kΩ SMD resistors,
M3216/1206 imperial size
(see text for alternatives)
2 220Ω 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
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.
Reproduced by arrangement with
SILICON CHIP magazine 2022.
www.siliconchip.com.au
This oversize photo show how you could connect two computers over a serial link while providing opto-isolation. Two
CP2102s are connected to the 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.
16
Practical Electronics | March | 2022
in place. Finally, fit the headers you
need and/or solder the board to another device like a CP2102 module
(or next month, the Battery Balancer) as needed.
ESR Electronic Components Ltd
All of our stock is RoHS compliant and CE
approved. Visit our well stocked shop for
all of your requirements or order on-line.
Testing and usage
The Mini Isolated Serial Link is a
simple enough design that it should
Again, reproduced oversize,
‘just work’ as long as you exercised
this
shows
Miniand
Isolated
We
canthe
help
advise with your enquiry,
care during construction. However,
erial
Link
with
a
CP2102
on
from design to construction.
if you must test it first, use the arone side (with blue jumper
shunt setting this side to
rangement shown with two CP2102
3.3V) and a four-way header on the other side. The second side has a red jumper
modules and open two serial termishunt fitted to source power from the topmost pin on the four-way header.
nal programs
on your
computer.
JTAG Connector
Plugs Directly
into
PCB!! We
3D Printing • Cable • CCTV • Connectors • Components •
find that TeraTerm is a simple but
Enclosures • Fans • Fuses • Hardware • Lamps • LED’s •
No Header! No Brainer!
Leads
• the
Loudspeakers
Panel You
Meters
You may •be able to feed the leads versatile terminal program (and it’s
Solder
remaining• pins.
can• PCB Production
Power
• Relays
• Resistors
• Semiconductors
into one side,• then use the PCB to bend nice and free!).
flip
the Supplies
board over
and apply
more
Soldering
Irons •the
Switches
• Transformers
There will be more information for
the
leads so that the other side can be
solder
through
holes •inTest
theEquipment
pads
and
so
much
more…
rotated into place, allowing the leads use with the Battery Balancer next
if you want to be sure they are conMonday
to Friday 08:30 - 17.00, Saturdayto
08:30
- 15:30
spring
back and hold the part in month on how to connect two Balancnected
properly.
place (or use flat pliers or an IC lead ers using the Mini Isolated Serial Link.
Fit the resistors and capacitors
Essentially, once they are connected,
straightening tool before insertion).
similarly. Check each part against
Check that the pin 1 markers are they should automatically detect each
the photos and overlay.
towards the edge of the PCB then sol- other and begin communicating so
Secure each part in the correct
Our patented range of Plug-of-Nails™ spring-pin cables plug directly
thatand
they
act holes
as a in
single
five-to-eightder one pin. Check thatinto
the
parts
are of pads
place with one pin before soldering
a tiny
footprint
locating
your PCB,
eliminating
batterySave
(orCost
cell)
balancing
flat, then solder the remaining
the remaining pin. Our photos show
the need forpins.
a mating header.
& Space
on Everyunit.
PCB!!
Our. MSP430
photos
show
various
other
If you are using pinSolutions
headers
and
large but shiny balls of solder. In this
for: PIC
. dsPIC . ARM
. Atmel
. Generic
JTAG . Altera
Station Road
ways of. SPI
connecting
the Mini. &Isolated
jumpers,
fit these next.Xilinx
If setting
the . SPY-BI-WIRE
case, as long as there are no bridges,
. BDM . C2000
/ IIC . Altium Mini-HDMI
More
Cullercoats
supply
options (JP1, JP2) permanent- Serial Link.
more solder is better than not enough.
North Shields
Because of the inherent symmetry,
ly,
use&short
If you are using through-hole opTyne
Wear lengths of tinned copper
NE30
you can
treat
eachsq.side
thesqPCB
wire
(or4PQ
component lead off-cuts
youfootprints
toisolators, fit them now. Gently bend
Tag-Connector
as small
as 0.02
inch of
(0.13
cm) inmight have from another build) and dependently to mix and match what
the
leads
to2514363
allow them
to slide into www.esr.co.uk
Tel:
0191
sales<at>esr.co.uk
trim the excess after soldering them you are connecting to it.
the holes.
www.PlugOfNails.com
BACK ISSUES
Practical
Electronics
Your best bet since MAPLIN
Chock-a-Block with Stock
The UK’s premier electronics and computing maker magazine
Circuit Surgery
Timing and metastability
in synchronous circuits
Build an RGB display project
using a Micromite Plus
The UK’s premier electronics and computing maker magazine
Circuit Surgery
Audio Out
Make it with Micromite
Timing and metastability
in synchronous circuits
Construct a
transistor radio
Frequency Reference Mastering
Signal Distributor
RFID tags for
your projects
Practical
Electronics
WIN!
Microchip
Curiosity HPC
Development
Board
Make it with Micromite
Fun display project
using a Micromite Plus
Nutube Guitar
Overdrive and
Distortion Pedal
WIN!
<at>practicalelec
Circuit Surgery
Transformers
and LTspice
Programmable
Thermal
Regulator
Audio Out
Make it with Micromite
Accessing Internet data
with your MKC
Superb microphone
preamplifier
Touchscreen
Wide-range
RCL Box
WIN!
Microchip
MCP19114 Flyback
Standalone
Evaluation
Board
Apr 2021 £4.99
04
9 772632 573016
practicalelectronics
PLUS!
Techno Talk – No blame, no shame?
Cool Beans – Round-up of NeoPixel effects
Net Work – Videoconference cameras
www.electronpublishing.com
<at>practicalelec
Mar 2021 £4.99
03
9 772632 573016
practicalelectronics
PLUS!
Flowerpot speakers!
A low-cost route to
high-quality Hi-Fi
PIC n’ Mix
Software tools for
the PIC18F
Ultrabrite LED
bike light
WIN!
Microchip
Explorer 16/32
Development
Kit
Fabulous low-cost
Concrete speakers!
<at>practicalelec
Jun 2021 £4.99
06
9 772632 573016
practicalelectronics
The UK’s premier electronics and computing maker magazine
Make it with Micromite
Circuit Surgery
Understanding
Differential amplifiers
Analogue inputs and
using servomotors
Don’t miss
our Super
Random
Number
Generator
Audio Out
Constructing the PE
Theremin amplifier
Circuit Surgery
Micro-Cap 12
simulator review
WIN!
Microchip
MPLAB Starter Kit
for Serial Memory
Products
WIN!
Meet the
Micromite
Clever Controller
for dumb chargers
Hi-Fi amp on
the cheap!
Making a
splash with
NeoPixels!
Building the
Low-noise
theremin PSU
PLUS!
<at>practicalelec
Sep 2020 £4.99
09
9 772632 573016
practicalelectronics
Fun LED
Christmas
Tree offer!
PLUS!
Techno Talk – Triumph or travesty?
Cool Beans – Mastering NeoPixel programming
Net Work – The (electric) car’s the star!
www.electronpublishing.com
<at>practicalelec
Dec 2020 £4.99
12
9 772632 573016
practicalelectronics
We can supply back issues of PE/EPE by post.
We stock magazines back to 2006, except for the following:
2006 Jan, Feb, Mar, Apr, May, Jul
2007 Jun, Jul, Aug
2008 Aug, Nov, Dec
2009 Jan, Mar, Apr
2010 May, Jun, Jul, Aug, Oct, Nov
2011 Jan
2014 Jan
2018 Jan, Nov, Dec
2019 Jan, Feb, Apr, May, Jun
Issues from Jan 1999 are available on CD-ROM / DVD-ROM
If we do not have a a paper version of a particular
issue, then a PDF can be supplied – your email address
must be included on your order.
Please make sure all components are still available before
commencing any project from a back-dated issue.
Practical
Electronics | March | 2022
70
O r p h o n e o u r f r i e n d l y kn
o w l e d g e a b l e st a f f o n 020 8452 0161
Components • AudioWanted:
• Video • Connectors • Cables
Arduino • Test Equipment
etc, etc
Electronics
Enthusiasts
Completing the
High-power 45V/8A
Variable Linear Supply
Cool Beans – Even cooler ping-pong ball lights!
Net Work – IP security cameras
Techno Talk – The perils of an enquiring mind...
www.electronpublishing.com
Visit: www.cricklewoodelectronics.com
Practical
Electronics
WIN!
Robot Buggy
Ultrasound
sensing!
Techno Talk – Bad science and good
Cool Beans – Smoothing LED colour transitions
Net Work – Lockdown technology and how we now work
www.electronpublishing.com
Practical
Electronics
Mastering stepper
motor drivers
Roadies’ Test
Signal Generator
Tunable HF
Preamplifier
Make your own PCBs
with our precision
Solder Reflow Oven
Techno Talk – Tin whiskers scourge
Cool Beans – Bouncing around the Maxiverse
Net Work – Hydrogen: a viable alternative to batteries?
www.electronpublishing.com
The UK’s premier electronics and computing maker magazine
WIN!
Microchip
PIC24F LCD and
USB Curiosity
Development
Board
Meet the Cricket:
making IoT designs
super easy!
Programmable
Thermal
Regulator
PLUS!
Audio Out
How to make a
transistor radio
Superb PE PIC
Development
Board
Practical
Electronics
–
N NEW E
EW
PE
D NA –
ES M
IG E
N
!
Practical
Electronics
–
N NEW E
EW
PE
D NA –
ES M
IG E
N
!
BACK ISSUES – ONLY £5.95
If circuits interest you, you might like to apply your interest in a
career in electronics.
Vectawave Technology is a UK manufacturer of RF
equipment, and we are looking for people who have the
potential to become engineers and technicians to work on our
projects.
Our backdrop of the
Isle of wight offers a
pleasant environment
for those with a creative
flair.
Qualifications needed range
from HNC for technician
level through to degree for a
V i siengineer.
t o ur S ho p, Call o r Buy o nli ne at :
project
Apply to:
accounts<at>vectawave.co.uk
V i si t o ur sho p at :
w w w . cri ck lew o o delect ro ni cs. co m
020
8452
0161
Vectawave
Technology
Ltd, Newport, Isle of Wight PO30 5XW
40-42 Cri ck lew o o d Bro adw ay
L o ndo n N W 2 3E T
17
Practical Electronics | February | 2022
|