Electric circuit and Ohm’s law simulator
A battery, three resistors, a bulb, an ammeter and a voltmeter: series or parallel? Work out the current and watch the bulb glow. One prompt.

✓ Prompt tested in Gemini (signed out): worked 3 out of 3 times
- Level
- Intermediate
- You make
- A virtual electricity lab in one HTML file
- Age
- 12+
- Time
- ≈ 30 min
- Tools
- Gemini
- Account
- Not needed
What you’ll get
An SVG circuit diagram, sliders for voltage and resistances, a “series / parallel” switch and an on/off switch. The meters show current and voltage, charges run along the wires, and the bulb glows brighter or dimmer. Press “Play the example” above — Gemini made it from the prompt below.
Steps
-
Open gemini.google.com. If you’re under 13, do it together with a parent, on their device.
-
Copy the whole prompt and send it:
Make an "Electric Circuit" lab in one HTML file. Don't load anything from the internet: no Tailwind, CDN, fonts, images or libraries — only your own CSS and JavaScript inside the file. Don't save anything in browser storage. Draw a battery, three resistors and a bulb in SVG. Sliders: battery voltage from 1 to 12 V and the resistance of each resistor from 1 to 100 Ω. A "series / parallel" switch and an on/off switch. Use Ohm's law to calculate the total resistance, the current and the voltage across each part, and show them on round ammeter and voltmeter dials. Dots (charges) run along the wires (faster when the current is large), and the bulb's brightness depends on its power. Everything should look good on a phone. Show the result in Canvas. -
Wait about a minute, press Preview and try every button and slider.
-
Check the AI (see the question above).
-
Press Download (sometimes it’s under the Export menu). The file opens in any browser. Show it off in class!
Change the prompt
Before sending, swap a few words to make your own version. Change only the words, and keep the rules about the internet and Canvas.
- “three resistors” → “two resistors”
- “from 1 to 12 V” → “from 1 to 24 V”
If it doesn’t work
- The AI says it changed everything, but the result looks the same? Write:
Nothing changed. Show the updated version in Canvas. - No Preview button? Write:
Show the result in Canvas. - The current is lower in parallel than in series? That is an AI mistake! Write: “The total resistance is wrong for the parallel connection. Fix it using the formula 1/R = 1/R1 + 1/R2 + 1/R3.”
Sending work to the gallery opens soon.