  We present a spectroscopic and photometric calibration to derive effective
temperatures $T_{\mathrm{eff}}$ and metallicities [Fe/H] for M dwarfs, based on
a Principal Component Analysis of 147 spectral indices measured off moderate
resolution $R \sim 11\,000$), high S/N ($>100$) spectra in the $\lambda
\lambda$ 8390-8834 region, plus the J$-$H color. Internal uncertainties,
estimated by the residuals, are 81 K and 0.12 dex, respectively, for
$T_{\mathrm{eff}}$ and [Fe/H], the calibrations being valid for 3050 K $<
T_{\mathrm{eff}} <$ 4100 K and $-$0.45 $<$ [Fe/H] $<$ $+$0.50 dex. The PCA
calibration is a competitive model-independent method to derive
$T_{\mathrm{eff}}$ and [Fe/H] for large samples of M dwarfs, well suited to the
available database of far-red spectra. The median uncertainties are 105 K and
0.23 dex for $T_{\mathrm{eff}}$ and [Fe/H], respectively, estimated by Monte
Carlo simulations. We compare our values to other works based on photometric
and spectroscopic techniques and find median differences 75 $\pm$ 273 K and
0.02 $\pm$ 0.31 dex for $T_{\mathrm{eff}}$ and [Fe/H], respectively, achieving
good accuracy but relatively low precision. We find considerable disagreement
in the literature between atmospheric parameters for stars in common. We use
the new calibration to derive $T_{\mathrm{eff}}$ and [Fe/H] for 178 K7-M5
dwarfs, many previously unstudied. Our metallicity distribution function for
nearby M dwarfs peaks at [Fe/H]$\sim$-0.10 dex, in good agreement with the RAVE
distribution for GK dwarfs. We present radial velocities (internal precision
1.4 km/s) for 99 objects without previous measurements. The kinematics of the
sample shows it to be fully dominated by thin/thick disk stars, excepting the
well-known high-velocity Kapteyn's star.
