A microfluidic ion detector for detecting heavy metal ions in liquid and particulate matter from gas samples is described. The microfluidic ion detector includes a sample extraction structure for extracting sample ions from a sample liquid or extracting sample ions from the particulate matter of a gas sample, a separation structure for separating sample ions of different types once extracted, and a detection structure for detecting the sample ions. The microfluidic ion detector also includes a reference reservoir providing a reference ion against which the sample may be calibrated based on the operation of the separation structure. A portable, self-calibrating ion detector may be realized by including the described components on a single substrate.