Ok, I'll admit, I'd just buy the sprinkler head. Let someone else do the work of engineering it so that it would work consistently on demand, because this has to work thousands of times, day after day. It must survive variable water pressure, be robust to working in a dirty environment, hard water, heat and cold. Any water system sometimes even has grains of sand, etc., that find their way into the lines. So you must cater to that possibility.
You need a filter. Materials that will be dimensionally stable under temperature variations, without corrosion. A robust design that will not leak, yet survive enough water pressure to spray the water where you need it.
If your goal is to do better than what you would find on the shelf, and this is truly for your own DIY use, then buy it off the shelf, and dissect that unit. Look carefully at it, and decide what makes it work or not work to your satisfaction. I'll admit that I don't think you can make it better for less money than the unit cost you off the shelf. The fact is, you have not said what it was that makes you think the off-the-shelf unit is unsatisfactory to YOU.
If your goal is to try to make something like this better for sale to others, then you are asking in the wrong place anyway. In that case, this question should then be shut down.
I was able to track down the relevant code document for residential sprinker installations - it's 2010 NFPA 13D, section 8.2.5.2, and it's actually viewable online for free if you register your email address. There is a different code for commercial buildings. For this issue at least, the residential requirements are much more strict.
The residential code says pendant sprinklers must be at least 3 ft from obstructions such as ceiling fans and lights (as measured from their centers), or you can use this table which relates A) the distance from the sprinkler to the near edge of the obstruction and B) height of the sprinkler's deflector above the bottom of the obstruction.
ceiling----------------------------------------------
| * *
sprinkler -+- --- * obstruction *
B * *
--- *****************
|<---- A ---->|
--------------- --------------
Distance A (ft) Maximum B (in)
--------------- --------------
up to 1.5 0
1.5 - 3 1
3 - 4 3
4 - 4.5 5
4.5 - 6 7
Best Answer
Air conditioning units can get water on them - save any internal electronics which almost always have guard/protection/enclosure. I can't foresee any local code that would care.