Today, there is significant attention being paid to wireless sensor networks equipped with energy harvesting modules (energy harvesting wireless sensor networks). They have been experimentally applied to some practical scenarios, such as structural health monitoring. However, the constraints (e.g. energy-neutral operation, node placement, and routing protocols) of energy harvesting wireless sensor networks still need further consideration before their actual deployment on structures. In this article, we consider a novel energy harvesting wireless sensor networks system for structural health monitoring in which a common energy harvesting module (including its storage battery) provides shared access to all energy harvesting nodes. The individual nodes do not own the independent energy harvesting modules and can only withdraw energy from the shared battery, which has an optionally changing energy level. Our aim is to find optimal solutions for three problems: (1) the minimum number of nodes needed for deployment, (2) the most efficient path from each node to the sink, and (3) the maximum network utility under energy harvesting constraints. Therefore, a joint optimization algorithm including sensor placement, routing, and energy allocation is introduced and solved; a sensor location optimization scheme is proposed according to the Fisher information matrix; and the condition of the communication channels and the nodes' energy harvesting status are considered. We then propose an algorithm to jointly minimize the number of nodes and maximize the data sampling quality under energy-neutral working settings. Simulation results show that the proposed algorithm always attains high-efficiency network energy distribution and achieves higher network utility than existing approaches.