Computer-based physics experiments are carried out by utilizing sensors and interfaces into a software in a computer. One of the advantages of doing computer-based experiments is that data processing that is usually done manually can be carried out with the help of computer programs, so that time needed to process data becomes more efficient. A motion sensor is used to measure a spring constant and the result obtained from the experiment, is a spring constant value of k = 9,20 ± 0,26 N/m. The result obtained agree with the spring’s specification which has a value of k = 10 N/m. The results obtained in the experiment are closer to the true value when compared to conventional experimental results. This is because factors that influence irregularities can be minimized, especially in measuring the length of the spring when doing it manually.