The selective absorbance detection of mercury(ii) (Hg2+) and lead(ii) (Pb2+) ions using ferrocene-based colorimetric ligands and miniaturized multiple internal reflection (MIR) systems implemented in a low-cost photonic lab on a chip (PhLoC) is reported. The detection principle is based on the formation of selective stable complexes between the heavy metal ion and the corresponding ligand. This interaction modulates the ligand spectrum by giving rise to new absorbance bands or wavelength shifting of the existing ones. A comparative study for the detection of Hg2+ was carried out with two MIR-based PhLoC systems showing optical path lengths (OPLs) of 0.64 cm and 1.42 cm as well as a standard cuvette (1.00 cm OPL). Acetonitrile solutions containing the corresponding ligand and increasing concentrations of the heavy metal ion were pumped inside the systems and the absorbance in the visible region of the spectra was recorded. The optical behaviour of all the tested systems followed the expected Beer-Lambert law. Thus, the best results were achieved with the one with the longest OPL, which showed a linear behaviour in a concentration range of 1 μM-90 μM Hg2+, a sensitivity of 5.6 × 10-3 A.U. μM-1 and a LOD of 2.59 μM (0.49 ppm), this being 1.7 times lower than that recorded with a standard cuvette, and using a sample/reagent volume around 190 times smaller. This microsystem was also applied for the detection of Pb2+ and a linear behaviour in a concentration range of 3-100 μM was obtained, and a sensitivity of 9.59 × 10-4 A.U. μM-1 and a LOD of 4.19 μM (0.868 ppm) were achieved. Such a simple analytical tool could be implemented in portable instruments for automatic in-field measurements and, considering the minute sample and reagent volume required, would enable the deployment of high throughput environmental analysis of these pollutants and other related hazardous species. © 2013 The Royal Society of Chemistry.