Need guidance for driving single-digit 7-segment LCDs.

I picked up these really cool (and large) single digit 7-segment LCDs. I thought they'd make a pretty sweet clock.

I thought since they have pins for each segment and a common, that I could just drive them like any old 7-segment LED. I popped one on my board and threw together a little sketch to turn on the appropriate segments.

So far so good.

I then tried to connect two together and multiplex them using the 7-segment LCD/LED library. That's when things got weird. It's supposed to display "88". However, it's hard to read and some of the segments drop out. I then changed the sketch to display "77", but it just continued to display a dimly/partially lit "88".

I wasn't aware at the time when I bought these that LCD displays need an AC signal. From what I gather, you can't just write COM LOW and a segment HIGH. It takes more than that, but I can't seem to get my head around it. Maybe I just got lucky with my first test. Thankfully, it doesn't seem as if I damaged them.

The clock is going to have 6 digits. So if I can't multiplex them, I suppose I could always use a Mega2560 and connect every segment to it's own pin. However, I'm still confused about alternating the signal between COM and the segment.

Can anyone offer some guidance as to how I should go about driving these?

Also, does anyone know if a current-limiting resistor is required, similar to LEDs? I've attached the data sheet.

LCD-S101D22TR-106379.pdf (52.5 KB)

http://www.ubasics.com/driving_static_lcds maybe helpful as the author uses a similar LCD display

Cool thanks. I think this is starting to make sense. I think I was overthinking it before. It's just a matter of flip/flopping HIGHs and LOWs.

I just found this too...

It might be of even more help since it's written for Arduino. I can't wait to get home from work so I can tinker with the code!

Yeah, it basically looks like you turn them on and off.

Since they are made of glass, are they rather "heavy"?

They look very sleek. I am wondering whether they would work nice as an outdoor address sign by putting them inside a plastic box.

They weight an ounce.

I used the code that I linked to in the previous post:

/ Data for digits 0-9 g.f.e.d.c.b.a.: 7 BITS ONLY
byte digs[] = { B0111111, B0000110, B1011011, B1001111, B1100110, B1101101, B1111101, B0000111, B1111111, B1101111 };
long previousMillis = 0; // will store last time LED was updated
long interval = 1000; // interval at which to blink (milliseconds)
byte count;

void setup() // run once, when the sketch starts
{
pinMode(9, OUTPUT); // COMMON DISP 2
pinMode(8, OUTPUT); // DISP2 Seg-G
pinMode(7, OUTPUT); // DISP2 Seg-F
pinMode(6, OUTPUT); // DISP2 Seg-E
pinMode(5, OUTPUT); // DISP2 Seg-D
pinMode(4, OUTPUT); // DISP2 Seg-C
pinMode(3, OUTPUT); // DISP2 Seg-B
pinMode(2, OUTPUT); // DISP2 Seg-A
}

void loop() // run over and over again
{
if (millis() - previousMillis > interval) {
previousMillis = millis(); // remember the last time we blinked the LED
if (++count > 9) count=0;
}

output(count,true);
delay(10);
output(count,false);
delay(10);
}

void output(byte a,boolean inv) {
byte val=digs[a];
if (inv) val = !val; // invert DC current
digitalWrite(9,bitRead(val,7)); // COMMON DSP 2
digitalWrite(8,bitRead(val,6)); // DISP2 Seg-G
digitalWrite(7,bitRead(val,5)); // DISP2 Seg-F
digitalWrite(6,bitRead(val,4)); // DISP2 Seg-E
digitalWrite(5,bitRead(val,3)); // DISP2 Seg-D
digitalWrite(4,bitRead(val,2)); // DISP2 Seg-C
digitalWrite(3,bitRead(val,1)); // DISP2 Seg-B
digitalWrite(2,bitRead(val,0)); // DISP2 Seg-A
}

However, the displays show some weird blotches.... like they're not uniformly lit. They also look kind of gray when viewed head-on. It's only at an angle that they appear black. I hope I'm not damaging them.

I'm still not clear if LCDs need resistors. Has anyone seen this behavior before? Am I doing something wrong?

So - where is the spec sheet?

Without that you are clueless.

You really need an LCD driver chip, and then one that the displays match.

If they have a single common, they cannot be multiplexed.

It's conceivable that you might be able to drive them, but you need a bipolar signal. A DC component will ruin them. Just pray you haven't already done that. You could generate a bipolar AC signal by using two digital outputs that are of opposite polarity. Make sure they're always alternating, or you will have the dreaded DC present. To turn it off, just set both outputs to the same level. Multiplexing is not going to give good results. Forget about the code on that site. It's pure junk.

