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 · 11 min read
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.

TL;DR: Photons carrying more than 1.12 eV of energy hit a silicon cell and knock electrons loose from valence band to conduction band. The P-N junction has a permanent internal electric field that pushes free electrons toward one face and "holes" (electron vacancies) toward the other, creating DC current in external wiring. A typical 400W panel converts 20-22% of incoming sunlight under STC conditions (1,000 W/m2, 25 deg C cell temperature). The DC runs through an inverter that makes AC at grid voltage and frequency, typically 240V at 60 Hz in the US or 230V at 50 Hz in most of Europe. Systems are grid-tied (sell surplus, buy shortfall) or off-grid (batteries). Roughly 95% of US residential systems are grid-tied because batteries cost more than grid backup. The photovoltaic effect has been understood since Edmond Becquerel observed it in 1839; the first practical silicon cell came from Bell Labs in 1954 at 4% efficiency. We're now at 22-23% module efficiency in volume production with TOPCon and HJT, with the LONGi Hi-MO X6 hitting 23.0%. For a system-level view, see our residential solar complete guide.

The thing that surprised me most working on solar systems was how little of the physics is new. The photovoltaic effect dates to 1839. 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 when certain electrolyte solutions produced a small voltage under light. 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. When one strikes a semiconductor with energy above the material's bandgap (the gap between valence and conduction bands), 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. The solar spectrum at Earth's surface (AM 1.5G reference) carries useful photons from roughly 280 nm (atmospheric UV cutoff) to 2,500 nm (where water vapor blocks longer wavelengths). Photons below 1.12 eV 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.

What about other semiconductors? Different bandgaps, different limits. Gallium arsenide (1.42 eV) reaches roughly 34% theoretical single-junction efficiency. Multi-junction cells stack materials with different bandgaps to catch more of the spectrum, and NREL has recorded 47% lab efficiency for six-junction cells under concentration.

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 (5 valence electrons versus silicon's 4) makes N-type silicon with extra mobile electrons. Doping with boron (3 valence electrons) 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. It's permanent, 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. That separation is the whole point. Without the junction, the pairs would just recombine and dump the energy as heat. With it, they're forced through an external circuit, which is 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, and the junction itself a fraction of a micrometre under the surface. Most absorption and separation happens in the first 50-100 micrometres. 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?

Separated electrons need a path out, and that path is the metallization on both faces of the cell. Fine silver grid lines (the visible busbars and fingers) collect electrons from the N-type emitter on top; an aluminum back-surface-field or copper contact collects holes from the P-type base underneath. This is the engineering knot: 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, 12, or 16 busbars instead of the old 3-5) cut those losses by shortening the electron's trip to the busbar. The LONGi Hi-MO X6 uses 9-busbar half-cut cells for exactly this.

Each cell produces roughly 0.55-0.65V open-circuit and 9-11A short-circuit at STC. Wire 60-72 cells in series and a panel reaches ~40-50V at the same current; string 10-15 panels and a residential array runs 400-700V DC. That DC flows through a junction box on each panel's back, into MC4 connectors, and on to the inverter. Junction boxes hold bypass diodes (typically 3 per 60-cell panel) that route current around shaded or damaged sub-strings, which is why partial shading doesn't kill a whole panel.

What Does the Inverter Do?

The inverter converts panel DC to AC at grid voltage and frequency, and that's harder than it sounds because the waveforms differ: DC is constant, AC swings sinusoidally between positive and negative peaks at 50 or 60 Hz. Modern inverters switch at high frequency (typically 16-20 kHz) using IGBTs or SiC MOSFETs, chopping the DC into thousands of pulses per second that a passive output filter smooths into a grid-matched sine wave.

Three subsystems matter:

  • Maximum Power Point Tracking (MPPT): the panel's V-I curve is non-linear and its peak power point shifts with temperature and irradiance. MPPT samples continuously and holds the peak. Modern inverters carry 2-4 MPPT channels so different orientations or shading can be optimized separately.
  • Grid synchronization: the inverter matches grid voltage and frequency in phase, exporting power by holding a slightly higher voltage so current flows outward. No sync, no safe connection.
  • Anti-islanding protection: it detects grid outages and disconnects within seconds (UL 1741), so it never energizes a downed line and shocks a utility worker. That's why grid-tied systems stay dark in a blackout unless they have battery backup.

Inverter efficiency runs 96-98% for residential models from SolarEdge, Enphase, SMA, and Fronius. The 2-4% loss becomes heat, so inverters need ventilation and don't last as long as panels: typically 12-15 years for string models, 20-25 for microinverters thanks to cooler operation.

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, exporting surplus and importing shortfalls. Net metering policy varies widely. Full retail net metering (still common in much of New York, Massachusetts, New Mexico) credits an exported kWh at the same rate as an imported one. Reduced policies like California's NEM 3.0 cut export rates by ~75% in 2023, pushing new installs toward batteries for self-consumption instead of grid arbitrage.

Off-grid systems pair panels, batteries, and a charge controller for full independence, but they cost far more: the battery bank alone runs $15,000-$45,000 for a typical 30-50 kWh capacity. They make sense when grid connection is extreme (remote properties, miles of line) or when autonomy matters regardless of cost. Hybrid systems use a hybrid inverter that runs grid-tied, manages battery charge/discharge, prioritizes self-consumption, and provides backup during outages via an automatic transfer switch. Hybrid is 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.

What About Microinverters and Power Optimizers?

String inverter systems wire panels in series so the whole string runs at one voltage and current, while module-level power electronics (MLPE) give each panel its own optimization point. Microinverters convert DC to AC at each panel. The Enphase IQ8A microinverter handles up to 480W input and outputs 240V AC, adding panel-level monitoring and no string-level shading loss, at a higher cost per watt and more roof hardware to service. DC optimizers like the SolarEdge P370 and Tigo TS4-A-O instead optimize each panel but pass DC up to a central string inverter. SolarEdge's needs a SolarEdge inverter; Tigo works with any compatible one. Optimizers cost less than microinverters.

When does MLPE pay off? Three cases:

  • Significant shading from chimneys, trees, or neighbors
  • Complex roof geometry with multiple orientations
  • 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. Most installs run MLPE anyway thanks to rapid shutdown, but it's worth knowing when you're paying for performance versus code compliance. 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). The LONGi Hi-MO X6 warranty guarantees 87.4% retention at year 30 (0.42%/year); REC Alpha Pure-R guarantees 92.0% at year 25 (0.32%/year). What drives the aging? Light-induced degradation (LID) in the first weeks, UV encapsulant browning as EVA yellows and blocks light, potential induced degradation (PID) 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, 200 thermal cycles between -40 and +85 deg C, and more before a panel can sell. Field data from 1990s systems shows many panels still above 70% of rated output after 30 years, well past the warranty floor. For more, see what happens when panels get old.

Citation capsule: Solar panels convert sunlight to electricity through the photovoltaic effect: photons with energy above silicon's 1.12 eV bandgap excite electrons across the band gap, and the built-in electric field of the P-N junction separates them as DC current (NREL, US DOE). Modern silicon panels achieve 20-23% module efficiency under STC conditions of 1,000 W/m2 irradiance and 25 deg C cell temperature, with industry-median degradation of 0.5% per year over their 25-30 year design life.

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. The full chain is panels, junction boxes, MC4 connectors, MLPE (often), inverter, AC disconnect, meter, and grid. None of it 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