installation

From Sunlight to Electricity: How Solar Panels Work

Photons hit silicon, electrons cross the P-N junction, DC flows to an inverter that makes AC. The full process from sunlight to outlet, explained.

· James Whitfield · 8 min read

Updated: July 31, 2026

Cross-section of a solar cell showing the P-N junction, photons hitting silicon, and electrons flowing through the circuit

A solar panel turns sunlight into electricity. Easy headline, but the physics involves quantum mechanics, semiconductor doping, and a few clever engineering tricks that took 150 years to work out. You don't need a physics PhD. You need to know what photons do when they hit silicon, what a P-N junction does to the freed electrons, and what an inverter does with the current. Want just the current-generation stage? Our piece on how solar panels make electricity drills into it. Here's the full path, from the sun to the outlet in your wall.

The thing that surprised me most working on solar systems was how little of the physics is new. The photovoltaic effect dates to 1839, and the semiconductor theory behind P-N junctions came together in the 1940s alongside the first transistors. What changed in 30 years is manufacturing scale: panels went from $300/W to $0.10/W between 1956 and 2025 (Lawrence Berkeley NREL data), turning a curiosity into a 1.6 TW global industry. The full arc is in our piece on how solar power started.

Close-up of blue polycrystalline solar cells showing the grid of thin conductive lines
Photo by Chirayu Trivedi on Unsplash

What Is the Photovoltaic Effect?

The photovoltaic effect is the conversion of light into electrical current in a semiconductor. Edmond Becquerel discovered it in 1839; quantum mechanics explained it in the 1920s, and Bell Labs engineered the first practical solar cell in 1954. Photons carry energy proportional to their frequency, and when one strikes a semiconductor with energy above the material's bandgap, it can knock an electron loose. That freed electron is mobile and can carry current if an external circuit captures it before it recombines with the hole it left behind.

For silicon, the bandgap is 1.12 eV, matching photons shorter than about 1,100 nanometres. Photons below that energy pass straight through unabsorbed; those above are absorbed, but any excess energy beyond the bandgap is lost as heat. That sets a hard efficiency ceiling for single-junction silicon near 33.7%, the Shockley-Queisser limit. Production panels sit at 22-23% module efficiency, and the gap keeps closing through better surface passivation, anti-reflective coatings, and contact metallization. Other semiconductors have different limits: gallium arsenide (1.42 eV) reaches roughly 34% theoretical efficiency, and multi-junction cells stacking several bandgaps have hit 47% lab efficiency under concentration (NREL).

What Is a P-N Junction and Why Does It Matter?

A P-N junction is the boundary between two regions of silicon doped with different impurities, and that doping creates the permanent electric field that turns absorbed photons into directional current rather than just heat. Pure silicon barely conducts at room temperature. Doping with phosphorus makes N-type silicon with extra mobile electrons; doping with boron makes P-type silicon with "holes." Place them adjacent, and electrons diffuse across the boundary, leaving fixed positive ions on the N-side and fixed negative ions on the P-side.

The result is a built-in field across the junction, around 0.6-0.7V for silicon, pointing N to P, permanent with no external voltage needed. When a photon excites an electron-hole pair near the junction, the field drives electrons toward the N-side and holes toward the P-side faster than they can recombine. Without the junction, the pairs would just recombine and dump the energy as heat; with it, they're forced through an external circuit as electric current. The layers are thin: roughly 200-500 nm of N-type emitter on top, a P-type base of 150-200 micrometers below. For the materials and fabrication behind a working cell, see what solar panels are made of.

How Does DC Current Get Out of the Cell, and What Does the Inverter Do?

Separated electrons need a path out through metallization on both faces of the cell: fine silver grid lines collect electrons from the N-type emitter on top, an aluminum back-surface-field collects holes from the P-type base underneath. Front grid lines must be thin enough to avoid shading the cell but thick enough to carry current without resistive loss; modern multi-busbar designs (9-16 busbars instead of the old 3-5) shorten the electron's trip. Each cell produces roughly 0.55-0.65V open-circuit at STC; wire 60-72 cells in series and a panel reaches ~40-50V, and stringing 10-15 panels gives a residential array 400-700V DC, flowing through a junction box, MC4 connectors, and on to the inverter. Bypass diodes (typically 3 per 60-cell panel) route current around shaded or damaged sub-strings, which is why partial shading doesn't kill a whole panel.

The inverter converts that DC to AC at grid voltage and frequency - harder than it sounds, since DC is constant while AC swings sinusoidally at 50 or 60 Hz. Modern inverters switch at 16-20 kHz using IGBTs or SiC MOSFETs, chopping the DC into pulses that a passive filter smooths into a grid-matched sine wave. Three subsystems matter: Maximum Power Point Tracking, which continuously samples the panel's non-linear V-I curve to hold its shifting peak power point; grid synchronization, matching grid voltage and frequency in phase to export power safely; and anti-islanding protection, which detects grid outages and disconnects within seconds (UL 1741) so it never energizes a downed line. Inverter efficiency runs 96-98% for residential models from SolarEdge, Enphase, SMA, and Fronius; the 2-4% loss becomes heat, so inverters last 12-15 years for string models, 20-25 for cooler-running microinverters.

Suburban neighborhood of tiled roofs fitted with solar panels beneath a rainbow
Photo by Lara John on Unsplash

Grid-Tied vs Off-Grid vs Hybrid: How Are They Connected?

