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 · 9 min read

Updated: October 6, 2026

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

Bottom Line

Photons knock electrons loose in doped silicon, a P-N junction forces them to travel one way instead of recombining, and the inverter turns that DC into household AC. The physics dates to 1839 and the 1940s; what changed is price, from roughly $300/W in 1956 to about $0.10/W in 2025.

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 more than a century 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 the cell-level physics instead, bandgap, depletion zone, V-I curve? That is a separate piece on solar cell physics. Here's the full path, from the sun to the outlet in your wall.

What surprises most people is 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 is manufacturing scale: solar panels cost roughly $300/W in 1956 (EnergySage) and the global average selling price was about $0.10/W in 2025 (Fraunhofer ISE), which turned a curiosity into an industry with roughly 2.4 to 3 TW installed worldwide at the end of 2025 (IRENA counts 2,392 GWp, IEA-PVPS 2,973 GWp). The full arc is in our piece on how solar power started.

Close-up of a solar panel surface showing the fine silver conductor lines crossing each cell
Photo by Newpowa 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 theory explained it later, and Bell Labs demonstrated 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 ceiling on single-junction cells. The Shockley-Queisser limit peaks at about 33.7% for a 1.34 eV bandgap, and a detailed analysis for crystalline silicon puts its own limit at 29.4% (Richter et al., 2013). Real silicon is getting close: the best lab cell reached 28.1%, the shipment-weighted average for commercial crystalline silicon modules was 22.7% in Q4 2024, and the best commercial module hit 24.8% (Fraunhofer ISE, 2026). Better surface passivation, anti-reflective coatings, and contact metallization keep closing the gap. Stacking several bandgaps breaks the single-junction ceiling: high-concentration multi-junction cells have reached 47.6% in the lab.

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: the whole silicon wafer is now about 140 micrometers thick (Fraunhofer ISE), and the doped emitter layer is a sliver of that. 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 shorten the electron's trip. Each cell produces well under 1V, so panels wire dozens of cells in series, and stringing panels in series pushes a residential array to several hundred volts DC, flowing through a junction box, MC4 connectors, and on to the inverter. Bypass diodes (typically 3 per 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 chop the DC into high-frequency pulses with power transistors, and a filter smooths them 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 so it never energizes a downed line (IEEE 1547 sets the limit at 2 seconds, and UL 1741 is the test standard). Efficiency is high but not perfect: the Enphase IQ8A is rated 97% CEC-weighted, and the lost few percent becomes heat. Warranties hint at expected life: string inverters typically carry about 10 to 12 years, while microinverters and power optimizers often carry 25 (EnergySage).

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?

Most 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 credits an exported kWh at the same rate as an imported one, while reduced policies like California's NEM 3.0 net billing (for applications from April 15, 2023) cut the value of exports by roughly 75% in published analyses of the CPUC's 2022 decision. The battery numbers show the effect: 74% of new California residential installs included storage in 2025, up from 58% in 2024, against 17% in the rest of the country (Berkeley Lab data via pv magazine USA). Off-grid systems pair panels, batteries, and a charge controller for full independence but cost far more, 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. 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 (Enphase pairs it with roughly 295-500 W modules, 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 (under the 2017 code, conductors inside the array boundary must drop to 80 V within 30 seconds, effective January 1, 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. Jordan and Kurtz's NREL review of nearly 2,000 published degradation rates found a median of 0.5%/year (the mean was 0.8%/year because a tail of badly degrading systems drags it up). NREL's later fleet analysis of thousands of US systems puts median system degradation higher, at -0.75%/year by one method and -0.5 to -0.75%/year by another, and about -0.5%/year once recoverable soiling is excluded. As an illustration, a 400W panel that drops to 397W in year 1 and then loses 0.5% of nameplate (2W) per year retains:

  • Year 1: 397W
  • Year 5: 389W
  • Year 10: 379W
  • Year 25: 349W (~87% of rated)
  • Year 30: 339W (~85% of rated)

Premium panels are warranted to do better. These are guarantees on two specific models, not measured field results:

Cell technologyWarranted annual degradationOutput floorExample
TOPCon0.40%87.4% at year 30Jinko Tiger Neo JKM580-605N-72HL4-(V)
HJT0.25%92% at year 25REC Alpha Pure-R

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 design qualification standard screens for several of these with 1,000 hours of damp heat and 200 thermal cycles between -40 and +85 deg C, though the standard itself says passing is not a prediction of lifetime. 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. Commercial crystalline silicon modules averaged 22.7% efficiency in 2024 shipments and degrade at a median of roughly 0.5% per year, with warranties running 25 to 30 years. Most US residential installs are grid-tied, with net metering or net billing 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. The shipment-weighted average efficiency of crystalline silicon modules was 22.7% in Q4 2024 under standard test conditions (Fraunhofer ISE, 2026).
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), and a residential string of panels in series runs at several hundred volts. 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. The Enphase IQ8A microinverter, for example, is rated at 97% CEC-weighted efficiency.
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. Most US home solar still stays connected to the grid: Berkeley Lab data shows batteries were paired with 37% of new residential installations in 2025, up from 25% in 2024.
How long do solar panels actually last?
Warranties run 25 to 30 years. The REC Alpha Pure-R (HJT) guarantees 92% of rated output at year 25 and the Jinko Tiger Neo (TOPCon) guarantees 87.4% at year 30. The median degradation rate in a review of nearly 2,000 published measurements is 0.5% per year (Jordan and Kurtz, NREL), and NREL's fleet analysis puts median system degradation at -0.5 to -0.75% per year.

Sources