Skip to content

Instantly share code, notes, and snippets.

@glukki
Last active January 20, 2022 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glukki/6e17c950ab9f19c8ed05463926c8dc5b to your computer and use it in GitHub Desktop.
Save glukki/6e17c950ab9f19c8ed05463926c8dc5b to your computer and use it in GitHub Desktop.
Proxmark3 Easy LF Ferrite Antenna for Implant Calculator
const CoilLDRatioToCapacitanceFactor = [[0.1, 0.96], [0.125, 0.875], [0.15, 0.79], [0.175, 0.745], [0.2, 0.7], [0.225, 0.67], [0.25, 0.64], [0.275, 0.62], [0.3, 0.6], [0.325, 0.585], [0.35, 0.57], [0.375, 0.555], [0.4, 0.54], [0.425, 0.53], [0.45, 0.52], [0.475, 0.51], [0.5, 0.5], [0.525, 0.495], [0.55, 0.49], [0.575, 0.485], [0.6, 0.48], [0.625, 0.4775], [0.65, 0.475], [0.675, 0.4725], [0.7, 0.47], [0.725, 0.4675], [0.75, 0.465], [0.775, 0.4625], [0.8, 0.46], [0.825, 0.46], [0.85, 0.46], [0.875, 0.46], [0.9, 0.46], [0.925, 0.46], [0.95, 0.46], [0.975, 0.46], [1, 0.46], [1.125, 0.4625], [1.25, 0.465], [1.375, 0.4675], [1.5, 0.47], [1.625, 0.4775], [1.75, 0.485], [1.875, 0.4925], [2, 0.5], [2.125, 0.515], [2.25, 0.53], [2.375, 0.545], [2.5, 0.56], [2.625, 0.5725], [2.75, 0.585], [2.875, 0.5975], [3, 0.61], [3.125, 0.625], [3.25, 0.64], [3.375, 0.655], [3.5, 0.67], [3.625, 0.6825], [3.75, 0.695], [3.875, 0.7075], [4, 0.72], [4.125, 0.7325], [4.25, 0.745], [4.375, 0.7575], [4.5, 0.77], [4.625, 0.78], [4.75, 0.79], [4.875, 0.8], [5, 0.81], [5.125, 0.82375], [5.25, 0.8375], [5.375, 0.85125], [5.5, 0.865], [5.625, 0.87875], [5.75, 0.8925], [5.875, 0.90625], [6, 0.92], [6.125, 0.93125], [6.25, 0.9425], [6.375, 0.95375], [6.5, 0.965], [6.625, 0.97625], [6.75, 0.9875], [6.875, 0.99875], [7, 1.01], [7.125, 1.02375], [7.25, 1.0375], [7.375, 1.05125], [7.5, 1.065], [7.625, 1.07875], [7.75, 1.0925], [7.875, 1.10625], [8, 1.12], [8.125, 1.1325], [8.25, 1.145], [8.375, 1.1575], [8.5, 1.17], [8.625, 1.1825], [8.75, 1.195], [8.875, 1.2075], [9, 1.22], [9.125, 1.2325], [9.25, 1.245], [9.375, 1.2575], [9.5, 1.27], [9.625, 1.2825], [9.75, 1.295], [9.875, 1.3075], [10, 1.32], [10.3125, 1.35375], [10.625, 1.3875], [10.9375, 1.42125], [11.25, 1.455], [11.5625, 1.48875], [11.875, 1.5225], [12.1875, 1.55625], [12.5, 1.59], [12.8125, 1.62375], [13.125, 1.6575], [13.4375, 1.69125], [13.75, 1.725], [14.0625, 1.75875], [14.375, 1.7925], [14.6875, 1.82625], [15, 1.86], [15.3125, 1.89125], [15.625, 1.9225], [15.9375, 1.95375], [16.25, 1.985], [16.5625, 2.01625], [16.875, 2.0475], [17.1875, 2.07875], [17.5, 2.11], [17.8125, 2.14125], [18.125, 2.1725], [18.4375, 2.20375], [18.75, 2.235], [19.0625, 2.26625], [19.375, 2.2975], [19.6875, 2.32875], [20, 2.36], [20.3125, 2.39375], [20.625, 2.4275], [20.9375, 2.46125], [21.25, 2.495], [21.5625, 2.52875], [21.875, 2.5625], [22.1875, 2.59625], [22.5, 2.63], [22.8125, 2.66375], [23.125, 2.6975], [23.4375, 2.73125], [23.75, 2.765], [24.0625, 2.79875], [24.375, 2.8325], [24.6875, 2.86625], [25, 2.9], [25.3125, 2.93125], [25.625, 2.9625], [25.9375, 2.99375], [26.25, 3.025], [26.5625, 3.05625], [26.875, 3.0875], [27.1875, 3.11875], [27.5, 3.15], [27.8125, 3.18125], [28.125, 3.2125], [28.4375, 3.24375], [28.75, 3.275], [29.0625, 3.30625], [29.375, 3.3375], [29.6875, 3.36875], [30, 3.4], [30.625, 3.475], [31.25, 3.55], [31.875, 3.625], [32.5, 3.7], [33.125, 3.775], [33.75, 3.85], [34.375, 3.925], [35, 4], [35.625, 4.075], [36.25, 4.15], [36.875, 4.225], [37.5, 4.3], [38.125, 4.375], [38.75, 4.45], [39.375, 4.525], [40, 4.6], [40.625, 4.675], [41.25, 4.75], [41.875, 4.825], [42.5, 4.9], [43.125, 4.975], [43.75, 5.05], [44.375, 5.125], [45, 5.2], [45.625, 5.275], [46.25, 5.35], [46.875, 5.425], [47.5, 5.5], [48.125, 5.575], [48.75, 5.65], [49.375, 5.725], [50, 5.8]];
const getAntennaFrequency = (
corePermeability = 400,
coreDiameterMeters = 0.008,
wireDiameterMeters = 0.00025,
turns = 117,
) => {
const coilAreaMeters2 = Math.PI * Math.pow(coreDiameterMeters / 2, 2);
const coilLengthMeters = wireDiameterMeters * turns;
const ldRatioRaw = coilLengthMeters / coreDiameterMeters;
const coilCapacitanceFactor = CoilLDRatioToCapacitanceFactor.reduce(function (memo, item) {
if (Math.abs(item[0] - ldRatioRaw) < Math.abs(memo[0] - ldRatioRaw)) {
return item;
}
return memo;
})[1];
const capacityFarads = coilCapacitanceFactor * coreDiameterMeters / 10000000;
const inductanceHenry = corePermeability * Math.pow(turns, 2) * coilAreaMeters2 * 1.26 / 1000000 / coilLengthMeters;
const cycleSeconds = Math.PI * Math.sqrt(inductanceHenry * capacityFarads); // * 2; // is it because of Proxmark3 Easy internal capacitor?
const resonantFrequencyHz = 1 / cycleSeconds;
return {
coilLengthMeters,
capacityFarads,
inductanceHenry,
resonantFrequencyHz,
};
};
console.log(getAntennaFrequency(400, 8 / 1000, 0.25 / 1000, 117));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment