A rheostat controls the size of the electric current by changing the resistance in a circuit using a resistive track and a movable slider. Moving the slider changes the length of the resistive path, so a longer path gives a larger resistance and smaller current, while a shorter path gives a smaller resistance and larger current.
This morning, I was watching my students conduct an experiment with a rheostat and saw a few of them connecting the two lower plugs (A and B as shown in the simulation). I had to explain to them why the current would not change no matter how they move the slider. Then it occurred to me that this could be best explained using a simulation. So I created this simple simulation using a little vibe-coding to help my students visualise current flow through a rheostat, hopefully preventing them from connecting it the wrong way.
I used the following prompt on Trae.ai: “Create this html simulation of a rheostat. The canvas should show a realistic image of a rheostat with its three plugs. One above, next to the rod on which the slider is resting. Two on either side of the coil of wire. The user can connect two wires to any of the three plugs. The simulation should show the direction of current flow, from one terminal out to the other terminal. The resistance value will then be shown. Make the maximum resistance 20 ohm.”
It produced a working prototype within one prompt. I then made further prompts changes to refine the app. Trae.ai makes fast iterations much less painful as it only makes the changes to the necessary codes without having to generate the whole set of codes from scratch.
For Singapore teachers, this simulation is optimised for SLS and is directly embeddable to SLS as my github domain is whitelisted. Just paste the URL (https://physicstjc.github.io/sls/rheostat/) after clicking “Embed website”.
