Effective detection of contaminants in water is the basis of safe water provision to communities. Traditional analytical methods are, however, expensive, time-consuming and cannot be easily adapted to emerging pollutants (i.e. herbicides, pharmaceuticals and their metabolites). Microalgae have been shown to be an ideal sensing probe for bioactive compounds, with great sensitivity and limit of detections at very low concentration levels (nM range). In this study, we explore the use of microalgae in microbial fuel cells (MFCs) as a means to generate a sensitive, portable and cost-effective bioelectrochemical sensor for onsite monitoring of pollutants in water. In particular, we report an innovative miniature single chamber photosynthetic MFC (photoMFC) and demonstrate its ability to detect formaldehyde, a highly toxic compound that can arise in drinking water from the oxidation of natural organic matter during ozonation and chlorination. The photoMFC, inoculated with a mixed microalgae culture from a wastewater treatment algal pond, generated a peak power and current density of 0.18 mW m−2 and 7.2 mA m−2 respectively, when exposed to light. A current response to formaldehyde proportional to its concentration was produced in less than 1 h, with a sensitivity of 69.2 ± 16.7%−1 cm−2. As such, this work provides the first miniature photosynthetic MFC device water shock sensor, with the great benefit of simple operation (with light being the sole energy source) and rapid onsite biosensing capability.