main
John Lauer
Continue exact component library audit with MCU, headers, fuse and diode assets
1f97681
from pathlib import Path
import json,hashlib,shutil
root=Path(__file__).resolve().parents[2]
for n,ref,mate in [(2,'J10','M20-1060200'),(3,'J9','M20-1060300')]:
mpn=f'M20-9990{n}46';slug=mpn.lower();p=root/'components'/slug
source='https://www.harwin.com/products/'+mpn;ds='https://content.harwin.com/asset/640f59f4-1860-40fe-82ef-f2a104ffa7d8/DRG-00479-Technical-Drawing-Datasheet-M20-999-pdf.pdf'
parts={'symbol':slug+'.kicad_sym','footprint':slug+'.kicad_mod','step':slug+'.step','model_3d':slug+'-hero.glb','model_3d_plain':slug+'.glb','model_3d_step':slug+'.step','lbr':slug+'.lbr','adom_lbr':slug+'.adom-lbr.json','datasheet':'datasheet.pdf'}
d=dict(slug=slug,type='hardware',kind='component',version='0.1.0',title=f'Harwin {mpn} {n}-pin vertical header',description=f'{n}-position unpolarized 2.54 mm tin header, with original nominal geometry, symbol and candidate footprint.',brief=f'{n}-pin 2.54 mm THT header. Unpolarized, tin finish; nominal assets and 50-mating-cycle limit documented.',license='MIT',tags=['connector','header','Harwin','through-hole'],hero={'type':'image','path':'hero.png'},source={'name':'Harwin','url':source},component={'mpn':mpn,'manufacturer':'Harwin','package':f'{n}-pin single-row 2.54 mm vertical THT','pin_count':n,'category':'Connectors','datasheet':ds,'wiki_url':'https://wiki.adom.inc/adom/'+slug,'parts':parts,'distributor_links':{'mouser':'855-'+mpn},'pins':[dict(number=str(i),name=str(i),type='passive',description='Adom library numbering; unpolarized contact') for i in range(1,n+1)],'qualification':{'status':'provisional','model':'Original nominal reconstruction, not manufacturer CAD','assembly':'Finished-hole and mating/crimp qualification pending'}},because='Exact header selected for electronic-load fan or sensor harness; catalog assets were missing.')
(p/'page.json').write_text(json.dumps(d,indent=2)+'\n');d.update(name='@adom/'+slug,files=['README.md','LICENSE','THIRD_PARTY.md','page.json','package.json','provenance.json','footprint-input.json',slug+'*','symbol.html','footprint.html','hero.png','datasheet.pdf','build_model.py','skills/**'],dependencies={});(p/'package.json').write_text(json.dumps(d,indent=2)+'\n');shutil.copyfile(root/'components/lm339bidr/LICENSE',p/'LICENSE')
wiring='1 TEMP_SENSE, 2 GND' if n==2 else '1 5V_AUX, 2 GND, 3 FAN_TACH'
(p/'README.md').write_text(f'''# {mpn} vertical header
Harwin {n}-position single-row 2.54 mm header, 0.64 mm square pins, 3 mm PCB tails and 6.1 mm mating pin height. The 46 suffix is tin over nickel. It is unpolarized and has no intrinsic signal assignment or keyed mating direction.
The manufacturer specifies a 3 A maximum contact rating and −40 to +105 °C range. The drawing lists **50 mating operations for tin**, versus 300 for gold. This is not a high-cycle workcell connector; assess expected service cycles and retention before product release.
## Circuit and mating
The library numbers contacts 1 through {n} in a row from the footprint origin. This numbering is an Adom circuit convention for a geometrically symmetric header, not a claimed physical molded pin-1 identifier. In the custom electronic load, {ref} uses **{wiring}**. Inspect board silkscreen, harness continuity and connector orientation before connecting it.
The nominal harness study uses housing {mate} with {n} M20-1180046 crimp contacts. That is an Adom-added termination; the Sunon fan itself has flying leads. Mating, contact insertion, wire gauge, stripping, crimp tooling, retention and polarity remain separate qualification tasks. The housing is not included with this bare header.
## Library and geometry
The footprint follows 2.54 mm pitch and Harwin's recommended **1.02 ±0.05 mm finished hole**. Its 1.7 mm copper pads and courtyard are Adom candidate geometry. Confirm plated-hole tolerance, annular ring, copper clearance and solder process with the fabrication service. A nominal drill field does not certify the finished hole.
The original nominal model is {2.54*n:.2f} × 2.54 mm in plan, 8.64 mm above the PCB and 3 mm below. It uses plain rectangular housing and flat pin tips: molded recesses, chamfers and tolerance envelopes are not fully reproduced. This is not Harwin CAD. STEP units are mm, GLB meters, Z up, body seating at zero, pin 1 at X=Y=0. The hero adds nonphysical footprint labels; board-use geometry omits them.
[Manufacturer product page]({source}) · [Manufacturer drawing]({ds})
Harwin links TraceParts CAD downloads requiring a registered email and Supplyframe assets. Those were not redistributed; their reuse rights were not established. The shipped model is Adom's original nominal reconstruction. See provenance.json and THIRD_PARTY.md.
''')
(p/'THIRD_PARTY.md').write_text('Original Adom geometry, symbol, candidate footprint and documentation: MIT. Harwin drawing remains manufacturer copyright and is supplied as reference. No TraceParts/Supplyframe CAD is redistributed.\n')
(p/('skills/'+slug)).mkdir(parents=True,exist_ok=True)
(p/('skills/'+slug+'/SKILL.md')).write_text(f'''---
name: {slug}
description: Use when importing {mpn}, wiring its unpolarized contacts, or reviewing header geometry and mating life.
---
# {mpn}
Parent skill: wiki-component.
Read README.md and provenance.json. This is the {n}-position tin header, not its gold-finish variant. The drawing's tin mating-life limit is 50 operations. Check whether this suits the workcell service plan.
There is no physical key or intrinsic signal assignment. Preserve the project's numbering and verify harness continuity; never infer power or ground solely from a generic header model. Library pad1 is a convention marked on the PCB, not a manufacturer pin-index claim.
Use the clean STEP/GLB in assemblies. Hero outlines and labels are nonphysical. Nominal geometry omits detailed chamfers, recesses and tolerances. Verify the 1.02 +/-0.05 mm finished-hole requirement and solder process; candidate 1.7 mm pads are not a fabrication qualification.
Mating housing/contact selection, crimp tooling, wire preparation and retention must be reviewed separately. Do not pass project acceptance solely from library validation or a visual mate.
''')
prov={'part':mpn,'reviewDate':'2026-10-11','source':source,'drawing':{'url':ds,'revision':'M20-999XXXX issue23 17.12.18','sha256':hashlib.sha256((p/'datasheet.pdf').read_bytes()).hexdigest()},'model':{'kind':'Original Adom nominal reconstruction','generator':'build_model.py','kernel':'Existing shared OCP service environment','pinCount':n,'pitchMm':2.54,'pinSquareMm':.64,'pinSquareToleranceMm':.02,'aboveBoardMm':8.64,'tailMm':3,'bodyMm':[2.54,n*2.54,2.54],'omissions':['Manufacturer CAD not used','No pin-tip chamfers or molded underside recesses','No full tolerance envelope']},'footprint':{'recommendedFinishedHoleMm':1.02,'finishedHoleToleranceMm':.05,'padDiameterMm':1.7,'padSource':'Adom candidate','attrRepair':'Changed generated smd attribute to through_hole; all pads already thru_hole; known adom-footprint issue1'},'numbering':'Adom convention for unpolarized header, not physical manufacturer pin1','matingLife':{'tinOperations':50,'source':'Manufacturer drawing'},'qualification':'Provisional; physical solder/mating/crimp acceptance pending','visualReview':{'wiki':'pending; task browser closed by user'},'assetSha256':{}}
(p/'provenance.json').write_text(json.dumps(prov,indent=2)+'\n')