We were all studying circuits in Mr. Harvie's AP Physics C class at Torrey Pines High School, and we realized that there should be a streamlined method to automatically solve for unknown values in DC circuits. We thought it could be a helpful tool not only for students, but also electrical engineers who need to solve basic circuits in order to analyze more complex ones. After looking online, we found that there is no current service online that can solve circuits with the only input being a picture.

We are eligible for all prizes that don't require the use of a specified API or device.

What it does

The CircuitSolver5000 can accurately solve missing values in DC circuits. Although limited to batteries and resistors, the algorithm can support a high level of complexity in current paths, and can also be used to solve for smaller circuits that are part of a larger machine.

It first takes the user input of a jpeg circuit picture. Instead of traditional symbols for resistors, batteries, and other components, the user must denote parts with color. The resistors and batteries are represented with a red and blue dot, respectively. Additionally, a green dot is drawn on every node, to more efficiently solve for different paths the current can take.

The system uses color thresholding and recognition to detect and solve for the pixel locations of the resistors, nodes, and batteries. Then, output serves as the input for the algorithm to calculate combined resistances, and eventually total resistance.

To algorithmically process the resistors, we needed a way to store in paths information about resistors being in series or in parallel. To do this, we created a new method of representing the different resistance paths the current can take. Automatically generated multidimensional nested arrays grouped together series and parallel circuits in unique ways, following the path of the current. When a new array starts in the storage, the algorithm automatically recognizes this as a switch from series to parallel. Through this method, the numerous branches and parallel circuits could be represented in a matrix that then solved for combined resistances.

How I built it

The color recognition and detection component that found pixel locations of all circuit components and the resistor combination algorithm that then solved for missing components were built entirely by us in python, without the use of opensource code.

Challenges I ran into

One challenge we faced was translating the circuit picture into the locations of all the resistors, batteries, and nodes. At first, we tried to use letter recognition and circle detection by denoting components as letters inside circles. For example, a resistor would be drawn as an R inside a circle. However, we found that using color to denote different components was more efficient, because no training or testing data was necessary.

The biggest challenge we faced was translating the locations into concrete information about the circuit, specifically the resistors in parallel and series. To solve this, we used nested arrays and denoted groups of parallel circuits with extra sets of brackets. In the resistance combination, the algorithm would first inversely combine the parallel circuits, then automatically group together all remaining components.

Accomplishments that I'm proud of

We're extremely proud of the algorithm's ability to solve more complicated circuits. At first, we thought that we would only be able to solve the most basic circuits, but our resistance combination algorithm proved to be accurate as we increased the complexity of the pathways.

What I learned

We learned so much about the different ways that a computer can turn user input into the needed information. Through our experimenting with binary trees, node maps, and recursive pathways, we learned how to combine these concepts into an algorithm.

What's next for CircuitSolver5000

We hope to introduce capacitors, inductors, and more batteries into our algorithm. We also want to turn our system into an app.

Built With

Share this project: