There are water sprinkler standards, made for one- and two-family dwellings and manufactured homes, specifically addressing home issues like how to install the systems, where sprinklers need to be located for the system to meet codes, and other issues. Pipes can be made from PVC-based plastics, which lowers costs considerably, and systems are sized to have two sprinklers active at the same time. The standards do not bar you from installing sprinklers in your attic.
Attic sprinkler systems are rare, because the cost of installing sprinklers in attic areas can be high, and only primary rooms, such as bedrooms, kitchens and living rooms, are required to have sprinklers. If you have a garage or attic, you do not need to install sprinklers there (although you can). You also do not need to install sprinklers in crawl spaces, bathrooms or small closets.
The main issue with installing sprinklers in an attic is the cold. Attics are vented directly to the outdoors and are typically colder than the rest of the house. In winter months, temperatures in the attic may drop below freezing, which spells trouble for your sprinkler system. You will need to install pipes in the attic walls where they are fully insulated to keep the water from freezing and cracking them apart.
If your attic is finished and you are using it as a room in your house, sprinklers can be installed in a more traditional way, with the ceiling sprinklers that you use for the rest of your house. Insulation and seals will keep freezing from becoming a problem.