I’m using the AH1815 hall-effect sensor. The footprint in the standard KiCad 5 library that seems to correspond to this package is Package_TO_SOT_THT:TO-92Flat.
The datasheet shows pin 1 as being the leftmost pin, when looking at the angled side of the package. However, Package_TO_SOT_THT:TO-92Flat has pin 1 as the rightmost pin, when looking at the angled side of the package.
Is this an error, or does every manufacturer number their TO-92Flat packages differently?
The outline is wrong as well. And the footprint has a load of KLC violations. I would guess that one was in the lib for quite some time in this state. I wonder how many people already noticed it to be wrong without reporting it.
Ummmm . . . . . look carefully at the package drawings. (AH1815 Datasheet pg 10, and DRV5023 Datasheet pg 20). After a quick scan by my superannuated eyeballs, I think the two parts have identical pin numbering, and it’s consistent with the footprint diagram in @ppelleti’s post. (I won’t make any statements about KLC compliance.)
I think they have the pin numbering exactly the other way round than in the current footprint. Look at the drawing on page 1 of your 3 datasheets. It shows the package with the shorter side towards the viewer. Viewed from the same side pin 1 is the leftmost pin (when you rotate it such that the leads point toward down like they would in a pcb.)
Also repeated on page 10 of at least AH1815
The ti datasheet is even clearer as it has a 3d view with numbered pins. (page 1)
The TI datasheet is the one linked to the footprint meaning the only one that really counts. We can only guarantee that the footprint fits the datasheet it is connected to. (We try to look at many datasheets for such cases but the only guaranteed one is the one linked.)
Right now the footprint is mirrored compared to this
My error - I agree with you. The KiCAD footprint is viewed looking down on the board from above; the package drawing in TI’s DRV5023 is looking up at the part from the board surface. (I looked too quickly.)
I probably should have known better. I think I used a pair of similar Hall sensors when I designed the electronics for a measuring wheel about a decade ago (though it may have been an SMT version).