About 95% of US residential solar is grid-tied: the inverter feeds the home panel and the utility meter tracks net flow both ways. Net metering policy varies widely - full retail net metering (still common in New York, Massachusetts, New Mexico) credits an exported kWh at the same rate as an imported one, while reduced policies like California's NEM 3.0 cut export rates by ~75%, pushing new installs toward batteries for self-consumption. Off-grid systems pair panels, batteries, and a charge controller for full independence but cost far more (a battery bank alone runs $15,000-$45,000), making sense mainly for remote properties or where autonomy matters regardless of cost. Hybrid systems run grid-tied while managing battery charge/discharge and providing outage backup, and are now the default in states with weak net metering or frequent outages. For more, see our residential solar complete guide and our solar system optimization guide.

String inverter systems wire panels in series at one voltage and current, while module-level power electronics (MLPE) give each panel its own optimization point. The Enphase IQ8A microinverter converts DC to AC at each panel (up to 480W input, 240V AC output), adding panel-level monitoring at a higher cost per watt. DC optimizers like the SolarEdge P370 and Tigo TS4-A-O optimize each panel but pass DC to a central string inverter, and cost less than microinverters. MLPE pays off with significant shading, complex roof geometry, or NEC 690.12 rapid shutdown compliance (most US installs after 2019); on an unshaded south-facing roof, a plain string inverter delivers the same energy for less. For a full comparison, see power optimizer vs microinverter.

What Happens to Solar Panels Over Time?

Silicon panels degrade slowly under sun, temperature cycling, and UV. NREL's PV Fleet Performance Data Initiative (2020) tracked thousands of modules and found a median degradation of 0.5%/year for crystalline silicon. A 400W panel at that rate retains:

  • Year 1: 397W (light-induced degradation, then stable)
  • Year 5: 388W
  • Year 10: 379W
  • Year 25: 349W (~87% of rated)
  • Year 30: 339W (~85% of rated)

Premium panels do better: TOPCon (0.35-0.45%/year) and HJT (0.25-0.35%/year) beat standard PERC (0.45-0.55%/year).

Cell technologyAnnual degradationYear-25 retention (typical)Example warranty
Standard PERC0.45-0.55%/year~85-87%Most mainstream panels
TOPCon0.35-0.45%/year~88-90%LONGi Hi-MO X6: 87.4% at year 30
HJT0.25-0.35%/year~91-93%REC Alpha Pure-R: 92.0% at year 25

What drives the aging? Light-induced degradation in the first weeks, UV encapsulant browning, potential induced degradation in high-voltage systems, thermal cycling stress on solder joints, and micro-cracking from hail, snow, and wind. The IEC 61215 standard screens for these with 1,000 hours of damp heat and 200 thermal cycles between -40 and +85 deg C before a panel can sell. Field data from 1990s systems shows many panels still above 70% of rated output after 30 years. For more, see what happens when panels get old.

Summary

Solar panels convert photons to electrons through the photovoltaic effect in a silicon P-N junction. Photons above the 1.12 eV bandgap excite electrons the junction's field separates as DC. An inverter turns that DC into AC at grid voltage and frequency, typically 240V/60Hz in the US or 230V/50Hz in Europe. Modern panels reach 22-23% module efficiency with TOPCon and HJT and degrade 0.3-0.5% per year over a 25-30 year life. About 95% of US residential installs are grid-tied, with net metering covering the mismatch between production and use. None of the chain is hard alone; the art is making it run reliably for 25 years on a roof. For more, see our residential solar complete guide, the solar optimization guide, and our best solar panels 2026 ranking.

Frequently Asked Questions

How do solar panels actually generate electricity?
Solar panels use the photovoltaic effect. Photons with energy above silicon's 1.12 eV bandgap knock electrons loose from valence to conduction band, where the P-N junction's built-in electric field pushes them in one direction creating DC current. A typical 400W panel converts 20-22% of incoming sunlight to electricity at the cell level under STC conditions.
What is a P-N junction in a solar cell?
A P-N junction is the boundary between two regions of silicon doped with different impurities, phosphorus for N-type (extra electrons) and boron for P-type (electron holes). The junction creates a permanent internal electric field. When a photon knocks an electron free, the field pushes electrons toward the N-side and holes toward the P-side, driving current through an external circuit.
What is the difference between DC and AC in solar systems?
Solar panels produce direct current (DC) at typically 300-600V for a residential string. Homes and the grid use alternating current (AC) at 120/240V in the US, 230V in Europe. An inverter converts DC to AC and synchronizes the output to grid voltage and frequency. Inverter efficiency runs 96-98% for modern residential models.
Do solar panels work with the grid or independently?
Both. Grid-tied systems sell surplus to the utility via net metering and draw from the grid when production is insufficient. Off-grid systems pair panels with batteries and charge controllers for full energy independence. Hybrid systems do both, batteries plus a grid connection. About 95% of US residential solar is grid-tied because it's cheaper than full battery backup.
How long do solar panels actually last?
Modern silicon panels are warranted to retain 80-87% of rated output at 25-30 years, with industry-median degradation of 0.5% per year (NREL PV Fleet Performance Data Initiative, 2020). Premium TOPCon and HJT panels (LONGi, REC, Panasonic) degrade slower at 0.3-0.4%/year. Real-world data from systems installed in the 1990s shows many panels still producing >70% of original rated output after 30 years.

Sources