Introduction: Visualizing Current Flow Through a Resistor Circuit
I tend to help people out when they have electronics projects they want advice on. I have a basic understanding of electronics, and don't really know how electricity works. I had that idea that creating a visualization of the electron flow within a circuit might help me understand better what's going on, and this is my attempt to accomplish that.
A few things to understand before you go in, I used electron flow and my interpretation of what's going on within a circuit to make this visualization. If you don't agree with how I displayed things, that's totally fine, and a whole lot of people would probably agree with you. There's a whole bunch of conflicting arguments about what's going on at the electron level since we can't see what's going on there, that's why I made this, and that's why no one can be right. Personally, I ascribe to Kenn Amdahl's view of tiny green men who just like to party. It actually makes the most sense to anything I've read.
Here's a quick video of the finished application:
Step 1: What You Need
What you'll need:
- Computer capable of running:
- Processing (which also needs the ControlP5 library installed)
- Zip files (linked to in intro step).
Basically, if you have a computer, you're good.
Step 2: Tutorial
In order to run the application, download Processing, ControlP5, and the zip file in the intro step. Install Processing, then install the ControlP5 library according to your systems requirements. Finally, once everything is installed, and you've run Processing and know where your sketch folder is, you're ready for this sketch. Unzip the ResistorCircuit.zip file (linked in the first step) to your sketch folder. Open Processing, in the file drop down, select Sketchbook, and then select ResistorCircuit. All files should be opened. You can click the run button to start the code.
When you first run the code, you'll be presented with a tutorial on how the interface works. You can look at the image over text for further explanations.
Step 3: Errors
I've done my best to anticipate any errors that might come up and pre-code for them. There is still one issue in the program, I didn't want to create another set of code for the tutorial circuit, so one of the resistors changes all of the circuit's information but isn't represented in the visualization. It was around this point that I got a bit tired of programming.
Step 4: Final Visualizations
As I stated in the intro, I decided to use an Electron Flow model to visualize the current flow. If it makes you feel more comfortable thinking in a Conventional Current view, just reverse everything you see in your head.
Electrons are represented by the tiny dots flowing through the circuit.
Wattage is displayed by color of the resistor. I set the rating of the resistors to 1/4 watt. Once they reach 1/4 watt they become bright red. There are variations of red and it isn't until it's at it's brightest that the resistor is blown out.
Current is displayed by flow of electrons. Electrons flow from the negative side of the battery to the positive side.
Voltage is displayed by how far the electrons are able to spread from the wire. I saw voltage as excitement, and excitement I decided would best be represented by bouncing off of the walls. The more voltage there is through one leg of a circuit, the farther the spread of electrons.
Differences between current and voltage in a series circuit vs a parallel circuit can be easily seen here, and can be further displayed by clicking back and forth between the series and parallel circuit selections.
The details menu shows total Wattage Amperage and Voltage being used in the circuit. It also shows percentage of that amount present on each resistor. The percentages are associated with the resistor color bars.
Overall this project was a lot of fun, and there's a lot more that I'd like to add to this application, but I really don't want to code anymore, which means this is probably it's final state. I hope you like!
Also, I haven't printed the code in any step for two reasons. First, it's linked in the zip file in the first step. Second, and more importantly, there is a lot of code, and it wouldn't look good.