Intermittent energy harvesting improves the performance of microbial fuel cells.