Solar

The science of turning sunlight into electricity (without moving parts!)

Solar cells turn sunlight straight into electricity. Here's how the physics actually works, from one crystal of silicon to the current in your wire.

Still life photograph of a silicon crystal molecule with dopants phosphorus and boron that makes semiconductor junctions, diodes and solar cells.

Throughout most of human history, we couldn't make electricity directly from an energy source. Every major power source we've ever built makes electricity as a byproduct of motion. Burn fuel to boil water into steam; the steam spins a turbine; the turbine turns a generator. Coal, gas, nuclear, hydro, even wind all end the same way. Something that spins turns a magnet inside a coil of wire and produces electricity (EIA).

The one exception is solar photovoltaic power. Think about it: a solar cell takes sunlight and turns it straight into electric current. And if you pay close attention to how that actually works, it's next to magical.

In this article, we'll look at how solar power works in principle. Below is a simulator you can play around with, to get a feel for the inner machinery.

off
31.6 Ω (≈open)
e⁻ (electrons) h⁺ (holes)
0e⁻ in n (pile)
0h⁺ in p (pile)
0.00I (A) load
0.000V (V) load
0.000P (W)
R (Ω)

The secret sauce is semiconductors

Solar cells can do this because almost the whole thing is made of semiconductors. And yes, that's the same stuff that makes your phone and computer work.

Here's the basic idea. A solar cell is made of two layers of different "flavors" of semiconductor, sandwiched together. Where the two layers meet is called a junction, and this junction is the heart of solar power.

A solar cell has two layers: n-type on top, p-type below, meeting at the junction

Inside the junction sits a naturally occurring electric field. Think of it as a sorting machine. If you keep tossing an electron into the junction, the field pushes them up toward the top layer. When one layer ends up with more electrons than the other, you've created potential energy, kind of like a battery.

If you connect the layers with a wire, with a lightbulb in between, you've just made a complete circuit. The electrons that were piled up on one side can rush through the wire, through the lightbulb (it lights up!), and back to the other side.

Open circuit: electrons pile up on one side, nothing flows, potential energy builds like a battery

Closed circuit: the pile drains through the wire and the lightbulb lights up

Of course, you can't "toss" an electron by hand. That's where the sun comes in. When sunlight shines into the semiconductor, it energizes electrons in the semiconductor and it flies freely. Free electrons roam like fast-moving pinballs, and they tend to drift toward the junction.

The electric field can then pick up the electrons, pushes them up toward the top layer, and before you know it, the top has more electrons than the bottom. So, again we have potential energy, this time enough to charge a battery or run your appliances.

Sunlight and a closed circuit: photons kick electrons and the current flows

The details and the caveats

If you've read that and thought, "Hey, that's oversimplifying it!" then congratulations. This next section is for you. Let's go a step deeper into how solar power really works.

What makes a semiconductor special?

A semiconductor is a crystal, like diamond or graphite. It's a continuous, repeating chain of atoms locked into a neat structure called a lattice.

In a crystal, electrons don't orbit individual atoms the way they do in a gas or a single atom. They live in shared energy bands. Think of energy bands like floors in a building. For our purpose, let's focus only on the last two bands where the highest energy electrons can occupy.

The silicon lattice and the energy bands its electrons live in

We call the highest band the conductive band. Electrons occupying this band can move freely across the lattice. The second highest band is the valence band. Electrons occupying this band has limited movement within the lattice.

As we've learned before, sunlight is powerful enough to kick electrons from their valence band up to the conductive band. This allows electrons to travel further, and even across the electric field inside the junction.

But we can't produce that electric field without doing one more thing: doping.

Making an electric field with two types of semiconductors

We've used the term "flavor" as a mental shortcut. The point is that there are two different types of semiconductors, depending on its impurity.

A pure silicon crystal that is doped with phosphorus produces an n-type semiconductor. Phosphorus has five valence electrons, but uses only four to bond with its silicon neighbors, meaning there's one spare electron sitting in the conductive band ready to go (PVEducation).

