component
TMCS1123B1AQDVGR - Isolated Hall-Effect Current Sensor
Public Made by Adomby adom
Texas Instruments TMCS1123B1AQDVGR: isolated Hall-effect current sensor, 25 mV/A with a 1.65 V zero-current output (linear +-62 A at 3.3 V), 80 A RMS continuous, 250 kHz, overcurrent detection, reinforced isolation, SOIC-10 wide body (DVG). KiCad, Fusion and Altium libraries, 3D model and datasheet.
main
John Lauer
Add symbol, footprint, Fusion and Altium libraries, viewers, provenance, README
ab389b2
8h ago
#!/usr/bin/env python3
"""Check the KiCad footprint pad by pad against TI's DVG0010A example board layout (SBOSA24D p.46, HV / isolation
option) and overlay the pads on the drawing. The drawing's blue pad outlines of the right-hand (HV) pattern are
found by colour; their span (11.40 mm = 9.75 + 1.65 across, 9.49 mm = 5.08 + 4.41 along) calibrates px/mm.
usage: fp_check.py fp.kicad_mod page46-300dpi.png out.png out.json"""
import sys, re, json
import numpy as np
from PIL import Image, ImageDraw
fp, page, out, outj = sys.argv[1:5]
s = open(fp).read()
pads = [dict(n=m[0], x=float(m[1]), y=float(m[2]), w=float(m[3]), h=float(m[4]))
for m in re.findall(r'\(pad "(\d+)" smd \w+ \(at (-?[\d.]+) (-?[\d.]+)\) \(size ([\d.]+) ([\d.]+)\)', s)]
# TI HV / isolation option, top view, KiCad Y down, pin 1 top-left
ref = {"1": (-4.875, -2.54, 1.65, 4.41), "2": (-4.875, 2.54, 1.65, 4.41)}
for k in range(3, 11): ref[str(k)] = (4.875, round(4.445 - (k - 3) * 1.27, 3), 1.65, 0.6)
rows = []
for p in pads:
r = ref[p["n"]]; d = [round(a - b, 4) for a, b in zip((p["x"], p["y"], p["w"], p["h"]), r)]
rows.append({"pad": p["n"], "footprint": [p["x"], p["y"], p["w"], p["h"]], "drawing": list(r), "delta": d, "match": all(abs(v) < 1e-3 for v in d)})
inner = min(p["x"] - p["w"] / 2 for p in pads if p["x"] > 0) - max(p["x"] + p["w"] / 2 for p in pads if p["x"] < 0)
im = Image.open(page).convert("RGB"); A = np.array(im).astype(int); H, W = A.shape[:2]
blue = (A[..., 2] > 150) & (A[..., 0] < 80) & (A[..., 1] < 170) & (A[..., 1] > 60)
x0, x1, y0, y1 = int(.53 * W), int(.95 * W), int(.18 * H), int(.42 * H)
yy, xx = np.nonzero(blue[y0:y1, x0:x1]); bx0, bx1, by0, by1 = xx.min() + x0, xx.max() + x0, yy.min() + y0, yy.max() + y0
kx = (bx1 - bx0) / 11.40; ky = (by1 - by0) / 9.49; k = (kx + ky) / 2; cx, cy = (bx0 + bx1) / 2, (by0 + by1) / 2
lay = Image.new("RGBA", im.size, (0, 0, 0, 0)); d = ImageDraw.Draw(lay)
for p in pads:
d.rectangle([cx + k * (p["x"] - p["w"] / 2), cy + k * (p["y"] - p["h"] / 2), cx + k * (p["x"] + p["w"] / 2), cy + k * (p["y"] + p["h"] / 2)],
fill=(230, 40, 40, 90), outline=(230, 40, 40, 255), width=3)
d.rectangle([cx - k * 4.05, cy - k * 5.5, cx + k * 4.05, cy + k * 5.5], outline=(255, 170, 30, 255), width=4)
res = Image.alpha_composite(im.convert("RGBA"), lay).convert("RGB")
res.crop((int(.50 * W), int(.15 * H), int(.97 * W), int(.46 * H))).save(out)
rep = {"drawing": "TI DVG0010A example board layout, HV / isolation option (8.1 mm clearance/creepage), SBOSA24D p.46, 4226847/C",
"frame": "KiCad footprint, Y down, top view; pin 1 top-left as in TI's top view",
"pads": rows, "all_match": all(r["match"] for r in rows), "corner_radius_mm": 0.05,
"pad_to_pad_clearance_mm": round(inner, 3), "datasheet_min_creepage_clearance_mm": 8.0,
"keepout": {"layers": "*.Cu (KiCad rule area: no tracks, vias, pads or pours)", "rect_mm": [-4.05, -5.5, 4.05, 5.5]},
"ipc_option_not_used": "IPC-7351 nominal option (2.0 mm pads at 9.3 mm, 7.3 mm clearance) is below the part's 8 mm rating",
"overlay_calibration": {"px_per_mm": round(k, 3), "kx": round(kx, 3), "ky": round(ky, 3)},
"kicad_reference": "no KiCad library footprint exists for DVG0010A (KiCad's SOIC-10 3.9 x 4.9 mm, 1 mm pitch, is a different package)"}
json.dump(rep, open(outj, "w"), indent=1); print(json.dumps({k: rep[k] for k in ("all_match", "pad_to_pad_clearance_mm", "overlay_calibration")}))