  We present a detailed analysis of the usefulness of ultracold atomic
collisions for sensing the strength of an external magnetic field as well as
its spatial gradient. The core idea of the sensor, which we recently proposed
in K. Jachymski \emph{et al.}, Phys. Rev. Lett. {\bf 120}, 013401 (2018), is to
probe the transmission of the atoms through a set of quasi-one-dimensional
waveguides that contain an impurity. Magnetic field-dependent interactions
between the incoming atoms and the impurity naturally lead to narrow resonances
that can act as sensitive field probes since they strongly affect the
transmission. We illustrate our findings with concrete examples of experimental
relevance, demonstrating that a sensitivity of the order of 1 nT for the field
strength and $100\,\mathrm{nT}/\mathrm{mm}$ for the gradient can be reached
using our scheme.
