7
http://www.instructables.com/id/Visualizing-Circuits/ Food Living Outside Play Technology Workshop Visualizing Current Flow through a Resistor Circuit by StumpChunkman on January 28, 2013 Table of Contents Visualizing Current Flow through a Resistor Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intro: Visualizing Current Flow through a Resistor Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 1: What you need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 2: Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 3: Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Step 4: Final Visualizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Visualizing Circuits

Embed Size (px)

Citation preview

Page 1: Visualizing Circuits

http://www.instructables.com/id/Visualizing-Circuits/

Food      Living       Outside        Play        Technology       Workshop

Visualizing Current Flow through a Resistor Circuitby StumpChunkman on January 28, 2013

Table of Contents

Visualizing Current Flow through a Resistor Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro:   Visualizing Current Flow through a Resistor Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1:   What you need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2:   Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3:   Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 4:   Final Visualizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Page 2: Visualizing Circuits

http://www.instructables.com/id/Visualizing-Circuits/

Author:StumpChunkman

Intro:  Visualizing Current Flow through a Resistor CircuitI 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 electricityworks. 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 toaccomplish 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 withhow 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 onat 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 oftiny 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:

link: http://youtu.be/rg8dMVCfwSM

File Downloads

ResistorCircuit.zip (31 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'ResistorCircuit.zip']

Step 1: What you needYou only need a couple of things to you this, and chances are, if you're reading this (and not on a moblie device), you're already well on your way to having all thematerials.

What you'll need:

Computer capable of running:Processing (which also needs the ControlP5 library installed)Zip files (linked to in intro step).

(This program works as of versions 2.04 of Controlp5 and 2.0 Processing.)

Basically, if you have a computer, you're good.

Page 3: Visualizing Circuits

http://www.instructables.com/id/Visualizing-Circuits/

Step 2: TutorialIn 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 yoursystems 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 theResistorCircuit.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 filesshould 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.

Image Notes1. Guess what this does.2. Contains basic information on what's happening in the circuit.3. All the controls needed to interface with the program.4. Circuit Selections menu. Lets you choose between a series and parallel circuit.5. Main window.

Page 4: Visualizing Circuits

http://www.instructables.com/id/Visualizing-Circuits/

Image Notes1. Default window once tutorial is skipped. Options for both series and parallelpresent in menu below.

Step 3: ErrorsI'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 forthe 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 ofprogramming.

Image Notes1. Switch connects circuit.

Image Notes1. Power Control

Page 5: Visualizing Circuits

http://www.instructables.com/id/Visualizing-Circuits/

Image Notes1. Battery ground is connected directly to power, you blew up the battery, youshould add some resistance.

Step 4: Final VisualizationsAs 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 Currentview, 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 andit 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 bybouncing 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 betweenthe 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. Thepercentages are associated with the resistor color bars.

Final Thoughts: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'sfinal 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 itwouldn't look good.

Page 6: Visualizing Circuits

http://www.instructables.com/id/Visualizing-Circuits/

Image Notes1. More Wattage then should be put here, the resistor might explode.

Image Notes1. R1 color2. R2 color3. R3 color4. Background colors associate R1, R2 and R3 with values in the details sectionbelow.

Image Notes1. Only one color for series as Current in series in constant throughout thecircuit.

Page 7: Visualizing Circuits

http://www.instructables.com/id/Visualizing-Circuits/

Image Notes1. One color for voltage, as voltage in parallel doesn't change.

Related Instructables

Electronics ForDummies:Resistors byBeta Mode

How electricityand electronicsworks byrickharris

Electronics forAbsoluteBeginners,Chapter 2 byelektrobot

Introduction tothe LightEmitting DiodeUsing SnapCircuits (Photos)by KRA5H

Install an LED ina ToneGeneratorCircuit ToVisualize aSquare Wave(Photos) byKRA5H

A CompleteGuide To BasicElectronics. byCew27

Advertisements