H bridge based on relays