A solenoid valve is an electro-mechanical device in which the solenoid uses an electric current to generate a magnetic field…