We provide a new method to derive heavy element abundances based on the unique suite of nebular lines in the mid- to far-infrared (IR) range. Using grids of photo-ionisation models that cover a wide range in O/H and N/O abundances, and ionisation parameter, our code HII-CHI-MISTRY-IR (HCm-IR) provides model-based abundances based on extinction free and temperature insensitive tracers, two significant advantages over optical diagnostics. The code is probed using a sample of 56 galaxies observed with Spitzer and Herschel covering a wide range in metallicity, 7.2~<12+log(O/H)~7.6. This accuracy can be achieved using the lines [SIV]10.5um, [SIII]18.7,33.5um, [NeIII]15.6um and [NeII]12.8um. Additionally, HCm-IR provides an independent N/O measurement when the [OIII]52,88um and [NIII]57um transitions are measured, and therefore the derived abundances in this case do not rely on particular assumptions in the N/O ratio. Large uncertainties (~0.4dex) may affect the abundance determinations of galaxies at sub- or over-solar metallicities when a solar-like N/O ratio is adopted. Finally, the code has been applied to 8 galaxies located at 1.8