Use an arduino instead of a pi. Just need to set up control for relay and the servo motor as well as serial and we should be in good shape