Skip to content

FrankBuss/mesh

Repository files navigation

Infinite Grid Resistor Mesh Test Board

Overview

A popular question is the resistance between nodes in an infinite grid of resistors, like this:

Circuit Diagram (Illustration)

This project implements a 30x30 node resistor mesh for testing it approximately. The mesh contains 1,740 resistors (870 horizontal + 870 vertical connections), each a 1kΩ 0805 SMD resistor with 0.1% precision.

Automated Design Generation

For creating the PCB layout, I used the mesh.py Python script, which automates the placement of the resistors, connections, and vias on each node for easier measurement in the grid pattern, for a KiCAD board, looks like this:

PCB Layout

You can download the board here: mesh.kicad_pcb.

Manufacturing

The board was manufactured by JLCPCB, including populating all resistors, using the following production files:

5 boards, 2 of them with populated resistors, did cost $259.99 with shipping.

Manufactured Board

Assembled PCB - View 1 Assembled PCB - View 2

Measurements vs Theory

Measured Values

  • Adjacent nodes (15,15) to (16,15): 500.2 Ω
  • Diagonal nodes (14,14) to (15,15): 640 Ω
    • This is a (1,1) separation: 1 node horizontally, 1 node vertically
  • Knight's move (14,14) to (16,15): 778 Ω (as in xkcd #356)
    • This is a (2,1) separation: 2 nodes horizontally, 1 node vertically

Theoretical Values (Infinite Grid)

For an infinite 2D square resistor grid with resistance R per element, the theoretical analysis gives the resistance between nodes separated by (m,n) as:

General formula (equation 9 from the analysis):

$$R_{(m,n)} = \frac{1}{\pi} \int_0^{\pi} \frac{[1 - e^{i(n\arccos(2-\cos(\alpha)))}] \cos(m\alpha)}{\sin[\arccos(2-\cos(\alpha))]} \, d\alpha$$

This integral evaluates to specific values:

Adjacent nodes (1,0):

$$R_{(1,0)} = \frac{1}{2} \cdot R = 500 \text{ Ω}$$

Diagonal nodes (1,1):

$$R_{(1,1)} = \frac{2}{\pi} \cdot R = 0.63662 \cdot R = 636.62 \text{ Ω}$$

Knight's move (2,1):

$$R_{(2,1)} = \left(\frac{4}{\pi} - \frac{1}{2}\right) \cdot R = 0.77324 \cdot R = 773.24 \text{ Ω}$$

Finite Grid Simulation

Since our grid is finite (30x30), edge effects cause small deviations from the infinite grid values. The simulate_grid.py script uses nodal analysis to solve the exact resistance values for the finite grid:

Method: The simulation builds an admittance matrix based on Kirchhoff's current law, injects 1A between two nodes, and solves for all node voltages using sparse matrix methods.

Simulated values for 30x30 grid:

  • Adjacent (15,15) to (16,15): 500.61 Ω (vs infinite: 500.00 Ω)
  • Diagonal (14,14) to (15,15): 637.84 Ω (vs infinite: 636.62 Ω)
  • Knight's move (14,14) to (16,15): 776.29 Ω (vs infinite: 773.24 Ω)

Comparison of measured values with theory:

Configuration Measured Infinite Grid Finite Grid (30x30) Error vs Infinite Error vs Finite
Adjacent (1,0) 500.2 Ω 500.00 Ω 500.61 Ω 0.04% 0.08%
Diagonal (1,1) 640.0 Ω 636.62 Ω 637.84 Ω 0.53% 0.34%
Knight's move (2,1) 778.0 Ω 773.24 Ω 776.29 Ω 0.62% 0.22%

These results demonstrate:

  1. The 30x30 mesh closely approximates an infinite grid (measured values within 0.62% of infinite theory)
  2. Edge effects account for most of the discrepancy (finite grid simulation explains the differences)
  3. The 0.1% precision resistors and JLCPCB assembly quality are excellent (< 0.34% error vs simulation)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages