Widgets

How to Add a Photoelectric Effect Simulator to Your Website

LK Forge · 4 min read · Updated September 2026

You can add a full photoelectric effect simulator to any website, blog, or classroom page with a single line of code — free, with no sign-up, no plugin, and no script to install. Visitors press play and watch light knock electrons off a metal, then discover for themselves why a brighter beam of the wrong colour does nothing at all. This guide covers the fastest way to embed the Photoelectric Effect Simulator, what it teaches, and where it works.

The quickest way: paste one embed snippet

An embed is just an <iframe> that loads the simulator from lkforge.com, plus a small credit line. Copy this into your page’s HTML where you want the widget to appear:

<iframe src="https://lkforge.com/embed/photoelectric-effect/"
        width="100%" height="1040" loading="lazy"
        style="border:0;max-width:560px"
        title="Photoelectric Effect Simulator by LK Forge"></iframe>
<p><a href="https://lkforge.com/tools/physics/photoelectric-effect/">Photoelectric Effect Simulator</a>
   by <a href="https://lkforge.com/">LK Forge</a></p>

The <iframe> is the live simulator; the <p> underneath is a plain credit link. Keep that line — the visible link is what keeps the widget free to embed. You can also copy this exact code straight from the LK Forge widget gallery.

What the widget shows

The simulator opens already running, so a visitor sees light ejecting electrons immediately and can then take control:

  • Wavelength and intensity: change the colour of the light and how bright it is, and watch which changes actually turn the current on.
  • Choice of metal: pick caesium, sodium, zinc, copper and more — each has its own work function and therefore its own threshold.
  • Stopping voltage: apply a retarding voltage until the fastest electrons are turned back and the current falls to zero — a direct measure of their maximum kinetic energy.
  • KEmax vs frequency graph: the live plot marks the current operating point on a straight line whose slope is Planck’s constant, so the whole Einstein equation is visible at a glance.

Pick the right height

The snippet uses height="1040", which fits the apparatus, the controls, the readouts and the graph without clipping even on a narrow phone, where they stack into one column. On a wider page the widget centres within its max-width:560px. That single height works across screen sizes, so there is nothing to tweak for mobile.

Where it works

Because it is a standard iframe, the embed works anywhere you can add HTML:

  • WordPress: add a Custom HTML block and paste the snippet.
  • Squarespace: use a Code / Embed block.
  • Wix: add an Embed HTML / iframe element.
  • Ghost: insert an HTML card.
  • Notion: paste the /embed/photoelectric-effect/ URL and choose "Create embed".
  • Plain HTML, an intranet, or a lesson page: paste the snippet straight into the markup.

That’s the whole job. Copy the embed code from the widget gallery and paste it wherever a physics lesson or a blog post on quantum theory, photons or modern physics needs an experiment students can actually run.

Grab the embed code from the LK Forge widget gallery — free, no sign-up.

Open the Photoelectric Effect Simulator

Frequently asked questions

Is embedding the photoelectric effect simulator free?
Yes. It is free to embed on any site, with no account, no API key and no usage limits. The whole simulation runs in your visitor’s own browser, so there is no server cost — we only ask that you keep the small "Photoelectric Effect Simulator by LK Forge" credit line that comes with the embed code.
What can visitors do with the embedded simulator?
They can press play to watch light strike a metal cathode and eject electrons toward a collector, then take control: change the wavelength of the light, its intensity, and the metal (which sets the work function), and apply a retarding stopping voltage. A live panel shows the photon energy, the maximum electron kinetic energy, the threshold wavelength and the photocurrent, alongside a graph of KEmax against frequency.
Does the embed teach the threshold and Planck’s constant?
Yes — those are its main teaching points. Hold a low-frequency light at full intensity and no electrons come off at all; cross the threshold frequency and the current switches on at once. The KEmax-versus-frequency graph is a straight line whose slope is Planck’s constant h, exactly the measurement Millikan used to confirm Einstein’s equation, and the stopping voltage reads the maximum kinetic energy directly.
What iframe height should I use, especially on mobile?
The snippet ships with height="1040", which is tall enough that the apparatus, the controls, the readouts and the KEmax-versus-frequency graph all fit without clipping even on a narrow phone where everything stacks into a single column. On a wider page the widget simply centres within its max-width of 560px. If you want it shorter you can lower the height, but 1040 is the safe default across screen sizes.
Where can I embed it — WordPress, Wix, Squarespace, Notion?
Anywhere you can add HTML, because it is a standard iframe. In WordPress use a Custom HTML block; in Squarespace a Code/Embed block; in Wix an Embed HTML element; in Ghost an HTML card; in Notion paste the /embed/photoelectric-effect/ URL as an embed. On a plain HTML page or an intranet, paste the snippet straight into the markup.
Does the embedded simulator track visitors or set cookies?
No. Everything runs locally in the visitor’s browser — nothing is uploaded. The embed sets no tracking cookies and sends no analytics, so it is safe to place on a privacy-sensitive site, an intranet, or a page for students.