To overcome the problems of coverage blind areas and coverage redundancy when sensor nodes are deployed randomly in heterogeneous wireless sensor networks (HWSNs). An optimal coverage method for HWSNs based on an improved social spider optimization (SSO) algorithm is proposed, which can reduce the energy consumption and improve the network coverage. First, a mathematical model of HWSN coverage is established, which is a complex combinatorial optimization problem. To improve the global convergence speed of the proposed algorithm, a chaotic initialization method is used to generate the initial population. In addition, the SSO algorithm has a poor convergence speed and search ability, which is enhanced by improving the neighborhood search, global search, and matching radius. In the iterative optimization process, the optimal solution is ultimately obtained by simulating the movement law of the spider colony, i.e., according to the cooperation, mutual attraction, and mating process of female and male spiders. An improved SSO algorithm based on chaos, namely the CSSO algorithm, is proposed to apply to the optimal deployment of sensory nodes in HWSNs. On this basis, the optimization goals are to improve the network coverage and reduce network costs. The optimal deployment plan of nodes is searched via the proposed CSSO algorithm, which effectively prevents coverage blind spots and coverage redundancy in the network.