A fewest switches trajectory surface hopping algorithm based on linear response time-dependent density-functional theory is developed and implemented into the plane wave ab initio molecular dynamics package CPMD. A scheme to calculate nonadiabatic couplings using a multi determinantal approximation of the excited state wave function is introduced. The method is applied to the study of the photorelaxation of protonated formaldimine, a minimal model of the rhodopsin chromophore retinal. A good agreement of the structural and dynamic behavior is found with respect to state averaged multiconfiguration self consistent field based trajectory surface hopping.