Welcome to another episode of the 8-Bit Guy. So, in this episode I want to show you how
character LCDs work. Now, these things have been around since at
least the 1980s. You can find them in all kinds of electronics
like old computers, music keyboards, synthesizers, calculators, early mobile phones, laser printers,
and are still widely used today on servers, and for hobby projects with microcontrollers. In fact, they are ridiculously cheap now and
you can find them all over ebay for just a few Dollars in just about every shape, size,
and color you could want. They come in as small as 8 by 1 characters. Some other common sizes are 8 by 2, 16 by
2, and 20 by 4. These screens should all have either 14 ot
16 pins on them. They can be arranged in different ways, but
they should be labelled 1 through 14. I’m going to start by showing you what each
of the 14 pins do. The first pin is ground. The next pin is +5 Volts. So these two wires are essentially what gives
the screen power. The next pin receives an analog voltage to
set the contrast of the screen. Typically this is done by connecting it to
the middle pin of a potentiometer. Then the other two leads on the potentiometer
go to +5 volts, and ground. So the signal you are feeding it will always
be somewhere in between those numbers depending on where you turn the knob. The next pin is register select. So the screen can accept two types of information,
one is text data. That’s basically just putting ASCII characters
on the screen, the other option is instructions, which tell the screen to do stuff like turn
the cursor on, initialize the display, create graphics characters, things like that. So imagine you had a toggle switch you could
hook up this pin to the center of the switch and then connect 5 Volts to one side, and
ground to the other. That way when you move the swtich back and
forth it will pull the line high or pull the line low, telling it which type of data you
want to send it. The next pin is for read/write. Yes, besides just sending information to the
screen, you can actually read information from the screen. And you have to pull it high for reading,
or low for writing. The next pin is the enable pin. I’ll come back to this in just a minute. The next 8 pins are the data bits 0 through
7 which represent an 8-bit binary number. All of these pins need to be set either high
or low, just like the last few. So back to that enable line. This is the final piece of the puzzle. Basically, once you’ve set all fo the other
pins exactly how you want them, then you set this line high and that will feed all of the
information into the screen. Also, some screens have 16 pins, and those
are to accomodate a backlight and so that’s just the power source for the backlight. I’ve hooked these screens up to all sorts
of things, and I plan no showing you how to hook one up to a Commodore 64 here shortly. But, before I do that, it occurred to me that
it might be possible to control these screen without any sort of computer at all, using
nothing but toggle switches. So I set out to construct such a device. So I played around with my design here in
a paint program and this is what I came up with. Obviously I’ll connect these two pins to
power and ground. This one for contrast. A toggle switch for register select. The read/write pin will go straight to ground
because I’m not going to be reading anything, I’m only going to be writing data. Then I’m going to use a pushbutton on the
enable line. and then, of course, 8 toggle switches for the data lines. So,I went to my local Fry’s Electronics
to pick up some toggle switches. I could have gotten them a lot cheaper on
line but I didn’t want to wait for shipping. This single pole double throw ought to work
fine. I would also need a push button for the enable
line, so I picked this one. So here’s all of the stuff I picked up. I got this nice little project box to mount
everything in. I’m going to use this 16 by 2 LCD that I
pulled out of an old ISDN modem years ago. I’m just going to test-fit the LCD screen. OK, so here’s all the switches mounted. This reminds me of an old Altair computer,
only this will be a lot simpler. So here’s the potentiometer for the contrast
control. And here’s the pushbutton. I also have a nice little knob to fit on the
contrast control. I printed out some labels so that I could
better see what each switch is for. And here’s what it looks like so far. Now it’s time to start wiring up the inside. So I’m just going to use a big piece of
solid core wire and mount it across all of the leads on these switches. Now that those are all soldered on, I can
actually use the spaces in between to connect all of the other wires that need to connect
to either ground or +5 volts. I’m also going to need a power cable. Since USB is 5 Volts, I’m just going to
cut the end off of those USB cable, then I’m going to wire up a barrel jack to the end. And, of course, I’ll need a barrel jack
on the back of the box so I’ll install that too. When I need a bunch of small wires of different
colors, I usually just take an old scrap multi-conducter cable like this one and strip it back and
cut off a bunch of wires. Unfortunately, when I started soldering wires
to the LCD, I noticed that one of the solder pads was missing and I couldn’t solder to
it. So, I’ve had these little screens around
forever and desoldered and resoldered to them probably dozens of times because I’ve used
them in a lot of different projects, you know, just temporarily. And that’s an unfortunate side effect of
continually desoldering and soldering to those little pads. Sometimes they just pull right off. However, I do have another one just like it
so I’ll use that one inside. But it does have some ribbon cable still attached
so I’ll need to desolder that. So after I removed the ribbon cable and cleaned
up the flux on the board I noticed that it was also missing not one, but TWO solder pads. So I simply won’t be able to use those. I do have another LCD but it is a smaller
8 by 2 character display and much too small for the hole I made. So it looks like I’ll have to use this larger
20 by 4 character display instead. It will barely fit. It does have a pin header soldered into it,
but after the bad luck I just had with the other two screens, I’m just going to leave
that in place and solder wires directly to the pins like this. And once I’m done I’ll run some heat shrink
over the pins just to be on the safe side. I think that’s going to work out just fine. So, I’ve cut a larger hole in the box. It’s not as elegant as the first one because
I had too much stuff in the way this time. Now all that’s left is to connect up all
of these wires to the right switches. There is one problem, though. The push button switch only has 2 leads, not
3. So there is no way to alternate a signal between
high and low. If you leave a pin unattached, it’s called
a floating pin, and that’s bad because it can randomly pick up static in the air and
alternate between high and low on its own. So what I’ll do is attach a resistor to
ground. That will keep it pulled low. Then when I push the button it will over power
the resistor and pull the line high. So let’s try it out. I’ve got a chart printed out to show me
binary digits for ASCII characters, and a few sheets showing all of the instructions
for the screen. But things didn’t go exactly to plan. All right. So, here’s the deal. So this is actually a normal thing to see
when you fire up an LCD screen. Just have these little two lines kind of lit
up. The contrast does work. However, I couldn’t get anything else to
work, until eventually I realized that all of my buttons are upside-down. My switches are upside down. This is upside-down. All of these are upside-down. So, I’m going to have to think about this
for a moment. So, I want to turn on the display. So I’m going to move, I want it on instruction,
so yeah, it’s actually going to be opposite of where I need. And this should be the sequence to initialize
the display. And bam! It works! It looks like we need to adjust the contrast
a little bit. So, now we want to set the data path. OK. Now let’s see if we can send some data. OK, so one of the things you’re probably
going to notice is that every time I push one of these, I get more characters than I
wanted to. And that’s because of a bounce problem. So let’s talk about bounce. When you have two pieces of metal on a switch
coming together, now it may seem like the touch instantaneously, but in reality they
actually bounce every so slightly when they first touch. Now, it’s imperceptible to use humans, but
digital electronics are fast enough they can actually see the bounce and to them it seems
like you’ve pushed the button multiple times. So what we need to solve that is to add a
capacitor to the switch. That slows down the transfer of power because
it takes a short delay for the capacitor to charge and discharge, thus smoothing out the
behavior of the switch. So let’s test it out again. All right, so we’re going to try this again. Power it on. There we go. OK, we’ll set the font. And now, let’s try sending some characters. OK. It looks like our debounce is working. We’re sending characters without repeats
now. OK, so this is the inside after everything
is done. Now It’s time to finally screw the bottom
plate on. I can’t easily rotate my switches around,
but I can change the labels on here so that the register select is showing correctly. Unfortunately my data bits are still upside
down. I’ll put the contrast knob on now. All right, so I’ve written out my name here. So, one of the interesting things that I’m
going to show you is if you want to cursor around, you’re going to want to set to instruction
mode and then zero zero zero one. OK, that should let me move the cursor to
the left. And I can change direction by flicking this
switch and I can move it back to the right. However, instead of moving the cursor, I can
move the entire screen by moving this switch. Look at that. And I can move it back the other direction. So that’s just some of the interesting things
that you’ll learn playing with this. And you can see the contrast adjustment seems
to work pretty well. So here’s one final look at this device. And here’s what it looks like in the dark,
since this particular screen is backlit. All right, so I think this is a pretty cool
little educational device. You know, learning how to use the binary information
and key it into the screen is probably a really good learning tool for someone getting into
digital electronics. Anyway, I was going to show you how to connect
this up to a Commodore 64 both on the cartridge port and on the user port. However, this video is getting a little long. So I’ve decided to split that off into a
part 2. So, hopefully you’ll stick around for that. And I hope this episode wasn’t too technical
or boring or anything like that. Because, I’d kind of like to make a little
more technical videos like this every now and then but you know I run the risk of going
too deep, and that might not work for some people, so let me know what you think in the
comments, and I’ll see you next time!


