welcome back to the hackaday emoticon
i'm contributing editor tom nardi and
i'll be introducing our next guest who
is perhaps best known to hackaday
readers as the creator of the open book
a very impressive and i think very
important project that aims to design a
fully open hardware ebook reader
but he's recently found himself with a
new obsession and today he's here to
talk to us about the lowly segment lcd
specifically how they can be reverse
engineered and ultimately bent to our
will so with that please join me in
welcoming uh joey castillo to morocco
awesome uh awesome thanks so much for
that introduction
um
so i'm joey and my talk today is about
kind of an old-school display technology
segment liquid crystal displays
we have a lot to cover but before i
start for those of you who don't know me
i figure i should do this uh who am i
and i can probably share my screen for
this part
let's
click on
screen share
desktop two
okay great
uh who am i
i'm at jose castillo on twitter where i
share a lot of my process working on
open source gadgets a little while back
i designed this thing called the open
book which tom just spoke about and then
recently i've been working on the sensor
watch it's a board swap for the casio
f91w wristwatch which is in pre-launch
at crowdsupply if you want to check out
that link down there
um it's in working on this
latest gadget that i've learned a lot
about lcd displays these sort of
old-school low-cost low-power displays
that you can find in lots of gadgets
from watches to pocket calculators
they're ubiquitous they're cheap and
they're seemingly ideal for repurposing
into hobbyist projects
before before we get to the talk though
let's just overview what segment lcds
are
they're generally small glass displays
and they tend to be monochrome just
black and white
they're very low power
this makes them attractive for battery
powered gadgets like wrist watches and
digital thermometers but could also make
them attractive for diy projects that
want to use energy harvesting or solar
power
and finally they have a fixed layout
which is to say you can't display
arbitrary shapes on them you're limited
to turning individual segments on and
off
um
this makes the layout of the lcd crucial
to how useful it can be for your project
the display up top for example with just
three and a half digits won't be as
versatile as the display on the bottom
with eight alphanumeric characters
this is why i'm super into repurposing
the lcds from existing gadgets
these displays tend to have useful
layouts for displaying a lot of
information like this casio calculator
watch
they're also often thoughtfully designed
by you know actual designers who do this
for a living this makes their designs
nice in a way that industrial lcds often
aren't
they also tend to be thinner and finer
pitched than off-the-shelf lcds the f91w
lcd is sort of staggeringly thin it's
only a millimeter thick and it's small
enough to fit in a 38 millimeter watch
case the finer pitch also allows for
more segments to be addressed in this
already small area
they're also just fun uh here's the
watch here's a watch with the sensor
watch board swap installed i've taken
the f91 w's display which is only meant
to display the time and date and i've
repurposed it to be a temperature
display 76.6 degrees fahrenheit now it's
not perfect the 7 is sort of a shorty
lowercase 7 and the decimal point is a
hyphen since there's no decimal point in
this design
but if you're willing to embrace the
limitations you can take a small
well-designed display and coax it into
doing all kinds of interesting stuff
okay so let's set the agenda today i'm
going to talk about how you can find
these lcds in the wild and bend them to
your will first i'm going to introduce
segment lcd tech show off some of how it
works and explain what's required to
drive very basic lcds
next we're going to look at more complex
lcds through the lens of the classic
wristwatch that i used to build the
sensor watch
then we're going to use what we learned
in sections 1 and 2 to reverse engineer
the lcd in a much more complex watch
and finally if we have time i'm going to
share some of what i learned designing a
custom lcd of my own so that's a lot so
let's jump right into it chapter one
intro the tech
i figured i'd start with the compare and
contrast with the technology a lot of
folks here are probably familiar with
segment leds
on their face they look kind of similar
each segment has a pin and there's also
a common pin so for a seven segment
display like this you'd need to run
eight wires to each digit
i've drawn a diagram here for how that
works and i actually found that i had to
draw two diagrams because you'll always
find that these segment led displays are
either common cathode or common anode
that's because for a segment in the
display to glow current has to flow from
the anode to the cathode it's a complete
dc circuit
you'll still use eight wires with an lcd
but the first difference is in how the
display works current doesn't really
flow anywhere in an lcd instead segments
are energized when a difference in
voltage exists between the common and
the segment electrodes
you can imagine an lcd segment as being
a little capacitor with the special
property that when there's a difference
in charge between the segment pin and
the common pin it will darken and become
opaque
that common pin is neither anode nor
cathode because you drive an lcd with an
alternating signal sometimes com is high
other times it's low lcds don't like a
static charge building up on either side
so you have to alternate the polarity of
the charge what do i mean by that well
here's what it looks like and i beg you
please stick with me through these scope
traces i promise they're going to make
sense by the end
um the voltage differential between the
common and segment pin has to be above a
certain threshold for a segment to turn
dark or energized
typically that's between three and five
volts but let's just go with three for
now
here we're looking at one common pin in
cyan and one segment pin in yellow the
difference between the two is in purple
you can see that when the common and
segment pins get the same square wave
there's no voltage difference and the
segment is not energized
but when the segment pin's wave is
inverted
relative to the common pin suddenly the
voltage differential is plus or minus
three volts that's enough to energize
the segment
the cruxy bit is that this has to be an
ac signal with no dc bias
the frequency will depend on some
factors but don't worry about it too
much for now for now let's give it a
whirl and let's do it really simply this
is a circuit python script and it should
be easy to see what it's doing
it's setting up digital outputs for one
common pin and a bunch of segment pins
as well as a button input
when we loop we repeatedly set com high
and low by toggling this phase variable
if the button is up we set all segments
to the same value as com which gives
them all the same square wave but if the
button is down we set our on pins to the
opposite value giving them the opposite
wave
so let's check it out
um
so here i have my uh metro m4 which i've
set up with this button and uh my wire
is going the display so the com pin i've
actually tied to the led here so you can
see it flashing high and low that's
actually the frequency of the wave we're
feeding this lcd so we're not talking
megahertz or even kilohertz here this is
in the dozens of hertz you can see it
with your eye
so right now they're all getting the
same square wave but when i press the
button it's energizing the segments that
are saying hi
by by inverting the wave on those
segments
um i also have my little uh pocket
oscilloscope here and it's showing the
difference between com and seg which is
zero until i press the button and then
it becomes plus or minus three volts
okay
so that is segment section one
to recap quickly
lcd segments are basically little
capacitors that turn dark when they're
charged
these displays are low power because
current isn't really flowing anywhere
they do need to be driven by an ac
signal this part is important uh the
astute viewer might be thinking hey i
could energize a segment by holding comm
low and seg high and that is true you
could but it'll break your lcd after a
while so don't do that
finally the key is to keep the driving
voltage across the segment below the
threshold to turn the segment off and
above the threshold to turn the segment
on
keep that in mind as we move right along
to section two multiplexed displays
so at this point you should have the
gist of how lcds work
now we're going to take these basics and
apply them to a more complex display the
display on our dear friend the casio
f91w
so you'll notice there are a lot of
segments on the left there they're all
driven by the row of pins on the top of
that green circuit board but there are a
lot more segments than pins which begs
the question
how do they pull that off what gives and
the answer is lcd multiplexing so in
short where that screen from our demo
had one common backflame the f91w's lcd
has three
that means three common pins and the
rest 24 of them are segment pins
whereas in the demo the comm pin was
linked to all of the segments in this
watch each common only touches about a
third of touches a third of the segments
and whereas in our demo each segment pin
was linked to one segment in this
display each segment line is linked to
three
the important thing here is that each
segment that you want to address
individually will have a unique common
segment mapping
okay so yeah i admit that diagram was a
lot to take in to make it easier on
ourselves let's consider one segment in
isolation
this is segment a of the last digit in
the clock which ticks the seconds we
would call this com2 seg19 just
numbering each pin from the left to
right
you'll see that while com2 is linked to
a whole lot of segments 24 of them all
tinted in red seg19 is only linked to
the three segments tinted in blue
only the purple segment segment a of the
seconds display is linked to both com2
and seg19 and that's the key to how we
can address it individually
so before we do this ourselves let's see
how the f91w energizes this segment
since the watch ticks once a second from
zero to nine this top segment will be
energized and de-energized fairly often
it's off when displaying the digits one
and four and it's on the rest of the
time
we're going to use a 1990s era tektronix
2211 scope to visualize how the f91w
achieves this
so
here i have my uh f91w movement plugged
into these oscilloscope probes and the
scope is showing us com2 up top and
seg-19 on the bottom
so
com2 seg19
technically that's the inverse of seg19
but uh bear with me for a moment so
the interesting part comes when we
subtract seg19 from com2
so now we're seeing a lot of different
waves but the key is that there's really
two peak voltages plus or minus three
volts and plus or minus 1.5 volts
okay so
what did we see here and what can we
learn from it
first right at the outset we saw the two
waveforms separately we saw that the com
waveform didn't change at all it's just
delivering three voltage levels
repeatedly
we also saw the segway form with just
two voltage levels and that it changes
from time to time
next when we subtracted one from the
other we saw several different waveforms
but really two peak voltages plus or
minus three volts and plus or minus 1.5
volts this tells us the voltage we need
to energize a segment this is a 3 volt
display
so you might be asking yourself in that
middle photo the segment only hits 3
volts about a third of the time why is
that what about those other moments in
between the plus or minus three volt
peaks and the answer is those are time
slots for the other segments remember
sega 19 is controlling three segments on
this watch and we're only looking at it
in relation to com2
0 and com1 are also doing their thing
and plotting 719 against each of those
would yield a different trace
so our workshop the prepared also has a
more modern scope with four inputs and
we can use that to visualize the waves
in more detail here we have our segment
19 waveform in yellow and our com0 com1
and com2 waveforms in cyan pink and blue
it's actually easier to see this if i
stack up all the comm signals so
looking at the top there you can see six
distinct phases in the period of this
wave
com zero has a beat at three volts then
two beats at one point five volts a beat
at zero volts two more beats at one
point and then and then two more beats
at one point five volts
basically over the course of the wave
each com signal has a chance to be at
its maximum and minimum value once
and the other signals hang out at 1.5
volts in between to give them their turn
this is how we're going to get to the
key terms for this slide duty and bias
with three comm lines we have three
chances for each common to hit its
maximum and minimum voltages that makes
this a one-third duty waveform not
coincidentally that corresponds to the
number of comp pins that we have
bias refers to the intermediate voltage
level involved in driving the lcd
looking at the common waveforms up top
you can see three voltage levels 0 volts
1.5 volts and 3 volts that 1.5 volts
makes this a one-half bias waveform
three volts divided two ways
if you had intermediate steps of one
volt and two volts it would be a
one-third bias waveform as in three
volts divided three ways
these two terms combine to describe the
waveform one third duty refers to the
number of comp pins and one-half bias
refers to the single 1.5 volt bias
voltage in between 0 and the lcd voltage
the line in purple again is showing us
the difference between an on state and
an off state for this segment looking at
com 0 this time
the important thing to note is the com
waveforms never change look at the state
of the yellow seg wave right after that
first cursor in that trace at the top
it's high when com 0 is high which adds
it to 0 volts segment off
when com 0 goes to 1.5 volts no matter
what seg19 is doing the difference
between the two can't be more than 1.5
volts
that's something but it's not nearly
enough to hit that three volt threshold
so the segment again remains
off now look at it in the trace at the
bottom the segment line here is low when
com zero is high which adds up to
negative three volts segment on
this same process is repeating two beats
later with the opposite polarity it's
also happening the whole time with the
segments attached to com1 and com2
during com0's 1.5 volt phase so each of
those segments connected to seg19 are
getting their own unique waveforms that
can turn these segments on and off
independently
so i added this slide late but uh i
realized you might be looking at this
and thinking how am i supposed to
generate all these waveforms and bias
voltages anyway this seems complicated
well the good news is if you pick a
microcontroller with an integrated lcd
driver all this hard work is done for
you this is the data sheet for my
current favorite microcontroller the sam
l22 from microchip it's a lot like the
sam d21 but it has an lcd driver that's
fluent in the language of segment lcd
class
so if you use a chip like this instead
of trying to figure out how to generate
a waveform that turns off all of your
segments you can just write directly to
display memory
or if you want to go one level further
you can use vendor driver code that
abstracts even that away and lets you
deal with the lcd using function calls
like a civilized human
it's pretty cool to drive both your
logic and your display with one chip and
while this list isn't exhaustive there's
definitely a fair number of
microcontrollers out there that you can
use to drive an lcd without getting your
hands dirty
okay so here's a question how exactly do
you need to be with this like the
waveforms we were looking at do we have
to replicate that waveform exactly to
drive this lcd glass and the answer is
not necessarily
this lcd glass is a pretty simple thing
the sam l22 likes to drive a one-third
duty displays with a one-third bias
waveform which again involves
intermediate voltages of one and two
instead of 1.5 this display glass was
perfectly happy with that
again the key points are to drive the
segment above its threshold to energize
it to keep it below its threshold to
turn it off and to avoid any dc bias in
the waveform the sam l22 with its
integrated segment lcd driver is easily
able to check all of these boxes
okay we'll recap later for now we're
rolling right along into section three
we've covered the basics of lcd
technology and we've talked about how
complex displays use different
multiplexing schemes to drive displays
with more segments than pins let's take
those lessons and apply them to another
casio watch the casio databank this is a
really cool watch with a lot of segments
and a lot of buttons it would be a blank
canvas for displaying all kinds of cool
information if we could figure out how
to drive it so let's figure out how to
drive it
but first let's take it apart what do we
see inside well we have a back plate and
a rubber gasket and then a circuit board
sandwiched in between two assemblies one
for the battery and one for the display
the circuit board itself has 55 exposed
lcd pads 28 in the top row and 27 in the
bottom
finally we glossed over this point
earlier but i do want to point out the
two elastomer strips sitting in the lcd
assembly
these are commonly called zebra strip
connectors and they're the way the lcd
actually connects to the circuit board
i do want to stop here for a quick
detour on these elastomer strips because
if you do try to upcycle an lcd you're
almost certainly going to run into them
these are called zebra strips because
they have many conductive stripes
you might also see them referred to as
ledge connectors since they mash up
against the ledge of glass with the
electrodes which you can see reflected
there in the glass
the idea here is that your display's
electrodes have the exact same spacing
as the pads on your pcb
and the zebra strip is way denser so
when it gets squished in between there
will be at least a few stripes making
contact which makes a vertical
connection between the board and the
glass
they do require very precise alignment
especially for a fine pitched lcd like
the one in the wrist watch but on the
plus side any gadget that uses this
technology is going to come with a strip
that works and hopefully an enclosure
that holds it in place precisely
just don't lose it
okay back on track um let's reverse
engineer this databank lcd to do it
we're going to need some tools scissors
an oscilloscope and blue painters tape
actually later on i reshot some of this
with kapton tape but you can just use
plain scotch tape all we're doing is
taping over one pad to break the
connection between the lcd glass and the
pcb
why are we doing this well we're doing
this because some of these pins are
common pins and some of them are segment
pins and before we do anything else
we're going to have to figure out which
ones are which
so with this one leftmost pin covered up
we reassemble the watch and we get this
screen which looks pretty similar not
much has changed but there's a sneak
trick with a lot of casio watches if you
press both left buttons and the bottom
right button at the same time oops
there we go you can turn on all the
segments in the watch
when we do that we can see that we lost
five segments two of them in the dot
matrix and three down there in that year
display which brings us to the first
guideline for reverse engineering these
things if a few segments turned off when
you covered a pad you've found a segment
line
this should make sense if you recall our
diagram from earlier
the comm line sweeps across a vast swath
of the display but the seg line only
touches as many segments as there are
comm lines
the fact that we lost five segments when
we covered this pin strongly hints to me
that there are five comm lines it's not
a guarantee sometimes segments can be
shared but that is my suspicion at this
point
okay moving on let's try covering up one
pin on the opposite side of the board
what happens then
answer we lose a ton of segments which
brings us to the second guideline if a
lot of segments turned off when you
covered a pad you've found a common line
this should follow from the diagram but
let's just throw it on screen again
the comm line intersects with as many
segments as there are seg pins so if we
had five comm lines we'd expect losing
one to lose us about a fifth of the
segments
okay so now i'm just gonna start
covering up pads on the right side of
the board here it is with one pin
covered
and covering a second one again we lose
a big chunk of the display this is
another comm line
third pin another 20 of the display is
gone
fourth pin only 50 segments remain 34 in
the dot matrix and 16 down at the bottom
and with five pins covered the whole
display goes blank so get this by
covering five pads with plain old scotch
tape we've discovered not just which
pins are the commons but also half of
the segment mapping because if you look
at the segments that were left when only
that last com was working com0 again
numbering from left to right uh we know
all of those red segments must be
attached to com zero working backwards
based on when we saw the segments turn
off we have all of the com lines mapped
out
moreover we can combine that with what
we saw when we taped off the top left
pin seg0 again numbering from left to
right
and we now have full segment addresses
for five segments of the display those
two in the matrix and the three on that
bottom row
so there's one last step to know how to
drive this display and that's to figure
out the voltage required to turn on a
segment
we'll use the scope for that but before
we do i find it helps to locate one
segment that toggles fairly often
ideally i'd like to find a segment in
the ones place of the seconds display
since all of them change at least once
every 10 seconds
in this case i just had a lucky guess i
just taped off one of the pads on the
right and it was the one that controlled
the seconds display so with that
to the scope
um i really wanted to do this piece live
but it's a bit fiddly to keep the
movement clip down while measuring so i
have it on video but if you look at the
scope traces the key is that you can see
the peak to peak voltage of the com and
the seg pins and you can also see the
purple waveform changing de-energizing
the segment from time to time so we know
we're on the right track
okay so what do we what did we learn
from this well we know the duty is
one-fifth because there are five comp
pins we also see three non-zero voltages
making this a one-third bias waveform
the most important thing though is we
were able to measure the peak-to-peak
voltage on the com and the seg pins and
it looks like just about 4.1 volts i
actually measured this again later with
a full battery and got 4.5 volts but
either way it means my favorite lcd
oriented microcontroller the sam l22
can't drive this display since it maxes
out at 3.6 volts
but that doesn't mean it's impossible
i'm going to throw up that list from
earlier the one that showed chips with
built-in lcd drivers and i get the sense
that this pic16 has the oomph required
to drive a four four and a half volt lcd
with 53 pins it might not be able to
drive all of the segments but you could
get pretty dang close
okay so let's recap this back third of
the talk
we talked about multiplex lcds and
addressing them by their common and
segment pins
we looked at some of the waveforms that
drive these multiplexed lcds and we
talked about how duty and bias work
we talked about microcontrollers with
lcd drivers that can help wave away some
of these complexities
but we also saw how understanding these
concepts gives us the ability to poke at
lcds in the wild and understand how they
work
so it looks like we have time so this is
the bonus round in which your speaker
discovers that it's actually not that
impossible to have your own segment lcd
manufactured
this is the sensor watch dev board it's
in a feather form factor and if that if
that lcd layout looks familiar there's a
reason it's specifically designed to
match the pin out and layout of the f91w
lcd
why do a custom lcd well the answer will
vary from project to project but in my
case i needed something specific i
wanted to make a board whose display
matched the one on the sensor watch so
folks could test their apps more easily
to do that i needed a screen that
matched the f91ws
you may also have design constraints in
my case the existing f91w lcd was too
small too thin and too fragile for this
application i tried it it barely worked
i almost crushed it to death
um this also only makes sense if you
want to make a lot of them so there's an
initial tooling cost that can range from
hundreds to over a thousand bucks
i bit the bullet and did it because i
hope to end up making a lot of these but
it's not ideal for making just five or
ten of something
but if you want to make a thousand of
them you could end up spending as little
as a dollar each for a display this size
if you wanted to make 10 000 of them you
could end up spending even less per
display
one note this is not to say that you can
spend a thousand dollars for five
prototype displays you'll need to work
with a manufacturer and their whole
process is oriented around figuring out
the tooling and then making a reasonably
large run of the same display so it's
not for everyone but if you're building
a product and you need something more
custom this process could make sense for
you
okay so to make a custom segment lcd you
can use just about any vector graphics
program inkscape illustrator whatever
your manufacturer may ask for an autocad
dwg of your design but i was able to
provide an svg and it worked just fine
personally i used affinity designer to
lay this out and it worked great
remember you can't draw more segments in
your design than you can actually
control
the number of segments you can drive is
going to be equal to the number of comm
pins in your design times the number of
segment pins
but you can tie multiple segments
together for example the pm and the
signal icons those are just one
addressable segment same with those
three segments of that weird number in
the date display
you can turn all three of those segments
on or off but you can't control them
individually it's a trade-off right it
makes that position only good for
displaying the numbers one two and three
but it means you only need four
addresses for that digit instead of
seven
next you'll wanna drop a data sheet some
lcd fabricators will just take your
drawing and make it happen but if you
provide some more details you can have a
lot more control over the outcome
so you'll want to specify dimensions
remember there are going to be
manufacturing tolerances so this is just
a you know nominal dimensions sort of
thing they will come back to you with
final dimensions for your approval
you'll also need a bit of margin on the
edges because they need to seal the
glass and you can't have any segments in
the area where they do that
optionally you can specify a segment map
they can just pick a map and route it
for you but if you have constraints like
i did you can specify it
note that they may not be able to able
to accommodate your segment map routing
an lcd is a lot like routing a single
layer board so if your layout is
particularly complex they may not be
able to route it but you can at least
specify certain things that are
important to you and i hope and you can
hope that they can accommodate it
finally you need to specify some
required parameters and i'll just go
over them very quickly
tn or twisted pneumatic is the most
common type of lcd it's cheap and it
works well for segment lcds
viewing direction basically it refers to
the angle folks will view it at it's
like the clock hands if you're looking
at it from slightly below like a
wristwatch it'll be six o'clock if
you're looking at it from slightly above
like a desk clock it'll be 12 o'clock
polarizer mode there's two pieces to
this positive means it's a light display
with segments that darken when they're
energized and uh
negative is that cool inverse look where
it's all black and the segments turn
light
transflective has to do with the
polarizer on the back of the glass uh
transparent is totally see-through like
a heads-up display reflective is totally
opaque
transflective tends to be the best of
both worlds it has a backing layer so
you can see the display but it's
semi-transparent so you can also light
it from behind
driver method we talked about duty will
match the number of comm pins in your
design and your lcd lcd driver's data
sheet will likely recommend a bias
scheme for a given duty
ratio operating voltage again you just
want to ask for something that works
with your chip they made me a three volt
lcd it is pretty standard
temperature i didn't really care about
and then connection method i asked for
zebra strip which meant i needed to make
that 3d printed enclosure to hold the
whole thing together
it also meant that i had to find some
zebra strips on ebay you may want to
have them crimp pins on but this part is
entirely up to you
finally there are some notes but the
only one i want to call out is the
filling port so after they etch your
glass they need to fill the inside with
fluid that's the liquid in a liquid
crystal display this means there will be
a filling port bumping out from one side
of your display glass
it's just a small bump of glass about an
extra millimeter i asked for it on the
bottom they put it on the left in my
case it really didn't matter just know
that you'll have to account for that
bump in your enclosure design and again
they will send you a final data sheet
with all of these dimensions for
approval
finally you don't have to do this but i
just did it because i wanted to be sure
it would work
at some point someone is going to have
to route your lcd
this means physically laying out the
traces that will connect all of the
common and segment lines
again it's a lot like laying out a
single layer pcb
all the lines have to connect
they can't cross each other and there
are no vias to help you
i really don't know what tools the lcd
fab houses use for this all i know is i
used eagle and did some auto router
hacks to get a sense for it
i laid out a schematic with some parts
that resembled the pad layout for my
electrodes some single pin parts for
icons and some eight pin parts for the
segmented digits and i connected them up
to the comm lines i needed to lay out
i basically arranged them roughly the
way i wanted them to look on the lcd and
i had the auto router take a stab at it
same thing for the segment lines i just
assigned them all and let the auto
router do that job for me
okay so here's a question are these best
practices is this the right way to do
this and the answer is
i don't know really if anyone in the
audience has any insights as to what
tools they use to route these kinds of
things in the real world i'd love to
hear it please reach out for now i know
just know that it's what i did and it
worked for me and got me to a working
display
okay so wrapping up i hope this talk
offered some insight into making use of
lcd technology
we talked about how these little pieces
of glass are great for low power
projects
we talked about how they work and how to
recognize the different kinds of
waveforms that drive them
we also talked about how you can drive
them with peripherals designed for this
exact purpose
we talked about how these displays are
out there in gadgets all around you
and we talked about how you can unlock
their secrets
finally we also went over the basics of
how to design your own lcd for a device
if you can't find anything in the
salvage bin that fits your exact needs
so that wraps it up for me these slides
are available on the on the remote con
slideshare so you can download them and
check out some of my notes and i'll be
on discord if you have any questions but
you can also ask any questions on
twitter at josecastio
thank you