Microbial fuel cells (MFCs) have been receiving more and more attention in simultaneous treatment of wastewater and energy recovery. Past research has been mainly in experiments. Modelling and controlling are new subjects emerging recently. A novel dynamic model of MFC based on biochemical reactions, Butler–Volmer expressions and mass/charge balances is proposed with Matlab/Simulink, and then the fuzzy PID controller is designed for the microbial fuel cell to realize constant voltage output. Simulation results show that the proposed controller can give better control effects compared to PID controller.