In this study, electromagnetic solenoid has been designed for valve mechanism on a compressed air engine. Mechanical valve mechanism has been removed and a special designed electromagnetic solenoid has been placed. The solenoid that provides the transfer of compressed air to engine has been controlled by driving circuit related to the speed of the engine. Electrical and magnetic parameters of the solenoid designed with analytical and finite element method using Ansoft Maxwell 2D software, have been calculated and the simulation results have been compared with prototype. In addition, to overmatch of desirable force, it has been provided that solenoid reacted to defined time. Theoretical approach has been considered and the simulations have been repeated to provide optimum design of the solenoid. According to the simulation results, the wire diameter and the armature mass have a measurable effect on response time. Analytical methods and simulation results are compatible with prototype results.