Where did you get them?

Paul__B:
So - where is the spec sheet?

Without that you are clueless.

You really need an LCD driver chip, and then one that the displays match.

If they have a single common, they cannot be multiplexed.

The spec sheet, LCD-S101D22TR-106379.pdf, is attached up top to my first post. It's not very helpful. That's all that's on their website.

Thanks for the tips. I found the displays on eBay. I ordered some LCD driver chips from Digikey. With any luck, they'll work.

ryemac3:
The spec sheet, LCD-S101D22TR-106379.pdf, is attached up top to my first post. It's not very helpful. That's all that's on their website.

Oh yes, so it is.

Well, it does tell you two things. Operating voltage: 5 AC, and Driving methode: "Static". Which is difficult to interpret but essentially tells you that you cannot multiplex them.

The OP is attempting to use AC drive, but was misled by a posted program that is horribly incorrect. The displays may have already been damaged by DC.

The following won't work -- the "!" operator is misused here.
All the bitRead() values have to be complemented instead.

void output(byte a,boolean inv) {
byte val=digs[a];
if (inv) val = !val; // invert DC current
digitalWrite(9,bitRead(val,7)); // COMMON DSP 2
digitalWrite(8,bitRead(val,6)); // DISP2 Seg-G
digitalWrite(7,bitRead(val,5)); // DISP2 Seg-F
digitalWrite(6,bitRead(val,4)); // DISP2 Seg-E
digitalWrite(5,bitRead(val,3)); // DISP2 Seg-D
digitalWrite(4,bitRead(val,2)); // DISP2 Seg-C
digitalWrite(3,bitRead(val,1)); // DISP2 Seg-B
digitalWrite(2,bitRead(val,0)); // DISP2 Seg-A
}

Single ended AC won't work anyway. There's still a DC bias.

Where do you get single ended AC? There are two outputs that flipflop, which is the standard approach.

I think this will work:

void output(byte a,boolean inv) {
byte val=digs[a];
if (inv) val = ~val; // invert differential voltage

digitalWrite(9,bitRead(val,7)); // COMMON DSP 2
digitalWrite(8,bitRead(val,6)); // DISP2 Seg-G
digitalWrite(7,bitRead(val,5)); // DISP2 Seg-F
digitalWrite(6,bitRead(val,4)); // DISP2 Seg-E
digitalWrite(5,bitRead(val,3)); // DISP2 Seg-D
digitalWrite(4,bitRead(val,2)); // DISP2 Seg-C
digitalWrite(3,bitRead(val,1)); // DISP2 Seg-B
digitalWrite(2,bitRead(val,0)); // DISP2 Seg-A
}

But to be sure, follow these instructions:

Driving a Static LCD display
So we finally come to the meat of this article - how do you drive a static LCD display?

There is a common line, and there are segment lines.

Step 1. Drive common to ground, drive "on" segments high, "off" segments to ground.
Step 2. Wait for a period of time.
Step 3. Drive common high, drive "on" segments to ground, "off" segments high.
Step 4. Wait for a period of time.
Step 5. Goto 1

The period of time is determined by the display and manufacturer
suggestions - 30-90 complete cycles per second (ie, common will appear as a 30Hz to 90Hz square wave) are normal.

Oh, I see. The common is on pin 9. Yeah, that should work, substituting "~" for "!" as you say.

Nailed it.

I used some CD4543B LCD drivers and a 74595 shift register.

For the phase input on the CD4543Bs, I have a 60hz square wave applied via a second ATmega. (Top right in the image.) It's the blink sketch running with a 16ms delay.

The displays look sweet now.

Since the CD4543Bs do not have an output for the decimal point, I also ran the 60Hz square wave though an inverter and outputted it to the decimal pin on the LCD. Since the signal coming out of the inverter is out of phase with the 60Hz on the common pin, the decimal lights up.

ryemac3:
Since the CD4543Bs do not have an output for the decimal point, I also ran the 60Hz square wave though an inverter and outputted it to the decimal pin on the LCD. Since the signal coming out of the inverter is out of phase with the 60Hz on the common pin, the decimal lights up.

The driver for LCD segments is nothing more nor less than an Exclusive-OR gate, fed on one input with the backplane signal.

When the control input is low, you get the output the same as the backplane, segment is off. Control input high, you get the inverted backplane signal, segment shows.

Just make sure the backplane drive is exactly 50% duty cycle and never dies.

Hi,

I've been looking for some time for a large single digit LCD like the ones that you're using in your post.

But no luck!

Could you please suggest a source for such displays.

Thank you all.