100 Comments

Steven Klein · October 17, 2019 at 11:53 pm

Thanks! Helped me a lot!

Byron Watkins · October 20, 2019 at 7:54 pm

All you need to do to upright those switches is to re-solder the four power and grond connections.

danny · October 21, 2019 at 12:46 am

is that a Ben Eater refference lol

Gary Riefle · October 21, 2019 at 2:43 am

The final LCD screen looks better than the other ones anyways… nice little project.

steamgas100 · October 21, 2019 at 3:06 pm

finally someone that knows how to teach electronics at my beginner level. thank you very much for the LCD lesson.could you please include the cap.values and the resistor values and the pot. value?

Mike Turk · October 27, 2019 at 5:42 pm

Toggle.switches are cool.

hadi reg · October 31, 2019 at 3:33 am

👍

Michael Sears · November 1, 2019 at 12:01 am

Do you think you could create a 3d monitor but also colored black and white screens. Make them all stacked and display different parts. Be a clear phone kind of.

Taulant Vokshi · November 1, 2019 at 12:42 am

how dare you say that you might get us bored hehe. you are amazing

Nathan VanKlompenberg · November 2, 2019 at 1:07 am

Wow that’s cool

lifeforce · November 2, 2019 at 7:30 am

I wich more video like that and more deep, go on

