The talk is concerned with optimal control problems for parabolic differential equations subject to switching penalties. Based on sparse control we formulate convex and nonconvex penalty functions that promote switching between different control components. After suitable regularizations both problems can be solved using semismooth Newton-Krylov methods with adjoint-based exact first and second derivatives. The convex and nonconvex formulations are compared in numerical experiments.