solved: Calculate resistance between two points from a PNG image? - Page 1
Forum section: electronics / projects

author: incf
author_rank: Frequent Contributor
timestamp: March 28, 2025, 07:57:47 pm
content: I need to design some custom printed carbon resistor networks.Are there any programs that can take a PNG image and allow the user to measure the resistance between two arbitrary points? (assuming a certain resistance per square)I'd rather not write a complex computer program if I don't have to.addendum: if anyone has literature that they could recommend about the design of printed resistor elements/networks, I'd gladly read it

author: jwet
author_rank: Frequent Contributor
timestamp: March 28, 2025, 08:48:04 pm
content: Just some ideas -There are image analysis toolboxes for python. I've seen one called Basler at a show and it looked cool. I'm sure there are lots. Your problem is pretty simple. Maybe even OpenCV.If you want to design R's, here are a couple of ideas.Its been a long time ago but Autocad had lines with a controllable width called Polylines- there was an area command that would tell you area of arbitrary lines.The other way might be to make standard squares and have them object snap together in a PCB or Mechanical cad package. You could then just count the squares.

author: incf
author_rank: Frequent Contributor
timestamp: March 28, 2025, 08:57:04 pm
content: I wish I could just count squares, but need to have some "funky" curved/tapered profiles and intersections for manufacturing/space usage reasons. The total number of parallel/series squares needed to represent curves is way to high for me to do by hand.

author: moffy
author_rank: Super Contributor
timestamp: March 28, 2025, 10:18:03 pm
content: I think the first step would be converting the PNG into a Vector format e.g. SVG which is geometric in its expression and should be easier to analyse. Inkscape has that capabilityhttps://designbundles.net/design-school/how-to-convert-a-jpegpng-to-a-vector-in-inkscape

author: Benta
author_rank: Super Contributor
timestamp: March 28, 2025, 11:54:34 pm
content: Quote from: incf on March 28, 2025, 08:57:04 pmWell. then show us how it really looks with "funky curves",

author: radiolistener
author_rank: Super Contributor
timestamp: March 29, 2025, 12:13:58 am
content: In other words, you want to calculate the path length based on an image?One approach is to pixelate the image so that each pixel represents the minimum unit area of the conductive path. After that, if there is no parallel path, just remove the pixels that are not part of the path and simply count the remaining black pixels. This should give you an estimate of the total path length.

author: incf
author_rank: Frequent Contributor
timestamp: March 29, 2025, 12:24:35 am
content: Quote from: radiolistener on March 29, 2025, 12:13:58 amI need to simulate a 2D matrix of resistive elements with a particular shape. For example, the shape given shown in the sample image. One pixel is one cell in a matrix/network of resistive elements. Each shaded pixel/cell is connected to their neighbors on all 4 sides.Oftentimes the inputs to these sorts of 2D resistance simulations can exceed 3000x3000 pixels/elements.It's fairly common (but error prone and time consuming) to write a matlab scripts to do stuff like this.It's been done a million times before, but I'm having trouble finding the appropriate simulation tools on the 'netsimilar tools/scripts/utilities are widespread for certain limited types of magnetic, electrostatic, thermal, and mechanical-rigidity simulations

author: tggzzz
author_rank: Super Contributor
timestamp: March 29, 2025, 12:37:41 am
content: Teledeltos paper plus a multimeterhttps://en.m.wikipedia.org/wiki/Resistance_paperhttps://en.m.wikipedia.org/wiki/Teledeltos

author: incf
author_rank: Frequent Contributor
timestamp: March 29, 2025, 12:48:32 am
content: I stumbled across the FEMM simulation tool which potentially could be coaxed into doing something like this. Very clunky interface and would need a ton of custom scripting.Still looking for simpler toolsets.Quote from: tggzzz on March 29, 2025, 12:37:41 amI wish I could do that. Alas, I'm stuck with the simulators.

author: zapta
author_rank: Super Contributor
timestamp: March 29, 2025, 12:54:22 am
content: Chat GPT suggest to use Finite Element Method using the open source python libraryhttps://fenicsproject.org/You can try asking it for more specific details.

author: mawyatt
author_rank: Super Contributor
timestamp: March 29, 2025, 01:10:31 pm
content: Quote from: tggzzz on March 29, 2025, 12:37:41 amThat brings back memories from grad school of doing field analysis of arbitrary shapes before EM tools were available. Recall we used silver paint for the conductor pattern, connected to a Power Supply and a Simpson/Triplett VOM to find and plot the equal potential lines!!Now that's "old school"Best

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: March 29, 2025, 01:49:31 pm
content: Hi,You can approximate this by counting squares. You need to the sheet resistivity of of the material. For 1 oz copper the sheet resistivity is 500u Ohms per square. The dimensions of the square doesn't matter.One square is R, to squares in series is 2R. Place two in parallel you are back to R. So you only need to know how many squares in series.The squares where the path goes through opposite sides the value is R. Where the current leaves on adjacent side the resistance of that square is less than R. The corner squares are R/2.Jay_Diddy_B

author: uer166
author_rank: Super Contributor
timestamp: March 29, 2025, 01:51:12 pm
content: Yes!!! Search IDC2D, it does exactly what you are asking for in a simple and easy way.

author: uer166
author_rank: Super Contributor
timestamp: March 29, 2025, 01:51:50 pm
content: https://idc2d.sourceforge.net/

author: eugene
author_rank: Frequent Contributor
timestamp: March 29, 2025, 02:04:22 pm
content: It does look like IDC2D might work for you, especially if it has some kind of scripting capability or can be interfaced with another application. I know nothing about it beyond skimming the web page.I used FEMM years ago to perform magnetostatics simulations. Since then the ability to perform current flow simulations has been added. I played around with it a little and I'm pretty sure it can do what you need provided you can supply the geometry as a set of primitives in the form of points, lines, and arcs. It apparently will import a dxf file, so if you can convert your png file to a dxf, then your good, but I think any form of vector graphics could be made to work.The nice thing about FEMM is that it has the Lua scripting language built-in. In fact, once the scripts are written, you wouldn't need to use the graphical interface at all; provide the geometry in vector form and the script could spit out the resistance.

author: incf
author_rank: Frequent Contributor
timestamp: March 29, 2025, 02:14:30 pm
content: Quote from: uer166 on March 29, 2025, 01:51:12 pmQuote from: uer166 on March 29, 2025, 01:51:50 pmQuote from: eugene on March 29, 2025, 02:04:22 pmThat looks perfect. Between that and FEMM I should be in good shape.Thank you everyone!