A disposable but eco-friendly electrochemical sensor made from sewage sludge detects trimethoprim in water and urine.