Now, a pure silicon crystal that is doped with boron produces a p-type semiconductor. Boron has three valence electrons, uses all of them to bond with its silicon neighbors. But this means one of the silicon neighbors is missing an electron. There is a hole that a conductive electron can fall through (PVEducation).

Important to note: The types are just names given to the different semiconductors. It doesn't mean that a p-type semiconductor crystal is positively charged, and vice versa. On their own, the crystals are neutral; the number of electrons and protons equal each other.

The two flavors: n-type has a spare electron, p-type has a hole

Now, what happens if we bind an n-type and a p-type semiconductor together? The region with spare conductive electrons (from the n-type) collides with the region with spare holes (from the p-type). This results in recombination. The holes and the spare electron just cancel each other.

This actually changes the electric charge around the region of contact, i.e. the junction. Think about it. The n-type portion of the junction used to have an electron that kept itself neutral. But now that the electron is captured by the p-type portion of the junction, the n-type becomes positively charged. On the opposite end, the p-type portion of the junction captured that electron and now it is negatively charged.

When we have regions with opposing charges, there is an electric field. Earlier we've said that the field pushes electrons up toward the top layer (the n-type). This is only true if the solar cell is made with n-type as the sun-facing layer, which is commonly found in the market (PVEducation).

Notice the two layers aren't the same size. The n-type layer on top is thin. The p-type layer below is the thick bulk of the cell.

Why? Think about where the pairs are born. Sunlight is absorbed strongest at the surface, and the absorption fades as it travels deeper (PVEducation). So most electron-hole pairs are created close to the surface. The junction is the machine that separates them, so it needs to sit right where the pairs are created. Keep the top layer thin and the junction rides up to the surface, with the thick p-type underneath catching the light that penetrates deeper. That's why the simulator above draws the p-type so much bigger than the n-type.

The n-type and p-type layers with the electric field between them

What sunlight actually does

Earlier we said sunlight kicks electrons from the valence band up to the conductive band. That's true, but not every photon can do the kicking.

A photon is a particle of light, and each photon carries a fixed amount of energy. To kick an electron from one band to the other, a photon needs enough energy to clear the gap between them: the band gap. For silicon, that's about 1.1 electron-volts (PVEducation).

Photons with less energy than that just pass straight through the silicon. They can't bridge the gap, so nothing happens. The electron stays put. Photons with way more energy than the gap can kick the electron, but there's a catch. The extra energy doesn't get used. It becomes heat. The cell warms up, and that energy is gone.

So each photon that does its job frees exactly one electron, and leaves exactly one hole behind. One photon. One electron-hole pair.

So why isn't a solar cell 100% efficient?

Let's count the losses.

Some photons are too weak. They pass straight through the silicon without kicking anything.

Some photons are too strong. They kick the electron, but the extra energy turns into heat.

And even the perfect photons don't always win. Sometimes the freed electron falls back into a hole before it ever reaches the electric field. That's recombination again, the same one we met at the junction. That energy becomes heat too.

If we add it all up, a typical silicon cell turns about 25% of the sunlight that hits it into electricity (Fraunhofer ISE, 2026).

So where are the moving parts?

Let's go back to where we started. Every major power source we've ever built makes electricity by making something spin. Coal boils water into steam, steam spins a turbine, the turbine turns a magnet inside a coil of wire. Wind is the same story, just with air instead of steam.

A solar cell has none of that. No turbine, no spinning, nothing to wear out. The work is done by light itself: a photon arrives, kicks an electron, and that electron is the current. The photon is the turbine.

So the next time you see a solar cell, here's what's happening under the glass. Sunlight hits a crystal. The photons that are strong enough kick electrons across the band gap. The electric field inside the junction sorts them, pushing them toward the top layer. And a wire gives them a path to do work: light a bulb, charge a battery, run your appliances.

That's the part that's next to magical.