Despondencymusic · November 3, 2019 at 11:11 pm

I thoroughly enjoyed the deep technical aspects of this video.

Ashley Lahm · November 4, 2019 at 8:31 am

Loved this series of videos. Reminds me of when I was right into electronics back in the day, reading Silicon Chip magazine (http://www.siliconchip.com.au/) and visiting Dick Smith Electronics here in Australia (I believe it was similar to Radioshack and Tandy in the US) and getting to know how to program PICAXE micro controllers (http://www.picaxe.com/What-is-PICAXE/) I had a 16×2 character LCD display already and PICAXE was a monthly feature in Silicon Chip with new projects from regular contributors or from readers and was really exciting. My mission was to get the display working by figuring out the logic etc. mostly myself whilst lending ideas from the magazine. Never did finish it but will definitely go back to it one day!

Jan Mleczko · November 4, 2019 at 1:53 pm

Can i use a standard ASCII code (including unprintable characters) to control a LCD using this 8bit parrarel bus or i must use special opcodes for it?

some kid on the internet · November 4, 2019 at 2:21 pm

my essay took forever with this

Romanian Productions · November 7, 2019 at 1:48 am

You should use fritzing for your diagrams it’s quite good

Mining moble TurtleSnap!!! · November 7, 2019 at 10:26 pm

fun, basic, and interesting.

jmm1233 · November 8, 2019 at 11:49 am

breadboard time , love working ut how to make these run using a simple toggle switch

Richard Rootless · November 9, 2019 at 2:18 pm

I like videos where 6hit is down to practical level instead of just drawing block diagrams and explaining the scientific principles etc.

Armando Poveda · November 10, 2019 at 5:33 am

Soldering header pins is the way to go with those LCD screens.

Grampy's Magic · November 11, 2019 at 3:18 am

Since you bused the data switches why not just move power and ground on the bus? Would have taken maybe 10 minutes of camera. ez-pezy…… cool project, but a thumbs down for not fixing it….

OppositeReality · November 12, 2019 at 5:20 pm

I'm not going to lie, I read "The 8-bit gay" and I clicked the video.

AsilarWindsailor · November 13, 2019 at 4:25 am

I'd like to see a video in this style on the YM2151 and YM3012 chips being controlled with hardware only

Жека Калашников · November 13, 2019 at 9:40 am

Thank you ! It's good explanation of work!

buddyroach · November 14, 2019 at 9:22 am

why dont you just swap the negatve and positve leads on the data bits? its just 2 big wires and you are reversing the polarity among basic switches so why not?

guillermo seijo · November 14, 2019 at 5:15 pm

a pesar de estar en otro idioma, pero hablas lento y claro, mi traductor de youtube funciono de maravilla, muy bien explicado, original, por fin alguien que sepa de electronica que se anime a explicar, y no como la mayoria que solo repiten los mismos videos de los demas y ademas no saben nada del tema, solo quisiera saber si hay una forma de que la escritura fuese automatica o eso ya es mas dificil?, y si con solo una llave sin tener que press enter se de una instruccion y corresponda a un texto asignado, muchas gracias por tu tiempo y dedicacion, segui asi.

David Paul · November 15, 2019 at 6:04 am

Your opening sound is harsh when listening though headphones 🙂 great vid !

jameswalker199 · November 16, 2019 at 3:33 pm

But are there 80 columns character LCDs?

Tester Jim · November 16, 2019 at 8:04 pm

Thanks for explaining this so well

Ivan Mattson · November 17, 2019 at 6:20 am

Nice shirt, I love futurama

PyroJasonExplodes · November 18, 2019 at 7:27 am

What songs/music were heard?

ABDELHAMID AHBANE · November 19, 2019 at 8:41 pm

sooo wonderful

Steven Barnes · November 20, 2019 at 12:35 am

I simply cannot get enough of this channel. I watch more of this than anything TV has to offer.

zokonjazokonja · November 20, 2019 at 7:14 pm

I used this displays many times and I newer solder wires directly to pads, I always use strip pins and wires on strip connector so that it can be easily replaced or used on some other project. BTW I newer used it in 8 bit data line config but in 4-bit configuration, to save I/O lines on uC.

Viktor Torma · November 20, 2019 at 7:35 pm

why did you decide to have the switches from 7 to 0 and not 0 to 7?

kenny ball · November 21, 2019 at 7:10 pm

OMG THIS IS THE MOST GENIUS THING IVE EVER SEEN…thx so much for taking ur time to educate me and others…1 million ppl dont find this stuff boring

Brian Smyth · November 22, 2019 at 4:12 am

Good one! You might save wear and tear on the solder pads if, instead of desoldering and removing the wires, you solder instead to the wires where they were cut off when scavenged (just strip the ends). You can then solder and desolder from the wires many times without affecting the board traces or pads. I leave myself this option whenever I can when scavenging parts.

Casey Vitti · November 23, 2019 at 2:01 am

One of the best examples I have seen with this 😀

time-machine時光機 · November 23, 2019 at 3:09 pm

manual display 👍👍👍👍👍👍

Küchenzwiebel · November 23, 2019 at 4:28 pm

This video should be an example how explanatory videos should be. I knew nothing about how the data to a LCD is transmitted and I got it instantly when watching this video. Keep it up!

Brian Jensen · November 23, 2019 at 11:55 pm

what is the point of splitting an episode? Not watching a playlist so I wont get to see it. My millisecond attention span can barely remember why I am typing this.

BarneySaysHi · November 24, 2019 at 6:46 pm

Can you use a two row display as a stereo V/U meter?

Zachary Harper · November 26, 2019 at 12:54 am

Haha I always find it funny how often you put switches in upside down, I can only guess theres alot of cut out cursing under your breath when you find out everytime haha

needforsuv · November 27, 2019 at 11:47 am

you know, you could just solder a quick connect instead of directly

Robin Dow · November 28, 2019 at 10:42 am

great david i am playing with such screens and arduino to display information for my trainset
keep up the good work

bullhornzz · November 30, 2019 at 12:14 am

Good video. The "more technical stuff" is good now and then.

Bradley Smith · November 30, 2019 at 1:14 am

a nice free program for graphics is libreoffice draw or inkscape … both can do vector art

Danny M · November 30, 2019 at 6:34 pm

Not too technical and certainly not boring. Great work, cant wait to see more of your videos like these.

GhostCode RG · December 1, 2019 at 6:36 am

And linus would have set it on fire…somehow

dh · December 2, 2019 at 1:33 pm

The 8-Bit Guy: go tech ok with me 🙂

Jason W. Thompson · December 2, 2019 at 9:17 pm

Thank you for this video! I learned quite a bit!

Mark Giza · December 5, 2019 at 6:33 am

Awesome video brother.
Not boring at all.
Any shorter it would have missed some key points.
The errors helped me understand it way better.
Thank you for the awesome video

Snehil · December 5, 2019 at 7:58 pm

How come I never came across this channel? this guy wastes no time and goes straight to the good part. love it!

מיכאל מיכאלי · December 7, 2019 at 10:12 am

Amazing!

gaming101 · December 8, 2019 at 5:07 am

This is a cool little computer

Goretantath · December 10, 2019 at 5:31 am

OMFG I LOVE THIS!

toniodotcom · December 10, 2019 at 9:08 am

This is how Steve Wozniak was creating actual computer hardware with his bare hands in a garage :O

Naitra Naitra · December 11, 2019 at 10:49 am

MORE please!

Glen Beestone · December 11, 2019 at 5:12 pm

I understand you couldn't turn the switches around without desoldering everything. but couldn't you have just swapped the 5v and GND lines to the rails you soldered on either side of them ?

great video. thanks for demystifying these devices. they are a lot simpler than I had thought

Ramses Velasco · December 12, 2019 at 12:26 am

Why the guy that talks so much about retro technology doesn’t just say Arduino instead of micro controllers ? …

Jovetj · December 12, 2019 at 5:37 am

Boring?? I never realized these were so simple. I've always assumed displays like this or even multiplxed LED displays were too complicated to mess with. 😀

Jaromír Adámek · December 13, 2019 at 4:56 pm

Nice demonstration, and its cool to see, that not only I doing mistakes 😀 in development phase :D.

Anthony Handcock · December 14, 2019 at 4:06 pm

From a UK point of view where our light-switches are traditionally up for OFF and down for ON your switches are the right way up.

pradeepselvam rajan · December 15, 2019 at 10:02 am

Awesome bro

Barnaby Wilde · December 17, 2019 at 12:17 am

i saw on your switch animation that the connection was backwards, or up-side down. I yelled to you, but you didn't hear me.

Bartacomus Kidd · December 17, 2019 at 10:02 pm

I hope you made Monkey Fracas.. thats the only game worth making.

D B · December 20, 2019 at 12:57 am

Can I get 1?

Entropic Things · December 20, 2019 at 2:45 am

The backward switch wiring is something I can relate to 100%. I always look at those switches as slide switches and assume that the position of the stick indicates which two pins are closed. It makes sense in a slide switch since a conductor is literally dragged across the two pins as you actuate the slider. The mechanical voodo in those rocker/toggle switches always messes me up when the pair of pins opposite of the final position of the rocker switch is the circuit that gets closed! It's comforting to see I'm not the only one who has made this mistake.

Zachary McKeon · December 22, 2019 at 12:59 pm

Anyone else think of cash registers when they think about this topic or is it just me?

Walter Bak · December 22, 2019 at 6:54 pm

EXCELLENT! 🙂

fdask2007 · December 23, 2019 at 2:37 am

Been years since I worked on one of these. I like watching these digital electronic vids!

ALEXANDER VALLE · December 23, 2019 at 3:20 pm

Me llegas peloncito.

Chad Singer · December 23, 2019 at 5:33 pm

This is really cool, but how do you motivate yourself to build something with ostensibly no practical purpose whatsoever?

Chad Singer · December 23, 2019 at 5:33 pm

You need more chaos.

Terry Terry · December 26, 2019 at 9:02 pm

You explain everything nice and simple. Thank you!!!

Behind the Truth · December 27, 2019 at 9:06 am

I worked on control panels years back, this is a brilliantly simple explanation of how the LCD's in the panels worked !.. I understood you very clearly… well done.. going for parts 2 and 3…

denelson83 · December 29, 2019 at 10:24 pm

"Set the font"?

How many fonts does that LCD have?

Jenn V. L. · December 30, 2019 at 6:46 am

Just use a nail file FFS xD love this project.

Kenneth Kustren · January 1, 2020 at 8:11 am

LOL !!
8BIT IS BEYOND MORE THAN OF WHAT 90% OF NORTH AMERICANS.KNOW.
TIS NOT EVER BORING TO LEARN.
TEACHING LEARNERS IS MEEKNESS.
TYVM SIR.!

Martijn Noordermeer · January 2, 2020 at 12:41 am

That's pretty neat!

Morahman7vnNo2 · January 2, 2020 at 12:16 pm

Cool, this makes me want to build my own. But with a selectable keypad.

Name Needed · January 2, 2020 at 7:44 pm

Build guide for the device?

Mr. Wolff · January 3, 2020 at 4:11 am

Excuse me, are you gay by any chance lol??? I'm looking for a smart hot guy

Saumil sunil Shah · January 3, 2020 at 4:28 am

4$ for single switch
Here in india my whole project would have been of same cost

Stephen Cothran · January 4, 2020 at 1:47 am

That was great, i want to learn more!!

Keith Forbes · January 4, 2020 at 6:36 am

9:55 where is the "00001111" command to initialize the display in the datasheet? All I could find is that is should be initialized on power up, unless there's an issue and then there was a list of instructions (see "Initializing by Instruction") on how to get it initialized again. But nothing that simple

Ruslan Maksimenko · January 5, 2020 at 10:40 pm

Переводил леший.

Радослав Радев · January 6, 2020 at 4:16 am

Hello Willy Tanner, I'm following you.

mer2329 · January 6, 2020 at 7:34 pm

i love watching projects like this. if you use the screens over and over, why not atttach some pins to em instead, this would make swapping pretty easy. i would recommend looking into dupont pins, (these are what a computer front panel header use).
a crimper costs about $30, and the pins are a few cents each. you can but both strain and angled pins off ewbay for cheap, and frys actually sells 1×1 pin housings and sometimes the male and female pins too.

i prefer using pins over soldering cause it makes maintenance and swapping super easy.
i do keep a supply of pins, and a assortment of housings on hand.

Rodrigo Costa · January 13, 2020 at 4:38 pm

Thank you for the lesson. Such an amazing job!

tuca man · January 13, 2020 at 7:32 pm

No, you're not a doctor.

BrunoRC7 · January 14, 2020 at 12:29 am

The best explanation in youtube about LCDs operation! Thanks a lot from Brazil!

Michael Lloyd · January 14, 2020 at 3:06 am

Outstanding! Subbed.

mdworzan · January 19, 2020 at 2:13 pm

You made an Altair tribute machine 🙂

Spring David · January 23, 2020 at 3:00 am

I'm like:
"Spring confused"
"Spring still interessed"

random happens here · January 25, 2020 at 10:58 pm

I…need…dis

PROJECT_SMASH · January 26, 2020 at 4:18 am

i definitely didn't find this boring

usman umer · January 31, 2020 at 2:53 pm

beautiful

evgeniydragondog · February 3, 2020 at 8:38 am

Very useful. Now i know how this works

Giulio Sancin · February 3, 2020 at 9:49 am

Not boring at all !!!

Leave a Reply

Your email address will not be published. Required fields are marked *