so this here's picture of a diode these
are some different transistors and and
this is actually an i7 processor that
has over a billion transistors inside of
it and you know inside all of these are
specially made silicon crystals and
actually understand how this stuff works
we need to understand what's going on at
the molecular level inside the silicon
so if we look at a silicon atom it's
going to have four electrons and it's in
its outermost like it's it's a valence
shell and so when it bonds to another
silicon atom you're going to have this
this sort of covalent bond between the
two and so in a whole lattice or like a
crystal of silicon all of these
electrons are going to be tied up in
these covalent bonds and so none of the
electrons are going to be free to to
move around at least not at any kind of
normal temperature that we would find
this at and since in order to conduct
electricity we need to have electrons
that can move around perfectly pure
silicon like this actually doesn't
conduct electricity and so actually the
silicon that we use to make diodes
transistors microprocessors and all that
sort of stuff actually has some
impurities introduced which is something
we call doping and these impurities
allow it to conduct electricity in a
particular way and this doped silicon is
what we call semiconductor material
since it's not really a regular
conductor like like copper wire but it's
also not a complete insulator like like
something like glass now so one of the
impurities that's commonly added to
silicon is is phosphorus and phosphorus
has five electrons and so it has one
extra electron it has one extra proton
you know beyond what silicon has and so
if we replace this this atom here with a
phosphorus atom you know it's still bond
to the four adjacent silicon atoms just
like this but it would have this extra
this extra electron in there as well and
maybe if we replace this with a
phosphorus it would have an extra
electron there and and if this were
phosphorus it would have an extra
electron there and so we have these
extra electrons that were that we're
introducing into this silicon crystal so
we've got the same basic structure but
now we have these electrons that can
actually start to wander
around a little bit you know they're not
going to go too far from a phosphorous
but as long as we've got you know enough
phosphorous in here
you know these electrons might wander
around so this this electron here might
actually kind of wander over here for
example and you know this electron here
my oops this electron here might wander
over here and so these electrons can
move can move around and so because the
electrons can move around this thing is
actually kind of a conductor so if we
hooked a battery up like like this here
we'd be able to get current to flow
right because electrons that come out of
the negative terminal the battery could
could enter this this crystal structure
and move around and you know there's
going to be free electrons here that can
be pulled out of this crystal structure
and attracted to the positive terminal
the battery over here and so just by
doping this the silicon crystal with a
few phosphorous atoms we can get an
electrical current to flow through it we
can we can turn this into a conductor
and so that's one kind of doping but
there but there's another kind of doping
where we use boron and boron is
basically the same as silicon except
that it has one fewer electrons and one
fewer proton and so if we were to
replace some of the things in this
crystal structure with with boron we've
replaced this atom with boron we'd have
one fewer electron there and if this
were boron over here we might have one
fewer electron there and if this were
boron down here we might have one fewer
electron there and so that leaves these
sort of these sort of holes here where
where these electrons that would
normally be part of these covalent bonds
are kind of missing and now what might
happen is that now that these holes are
here is like other electrons might
actually kind of jump out of there their
place and go fill in one of these nearby
holes and so you can almost think of
that as if the hole has kind of moved
around and so just like we had electrons
that were free to kind of move around in
in here oh we had phosphorus with the
boron doping we have holes where where
electrons would be that are actually
kind of free to move around
you know in reality it's the electrons
that are sort of jumping into the holes
but but I like to think of it as if as
if the holes are moving and so what
happens if we hook a battery up up to
this so if we hook a battery up to this
electrons are going to be attracted to
the positive terminal of the battery you
know negatively charged electrons can be
attracted to the positive charge on the
battery there and so you know this
electron here that's maybe close to that
battery terminal will go get attracted
to the battery and leave a hole behind
but at the same time electrons are going
to be coming from the negative terminal
of the battery
and maybe filling in some of the holes
that are that are closer to this side
and then these holes over here will then
start migrating over towards the the
negative side so the holes are going to
kind of flow this way or you know really
it's the electrons that are filling the
holes and kind of jumping along and
going this way and so we have an
electric current again because these
holes allow the charge to be carried
through here and so in either of these
cases whether we have extra electrons
that are that are flowing through here
or if we have you know an absence of
electrons that leave these holes that
are allowed to move around you know both
of these scenarios we have were able to
to conduct an electric current
okay so there's actually a little bit of
a terminology here for about furthest
and so both of these cases you know
we've seen two kinds of semiconductor
material here one that's doped with
phosphorus and one that's doped with
boron and both were able to conduct
electricity because they have they have
what are called charge carriers so in
the case of phosphorus the charge
carriers are the extra electrons and in
the case of boron the extra the charge
carriers are the are the holes where the
electrons would be and since electrons
are negatively charged we call this this
type of material in the n-type n-type
semiconductor and for negatively charged
because electrons are negatively charged
and we call this with the boron would
call this p-type there's a p-type
semiconductor because holes are sort of
positively charged I guess if you want
to think of it
'we remember that the N in the P return
refer to the charge carrier whether the
charge carrier is negative or positive
neither of these materials is actually
has an overall electrical charge right
because even though we have extra
electrons over here for example the the
phosphorous atoms have have an extra
proton as well I'm saying here with the
boron we have each boron atom has one
fewer proton so overall we have the same
number of electrons and protons in each
of these and so neither of these is
negatively charged or positively charged
so the n-type in the p-type just refer
to the type of charge carrier that
allows us to conduct a you know an
electrical current through these things
okay so with all that out of the way
let's look at how this is actually
useful so where this gets interesting is
if we have a single silicon crystal here
where half of it is is doped with with
n-type material and half of it is is
p-type material doped with boron so over
here in the n-type a swede got negative
charge carriers we have extra electrons
that are free to wander around and over
here in the in the p-type half we've got
positive charge carriers which are the
the holes that are free to wander around
but things get really interesting here
at this boundary this boundary we call
the PN Junction the PN Junction and this
is where things get really interesting
so if we zoom in on this on this PN
Junction yeah this is kind of what
things look like at that at that PN
Junction if we if we zoom in so let's
let's take a closer look here remember
these are mostly going to be silicon
atoms but we're gonna have a few extra
phosphorus atoms over here and a few
extra boron atoms over here and so we've
got free electrons that are that are
that are free to wander around over here
and we've got some holes so that are
free to kind of wander around over here
but right at this boundary things get
really interesting because you've got
this electron sitting very close to this
hole and it's really tempting for that
electron to want to go and jump into
that hole and in fact that is exactly
what will happen is this electron will
find it really tempting to go over here
and fill that hole and same thing here
these electrons here are gonna find it
really tempting to go jump over
and fill in these nearby holes you know
and even you know some of these
electrons over here might find it kind
of tempting for them to to go jump into
some of these into these holes you know
because they're kind of close enough
that they can wander around and find
those holes and so a couple interesting
things are gonna happen here you know
first you know this this kind of region
of n-type material here's gonna you know
take on a little bit of a positive
charge so it's gonna be kind of a
positive charge in this region because
the electrons have have kind of wandered
off but these phosphorous atoms still
have have their extra protons and then
this this region here is going to take
on a little bit of a negative charge
because some extra protons have shown up
or excuse me some extra electrons have
shown up and are filling in those extra
holes so there's a little bit of a
slight positive charge here a little bit
of slight negative charge here but
otherwise you know the rest of this
n-type material over here is going to be
this is n-type material over here is
going to be kind of normal everything
just like we described and the rest of
this p-type material over on this side
is going to be just like we we talked
about before but right at this boundary
you know a couple interesting things
going on you know not only do we have
the slight charge of separating but
because all of the the sort of electrons
near the boundary have filled in all the
holes near the boundary we have this
this region like right in here
where there are no charge carriers
there's no extra electrons there's no no
extra holes or no holes over here and so
there's no charge carriers in here and
so we we call this the depletion region
depletion region and we call it that
because it's depleted of charge carriers
and so without charge carriers this this
thin region in here is actually is
potentially a bit of an insulator so
that is it might actually prevent
current from flowing from one side of
this to the other because we don't have
any charge carriers in here that could
carry that current so let's take a look
at how that might work so if we have
some n-type material and some p-type
material we've got the extra electrons
in here we've got the holes in here and
we have this this depletion region here
in the middle is so if we hook this up
to a battery
like this where this is the negative
side this is the positive side electrons
are going to enter this n region over
here so they're going to be some extra
electrons showing up here and some of
them are going to wander over towards
this this depletion region in the middle
but when they get to the depletion
region there's there's no charge
carriers here there's no way for them to
kind of move across here and so you
won't get a current flowing you know but
in reality actually if if this battery
is is really of any decent size there's
going to be enough electrons going in
that are actually they are going to
start to get closer and closer to to
this depletion you know or to the to the
boundary the the PN Junction and at the
same time there's going to be electrons
over on the P side that are going to be
attracted to the positive terminal the
battery right the negatively charged
electrons are going to be attracting the
positive charge here and so those
electrons are gonna leave and they're
gonna leave holes in here and these
holes are gonna kind of move around and
again if this battery is got any kind of
strength to it there's going to be you
know quite a number of holes that get
introduced here and those holes are
going to start to move in this direction
towards towards the negative terminal
and so if this battery I should exercise
have turns out if it's greater than
about 0.6 volts this depletion region
will actually just collapse altogether
and you'll start to get charges that can
flow all the way through because you
won't have the depletion region in the
middle where there's no charge carriers
there will be charge carriers all the
way through and so you'll get a current
flow all the way through this thing but
now what happens if we hook the battery
up the other way so what happens if we
have the positive terminal over here and
the negative terminal over here so
what's going to happen is some of these
these electrons here are going to be
attracted towards the positive terminal
the battery and so some of these
electrons will start to will start to
leave and they'll be attracted to the
positive terminal the battery at the
same time there's going to be electrons
that they come out of the the negative
terminal of the battery here and our
to start filling in some of these holes
these electrons are gonna come fill in
some of these holes on this side and so
really what ends up happening is in this
scenario the depletion region will
actually get will actually get bigger or
get wider you know because these
electrons are going to be leaving the
the end material and there's gonna be
electrons that are gonna that are gonna
come in to the the P material is this
becomes a little bit negatively charged
because of the the negative terminal of
the battery and fills in these holes and
so the the depletion region ends up ends
up actually getting wider and of course
because there's no charge carriers in
this whole region here this areas can
act like like an insulator and no
current will flow here yeah so this PN
Junction here has this really
interesting property right that it'll
allow current to flow in one direction
but prevent current from flowing in the
other direction and so maybe you've
heard of a diode but a diode is this
electrical component that allows current
to flow in one direction but not the
other and this is exactly how it's built
and exactly how it works and this is the
the electrical schematic for a diode and
it's a little bit confusing because you
have this arrow that points in this
direction here and that's because the
electrical engineers tend to prefer to
think about current flowing in a
positive direction so from positive to
negative when in reality it's the
electrons that are flowing from the
negative side to the positive side so in
a diode like this the even though the
arrow is sort of pointing in this
direction the electrons are flowing in
this direction and it's a little bit
confusing but the I guess the
discoverers of electricity didn't didn't
know about electrons though I guess so I
guess Benjamin Franklin got it wrong you
know when when he when he was saying
that the charges flow from positive to
negative but it actually turns out that
it doesn't really make a difference
which way the current is really flowing
as long as we use one convention
consistently and stick to it whether
it's positive to negative or negative to
positive because the direction of
current flow doesn't really affect what
the current does so a lot of Engineers
prefer to think of current flowing just
this way from positive to negative
even though really the electrons are
going
from negative to positive if it helps
you can think of like the holes flowing
in this direction but but again it's
there's there's two conventions that are
that are completely opposite and you
know as long as you're consistently
using one it doesn't really matter but
hopefully that's not too confusing but
but in any event this is how this is how
diodes work