There is a problem of dimensional deviation in springs manufactured by spring forming machines.To solve the geometric error of the spring original length,the study designs a simple detection and compensation mechanism,makes it pass through the standard length detection groove row one by one according to the metal characteristic of the spring,detects the geometric length with conduction principle,and realizes the automatic control by PLC.Measurement results show that the device has the characteristics of simple detection principle,stable structure,stable operation and high efficiency,which improves product quality and labor efficiency.