In view of the time synchronization problem of wireless sensor network (WSN), the paper presented a self-calibration time synchronization (SCTS) algorithm of WSN based on piecewise fitting, which used a synchronous communication and self-calibration combined mechanism. An improved delay measurement time synchronization (DMTS) algorithm was used to realize the synchronization process of nodes by communication opportunities of sleeping-awaking, and if the node missed the synchronization communication opportunity, it would use piecewise fitting method to realize self-calibration of node time. Experimental research shows that the average synchronization error of the SCTS algorithm is 27.33 μs and it can reduce the frequency of time synchronization between nodes, energy and communication overheads of sensor nodes effectively.