Fluorination vs. Chlorination: Effect on the Sensor Response of Tetrasubstituted Zinc Phthalocyanine Films to Ammonia

In this work, the effect of fluorine and chlorine substituents in tetrasubstituted zinc phthalocyanines, introduced into the non-peripheral (ZnPcR4-np, R = F, Cl) and peripheral (ZnPcR4p, R = F, Cl) positions of macrocycle, on their structure and chemiresistive sensor response to low concentration of ammonia is studied. The structure and morphology of the zinc phthalocyanines films (ZnPcR4) were investigated by X-ray diffraction and atomic force microscopy methods. To understand different effects of chlorine and fluorine substituents, the strength and nature of the bonding of ammonia and ZnPcHal4 molecules were studied by quantum chemical simulation. It was shown on the basis of comparative analysis that the sensor response to ammonia was found to increase in the order ZnPcCl4-np < ZnPcF4-np < ZnPcF4-p < ZnPcCl4-p, which is in good agreement with the values of bonding energy between hydrogen atoms of NH3 and halogen substituents in the phthalocyanine rings. ZnPcCl4-p films demonstrate the maximal sensor response to ammonia with the calculated detection limit of 0.01 ppm; however, they are more sensitive to humidity than ZnPcF4-p films. It was shown that both ZnPcF4-p and ZnPcCl4-p and can be used for the selective detection of NH3 in the presence of carbon dioxide, dichloromethane, acetone, toluene, and ethanol.


Introduction
Ammonia is a highly irritating gas with a pungent smell. The problem of detecting ammonia is important in various sectors of agriculture and industry related to the production and use of fertilizers, as well as refrigeration systems [1]. In the last ten years, the diagnosis of various diseases by determining the concentration of biomarker gases in the exhaled air has attracted the attention of researchers and medical doctors [2][3][4]. It is known that ammonia is one of the biomarkers and its concentration > 1 ppm indicates renal failure in nephritis, atherosclerosis of the renal arteries, toxic affections of kidneys and other diseases [5]. There are a variety of sensing techniques existing for NH 3 detection, among them optical [6][7][8], electrochemical [9], surface acoustic [10,11], field effect transistor [12][13][14], and chemiresistive [15] sensors. Among them, chemiresistive gas sensors have attracted considerable attention in the field of sensor technology due to their advantages such as simplicity, low cost, and miniaturization capability [4,16]. Metal oxides, carbon nanomaterials, conductive polymer, and their hybrid materials are used as active layers of chemiresistive sensors for ammonia detection [17]. Metal phthalocyanines (MPc) also attract noticeable interest for sensing applications [18][19][20] due to their high sensitivity to different analytes, exceptional stability, versatile chemical system, and excellent processability resulting in the manufacture of thin films. Their properties can be tuned by introducing desirable substituents into their aromatic rings. It was shown in previous works that introduction of electron withdrawing substituents (e.g., fluorine) led to an increase of MPc sensor response to reducing gases like ammonia and hydrogen [21,22]. Films of hexadecafluorosubstituted (MPcF 16 ) and tetrafluorosubstituted (MPcF 4 -p) metal phthalocyanines with F-substituents in peripheral positions, deposited by vacuum evaporation, were studied as active layers of chemiresistive sensors for ammonia detection [22,23]. It was shown in our previous work [23] that the sensitivity of phthalocyanine films to ammonia increased in the order MPc < MPcF 16 < MPcF 4 -p (M = Cu, Zn, Co). MPcF 4 -p films were shown to be used as active layers for sensors to ammonia with the detection limit reaching 0.1 ppm. Apart from this, they allow ammonia to be detected in the presence of carbon dioxide, some volatile organic compounds and at high humidity. These properties make fluorosubstituted metal phthalocyanines very promising for the detection of low concentration of ammonia in the gas mixtures.
In the case of tetrafluorosubstituted phthalocyanines, the F-substituents can be introduced not only to peripheral positions ( Figure 1), but also to non-peripheral ones. The literature analysis has shown that studies of MPcF 4 -np thin films were only sporadic [24,25], and their sensor properties have not yet been studied. Chlorination is also a common method used to modify the behavior of the π-conjugated molecular semiconductors [26]. Although Cl (electronegativity is 3.16) is less electronegative than F (electronegativity is 3.98), its empty 3d orbit can help to accept π electrons in the system, resulting in the stronger ability of chlorination to decrease than fluorination to downshift the molecular energy levels in comparison with fluorination. Chlorosubstituted metal phthalocyanines ones are also widely investigated. Similarly to MPcFx, films of chlorosubstituted MPcCl x can also be deposited by thermal evaporation [27][28][29][30][31]. Parameters of crystal cell of CuPcCl x (x = 4, 8,16) have been determined by Fryer and co-authors [32] using the method of electron diffraction, while later the single crystal structure of CuPcF 4 -np have been refined [33]. CuPcCl x was shown to demonstrate semiconductor properties with the lower HOMO and LUMO energy levels compared to unsubstituted CuPc [34,35]. The charge carrier mobility of CuPcCl 16 films was shown to be about 10 −2 cm 2 V −1 s −1 [36]. Achar et al. [37] found that the conductivity of CuPcCl 4 pellets was four orders of magnitude higher than that in the case of unsubstituted CuPc. At the same time, the chemiresistive properties of chlorosubstituted metal phthalocyanines have not yet been investigated.
Chemosensors 2021, 9, x FOR PEER REVIEW 2 of 20 different analytes, exceptional stability, versatile chemical system, and excellent processability resulting in the manufacture of thin films. Their properties can be tuned by introducing desirable substituents into their aromatic rings. It was shown in previous works that introduction of electron withdrawing substituents (e.g., fluorine) led to an increase of MPc sensor response to reducing gases like ammonia and hydrogen [21,22]. Films of hexadecafluorosubstituted (MPcF16) and tetrafluorosubstituted (MPcF4-p) metal phthalocyanines with F-substituents in peripheral positions, deposited by vacuum evaporation, were studied as active layers of chemiresistive sensors for ammonia detection [22,23]. It was shown in our previous work [23] that the sensitivity of phthalocyanine films to ammonia increased in the order MPc < MPcF16 < MPcF4-p (M = Cu, Zn, Co). MPcF4-p films were shown to be used as active layers for sensors to ammonia with the detection limit reaching 0.1 ppm. Apart from this, they allow ammonia to be detected in the presence of carbon dioxide, some volatile organic compounds and at high humidity. These properties make fluorosubstituted metal phthalocyanines very promising for the detection of low concentration of ammonia in the gas mixtures.
In the case of tetrafluorosubstituted phthalocyanines, the F-substituents can be introduced not only to peripheral positions ( Figure 1), but also to non-peripheral ones. The literature analysis has shown that studies of MPcF4-np thin films were only sporadic [24,25], and their sensor properties have not yet been studied. Chlorination is also a common method used to modify the behavior of the π-conjugated molecular semiconductors [26]. Although Cl (electronegativity is 3.16) is less electronegative than F (electronegativity is 3.98), its empty 3d orbit can help to accept π electrons in the system, resulting in the stronger ability of chlorination to decrease than fluorination to downshift the molecular energy levels in comparison with fluorination. Chlorosubstituted metal phthalocyanines ones are also widely investigated. Similarly to MPcFx, films of chlorosubstituted MPcClx can also be deposited by thermal evaporation [27][28][29][30][31]. Parameters of crystal cell of CuP-cClx (x = 4, 8, 16) have been determined by Fryer and co-authors [32] using the method of electron diffraction, while later the single crystal structure of CuPcF4-np have been refined [33]. CuPcClx was shown to demonstrate semiconductor properties with the lower HOMO and LUMO energy levels compared to unsubstituted CuPc [34,35]. The charge carrier mobility of CuPcCl16 films was shown to be about 10 −2 cm 2 V −1 s −1 [36]. Achar et al. [37] found that the conductivity of CuPcCl4 pellets was four orders of magnitude higher than that in the case of unsubstituted CuPc. At the same time, the chemiresistive properties of chlorosubstituted metal phthalocyanines have not yet been investigated. These latest results raise the question of how to choose between fluorinated and chlorinated phthalocyanines when designing materials for chemiresistive sensors with good sensor characteristics. These latest results raise the question of how to choose between fluorinated and chlorinated phthalocyanines when designing materials for chemiresistive sensors with good sensor characteristics.
In this work, the effect of the position of fluorine and chlorine substituents in tetrasubstituted zinc phthalocyanines ZnPcR 4 -np and ZnPcF 4 -p (R = F, Cl) ( Figure 1) on their structure and chemiresistive sensor response to low concentration of ammonia is studied. The structure and morphology of the films of tetrafluoro-and tetrachlorosubstituted zinc phthalocyanines, deposited by thermal evaporation vacuum, were investigated by X-ray diffraction (XRD) and atomic force microscopy (AFM) methods. On the basis of comparative analysis, the films with the best sensor characteristics (sensitivity, selectivity, detection limits, response and recovery times) were chosen.
Atomic force microscopy (AFM) in semi-contact mode with a Ntegra Prima II (NT-MDT, Russia) microscope was used for the characterization of films morphology. The HA_NC (A) tip had the following parameters: length-123 µm, width-34 µm, thickness-3 µm, force constant-17 N/m, resonance frequency-230 kHz. The roughness parameters were calculated using the Nova SPM software according to the standards ISO 4287-1, ISO 4287 and ASME B46.
For testing the chemiresistive sensor response the films were deposited onto the platinum interdigitated electrodes (Dropsens, Spain). The electrodes had the following dimensions: gap between digits-10 µm; number of digits-125 × 2 with a digit length of 6760 µm; cell constant-0.0118 cm −1 . The interdigitated electrodes with a deposited phthalocyanine film were placed in a homemade gas flow cell and kept for 15 min under the air flow until their resistance reached a steady value. The scheme of the system for investigation of the chemiresistive sensor response with a photo of the gas flow cell is shown in Figure 2. The required gas flow was regulated using mass flow regulators. The electrical resistance of ZnPc films, which changed when interacting with the analyte gas, was measured using a Keithley 236 electrometer by applying a constant DC voltage (10 V). Then, the analyte gas of the required concentration and the air used for purging were alternately introduced into the cell. The sensor response of the films was determined after alternation of exposure and recovery periods in a dynamic regime in most experiments. The injection of NH3 was carried out at the constant air flow rate of 300 mL/min and the exposure time was fixed at 30 s. The determination of the response and recovery times of the sensing layer was performed in a static regime. In this case, the air stream flowed through the test chamber until the resistance reached a state value, and then the valves of the chamber were closed and diluted NH3 gas was injected into the cell. The resistance was recorded during a period of time necessary to obtain saturation value and calculate the response time of the sensor. Afterwards, the chamber was opened and was purged with air flow. For humidity measurements, the wet carrier gas was prepared by bubbling the carrier gas through distilled water. The relative humidity (RH) inside the cell was controlled with a commercially available humidity meter (МPЕ-202.013).

Theoretical Calculations
The nature of bonding between zinc phthalocyanines and ammonia was studied by performing a topological analysis of the electron density distribution function in these molecules in the framework of the Quantum Theory "Atoms in Molecules" (QTAIM) [43,44]. These functions were obtained as a result of quantum-chemical calculations carried out in the ORCA software package [45,46], using the DFT B3LYP/def2-SVP method [47][48][49][50][51], semiempirical dispersion potential Grimme [52,53], RI approximation [54][55][56][57][58][59], and auxiliary basis set Def2/J [60]. In the search of the equilibrium geometric structure of the molecules, no symmetry restrictions were used (the point group of symmetry C1). The spin multiplet was equal to one, which corresponded to energetically more favorable electronic states.
The absence of negative frequencies in the vibrational spectra of the molecules in addition to their minimum total energies was the criterion for achieving an equilibrium geometric structure. The binding energy (Eb) of ZnPcHal4 with the NH3 molecule was calculated from the difference in the total energies of the corresponding structure and its components: where ΔEBSSE is the correction to the binding energy, taking into account the basis set superposition error (BSSE), which was estimated as follows: Then, the analyte gas of the required concentration and the air used for purging were alternately introduced into the cell. The sensor response of the films was determined after alternation of exposure and recovery periods in a dynamic regime in most experiments. The injection of NH 3 was carried out at the constant air flow rate of 300 mL/min and the exposure time was fixed at 30 s. The determination of the response and recovery times of the sensing layer was performed in a static regime. In this case, the air stream flowed through the test chamber until the resistance reached a state value, and then the valves of the chamber were closed and diluted NH 3 gas was injected into the cell. The resistance was recorded during a period of time necessary to obtain saturation value and calculate the response time of the sensor. Afterwards, the chamber was opened and was purged with air flow. For humidity measurements, the wet carrier gas was prepared by bubbling the carrier gas through distilled water. The relative humidity (RH) inside the cell was controlled with a commercially available humidity meter (MPE-202.013).

Theoretical Calculations
The nature of bonding between zinc phthalocyanines and ammonia was studied by performing a topological analysis of the electron density distribution function in these molecules in the framework of the Quantum Theory "Atoms in Molecules" (QTAIM) [43,44]. These functions were obtained as a result of quantum-chemical calculations carried out in the ORCA software package [45,46], using the DFT B3LYP/def2-SVP method [47][48][49][50][51], semiempirical dispersion potential Grimme [52,53], RI approximation [54][55][56][57][58][59], and auxiliary basis set Def2/J [60]. In the search of the equilibrium geometric structure of the molecules, no symmetry restrictions were used (the point group of symmetry C 1 ). The spin multiplet was equal to one, which corresponded to energetically more favorable electronic states.
The absence of negative frequencies in the vibrational spectra of the molecules in addition to their minimum total energies was the criterion for achieving an equilibrium geometric structure. The binding energy (E b ) of ZnPcHal 4 with the NH 3 molecule was calculated from the difference in the total energies of the corresponding structure and its components: where ∆E BSSE is the correction to the binding energy, taking into account the basis set superposition error (BSSE), which was estimated as follows: Chemosensors 2021, 9, 137

of 19
The upper index in Equation (2) indicates that the geometries of ZnPcHal 4 and NH 3 were taken from the optimized ZnPcHal 4 ···NH 3 structure, while the geometric structures of ZnPcHal and NH 3 were not optimized, but only their electronic structures were calculated. The asterisks in the lower indices mean which fragment of the ZnPcHal 4 ···NH 3 aggregate is considered, whereas the atoms of the other fragment are considered as the points described by the corresponding atomic basis sets.
Additionally, the binding energies were calculated for comparison by another more accurate method, where the structure geometries and zero-point energies were taken from the DFT results, while electronic energies were estimated in the framework of the DLPNO-CCSD(T)/def2-TZVPP approach [50,[60][61][62][63] without taking into account the BSSE correction. This approach represents the domain-based local pair natural orbital (DLPNO) approximation implemented to speed up the coupled-cluster method with single and double excitations and perturbative triple excitations (CCSD(T)), employs localized occupied orbitals, and allows us to get the correlation energy as the sum of the correlation energies of the electron pairs [62][63][64].
In the QTAIM approach, an indicator of the binding interaction of two atoms is the presence of the bond critical point (3, −1) (BCP) between them. Herein ω = 3 is a Hessian matrix rank at this point, and σ = −1 is a sum of signs of Hessian matrix eigenvalues λ i (λ 1 < 0, λ 2 < 0 иλ 3 > 0). The set of values of these parameters, including the Laplacian of the electron density ∇ 2 ρ(r) = λ 1 + λ 2 + λ 3 , can be used to estimate the nature of the atoms' interaction under consideration. In particular, if |λ 1 |/λ 3 > 1 (∇ 2 ρ(r) < 1), the so-called shared interaction occurs. The electron density is accumulated and distributed in the interatomic space, which is typical for covalent bonds. In the case where |λ 1 |/λ 3 < 1 (∇ 2 ρ(r) > 1), the closed-shell interaction is observed, which is characteristic of ionic, strongly polar covalent, hydrogen and van der Waals bonds [43,44,65,66]. In this case, there is an outflow of electron density from the critical point to the atomic nuclei. There is also an intermediate interaction, in which the value of ∇ 2 ρ(r) is also positive, but the chemical bond is considered covalent if the value of ρ(r) is large. In this case, one resorts to the analysis of additional quantities, such as, for example, the electron energy density h(r). A negative value of this value at the corresponding critical point of the bond is considered a sufficient condition for the bond to be considered covalent [44].

Crystal Structure of ZnPcCl 4 -p and ZnPcCl 4 -np
Crystal structure of ZnPcF 4 -p has been investigated by our group earlier [67]. ZnPcF 4p crystallizes in P-1 space group with Z = 1 and is isomorphous to α-polymorphs of unsubstituted phthalocyanines, such as α-CuPc [68] and α-CoPc [69]. ZnPcF 4 -p molecules are arranged in stacks ( Figure 3a) with a distance of 3.331 Å between the molecules inside the stack (the distance between the planes drawn through all non-hydrogen atoms) and a stacking angle of 25.31 • (the angle between the stacking direction and the normal to the plane). The structure of ZnPcF 4 -np crystals grown by vacuum sublimation in this work was identical to that described by Hui Jiang et al. [70]. ZnPcF 4 -np crystallizes in the P2 1 /n space group with Z = 2 and is isomorphous to the β-polymorph of ZnPc [71]. ZnPcF 4 -np molecules are arranged in a herringbone pattern ( Figure 3b) with a distance of 3.258 Å between the molecules within the stack, a stacking angle of 47.29 • and an angle between molecules in adjacent stacks of 85.42 • . ZnPcCl 4 -p crystallizes in the I4 1 /a space group with Z = 8 (Z' = 0.5). ZnPcCl 4 -p molecules are also packed in stacks with a distance of 3.392 Å between the molecules within the stack and a stacking angle 20.81 • , while the angle between the molecules in adjacent stacks is 29.12 • and the adjacent stacks are rotated 90 • relative to each other ( Figure 3c). Chemosensors 2021, 9, x FOR PEER REVIEW 6 of 20 ZnPcCl4-np crystallizes in the P21/n space group. A distance between the molecules in the stack is 3.309 Å , a stacking angle is 46.51° and an angle between molecules in adjacent stacks is 86.97° (Figure 3d). At first glance, ZnPcCl4-np is isomorphic to both ZnPcF4np and β-ZnPc, but the substituents of the chlorine atoms are too bulky compared to fluorine and hydrogen, which leads to very close contacts between the molecules in adjacent stacks. As a result, one ZnPcCl4-np molecule is rotated relative to the other in the plane around the central Zn atom by about 13° (Figure 3e). This leads to the fact that all the atoms, except for Zn and Cl, are disordered in two positions with a ratio of 0. 56 It should also be noted that the molecules of all four investigated ZnPcHal4 derivatives remain relatively flat; the maximum deviation of any non-hydrogen atom from the root-mean-square plane is 0.168 Å for ZnPcF4-p, 0.103 Å for ZnPcF4-np, 0.232 Å for ZnPcCl4-p and 0.216 Å for ZnPcCl4-np (cf. 0.116 Å for ZnPc). The unit cell parameters and refinement statistics for ZnPcF4-np, ZnPcCl4-p and ZnPcCl4-np are given in Table 1.  ZnPcCl 4 -np crystallizes in the P2 1 /n space group. A distance between the molecules in the stack is 3.309 Å, a stacking angle is 46.51 • and an angle between molecules in adjacent stacks is 86.97 • (Figure 3d). At first glance, ZnPcCl 4 -np is isomorphic to both ZnPcF 4 -np and β-ZnPc, but the substituents of the chlorine atoms are too bulky compared to fluorine and hydrogen, which leads to very close contacts between the molecules in adjacent stacks. It should also be noted that the molecules of all four investigated ZnPcHal 4 derivatives remain relatively flat; the maximum deviation of any non-hydrogen atom from the rootmean-square plane is 0.168 Å for ZnPcF 4 -p, 0.103 Å for ZnPcF 4 -np, 0.232 Å for ZnPcCl 4 -p and 0.216 Å for ZnPcCl 4 -np (cf. 0.116 Å for ZnPc). The unit cell parameters and refinement statistics for ZnPcF 4 -np, ZnPcCl 4 -p and ZnPcCl 4 -np are given in Table 1.

Structure and Morphology of Thin Films
Thin film XRD patterns of ZnPcHal 4 in the range of 4-30 • 2θ are shown in Figure 4 in comparison with the powder patterns calculated using the above-mentioned data on the single-crystal structure and unit cell parameters.

Structure and Morphology of Thin Films
Thin film XRD patterns of ZnPcHal4 in the range of 4-30° 2θ are shown in Figure 4 in comparison with the powder patterns calculated using the above-mentioned data on the single-crystal structure and unit cell parameters. XRD patterns of all ZnPcHal4 films have single diffraction peaks, which indicate a possible strong preferred orientation of the film. The diffraction peak on the XRD pattern of ZnPcF4-p film has a noticeable asymmetry on the right side, and the 2θ position of its maximum at 6.71° lies between the peak (001) at 6.59° and the peak (010) at 7.12°, which means that the preferred orientation in the film is not ideal, and although most crystallites are oriented by the plane (001) parallel to the substrate surface, some are oriented by the plane (010) parallel to the surface substrates. The 2θ position of the diffraction peak on the XRD pattern of ZnPcF4-np film coincides well with the peak (−101) on the calculated powder pattern. The ZnPcF4-np film has a stronger preferred orientation and better crystallinity compared to the ZnPcF4-p film, since the diffraction peak on its X-ray image has a significantly lower FWHM (0.15°) compared to that of ZnPcF4-p (0.5°).  XRD patterns of all ZnPcHal 4 films have single diffraction peaks, which indicate a possible strong preferred orientation of the film. The diffraction peak on the XRD pattern of ZnPcF 4 -p film has a noticeable asymmetry on the right side, and the 2θ position of its maximum at 6.71 • lies between the peak (001) at 6.59 • and the peak (010) at 7.12 • , which means that the preferred orientation in the film is not ideal, and although most crystallites are oriented by the plane (001) parallel to the substrate surface, some are oriented by the plane (010) parallel to the surface substrates. The 2θ position of the diffraction peak on the XRD pattern of ZnPcF 4 -np film coincides well with the peak (−101) on the calculated powder pattern. The ZnPcF 4 -np film has a stronger preferred orientation and better crystallinity compared to the ZnPcF 4 -p film, since the diffraction peak on its X-ray image has a significantly lower FWHM (0.15 • ) compared to that of ZnPcF 4 -p (0.5 • ).
The XRD pattern of ZnPcCl 4 -p film has a strong diffraction peak at 6.39 • 2θ with FWHM of 0.37 • , which corresponds to (220) peak at 6.47 • 2θ on the calculated powder pattern. A small peak at 19.62 • 2θ corresponds to the peak (660), which belongs to the same group of crystallographic planes as the peak (220). The XRD pattern of ZnPcCl 4 -np film has a single weak broad peak at 6.38 • 2θ with FWHM of 0.83 • , which corresponds to the peak (−101) at 6.55 • 2θ on the calculated powder pattern. Its low intensity and high FWHM value suggest that the ZnPcCl 4 -np film has very poor crystallinity compared to the films of other investigated phthalocyanines. The angles between the molecules and the substrate surface in ZnPcHal 4 films, calculated on the basis of XRD data, are shown in Figure 5. The XRD pattern of ZnPcCl4-p film has a strong diffraction peak at 6.39° 2θ with FWHM of 0.37°, which corresponds to (220) peak at 6.47° 2θ on the calculated powder pattern. A small peak at 19.62° 2θ corresponds to the peak (660), which belongs to the same group of crystallographic planes as the peak (220). The XRD pattern of ZnPcCl4-np film has a single weak broad peak at 6.38° 2θ with FWHM of 0.83°, which corresponds to the peak (−101) at 6.55° 2θ on the calculated powder pattern. Its low intensity and high FWHM value suggest that the ZnPcCl4-np film has very poor crystallinity compared to the films of other investigated phthalocyanines. The angles between the molecules and the substrate surface in ZnPcHal4 films, calculated on the basis of XRD data, are shown in Figure 5. The morphology of the films was studied by AFM ( Figure 6). The morphology of ZnPcF4-np and ZnPcF4-p films is very similar. The surface of both films consists of slightly elongated crystallites with the size reaching 0.07 μm. The RMS values of ZnPcF4-np and ZnPcF4-np film are 9.54 and 4.44 nm, respectively. The film of ZnPcCl4-p consists of the clearly distinguishable smaller crystallites and has RMS of 5.58 nm. The morphology of the ZnPcCl4-p film differs significantly from that of the films of ZnPcCl4-p; the film is formed by vague elongated agglomerates, the size of which reaches 0.4 μm. Its RMS value is 8.96 nm. The morphology of the films was studied by AFM ( Figure 6). The morphology of ZnPcF 4 -np and ZnPcF 4 -p films is very similar. The surface of both films consists of slightly elongated crystallites with the size reaching 0.07 µm. The RMS values of ZnPcF 4 -np and ZnPcF 4 -np film are 9.54 and 4.44 nm, respectively. The film of ZnPcCl 4 -p consists of the clearly distinguishable smaller crystallites and has RMS of 5.58 nm. The morphology of the ZnPcCl 4 -p film differs significantly from that of the films of ZnPcCl 4 -p; the film is formed by vague elongated agglomerates, the size of which reaches 0.4 µm. Its RMS value is 8.96 nm. The XRD pattern of ZnPcCl4-p film has a strong diffraction peak at 6.39° 2θ with FWHM of 0.37°, which corresponds to (220) peak at 6.47° 2θ on the calculated powder pattern. A small peak at 19.62° 2θ corresponds to the peak (660), which belongs to the same group of crystallographic planes as the peak (220). The XRD pattern of ZnPcCl4-np film has a single weak broad peak at 6.38° 2θ with FWHM of 0.83°, which corresponds to the peak (−101) at 6.55° 2θ on the calculated powder pattern. Its low intensity and high FWHM value suggest that the ZnPcCl4-np film has very poor crystallinity compared to the films of other investigated phthalocyanines. The angles between the molecules and the substrate surface in ZnPcHal4 films, calculated on the basis of XRD data, are shown in Figure 5. The morphology of the films was studied by AFM ( Figure 6). The morphology of ZnPcF4-np and ZnPcF4-p films is very similar. The surface of both films consists of slightly elongated crystallites with the size reaching 0.07 μm. The RMS values of ZnPcF4-np and ZnPcF4-np film are 9.54 and 4.44 nm, respectively. The film of ZnPcCl4-p consists of the clearly distinguishable smaller crystallites and has RMS of 5.58 nm. The morphology of the ZnPcCl4-p film differs significantly from that of the films of ZnPcCl4-p; the film is formed by vague elongated agglomerates, the size of which reaches 0.4 μm. Its RMS value is 8.96 nm.

Sensor Response of ZnPcHal4 Films to Ammonia
The effect of the type of halogen substituents and their positions in the phthalocyanine ring on the sensor response toward gaseous ammonia (0.1-50 ppm) was studied in order to choose the material with the best sensor performance. The typical response S of the sensor, defined as S = (R − Ro)/Ro, where R is the resistance of a phthalocyanine film at a certain concentration of NH3 and Ro is the initial resistance of the film in fresh air, is shown in Figure 7a as an example. All sensing layers showed a noticeable increase in the resistance when exposed to ammonia. When the ammonia supply was stopped, the resistance was restored to its initial value, which indicated fast response and reversibility of the investigated sensors toward ammonia at room temperature. This behavior is typical for p-type organic semiconductors, and has also been observed for other unsubstituted and tetrafluorinated metal phthalocyanines [23]. Based on the fact that the studied phthalocyanines are p-type semiconductors, it was expected that their exposure to NH3 would cause an increase in the resistance due to depletion of the positively charged holes by electrons donated by NH3 molecules [72,73].
The dependence of the sensor response of investigated sensing layers on ammonia concentration is presented in Figure 7b. The sensor response of the investigated layers was

Sensor Response of ZnPcHal 4 Films to Ammonia
The effect of the type of halogen substituents and their positions in the phthalocyanine ring on the sensor response toward gaseous ammonia (0.1-50 ppm) was studied in order to choose the material with the best sensor performance. The typical response S of the sensor, defined as S = (R − R o )/R o , where R is the resistance of a phthalocyanine film at a certain concentration of NH 3 and R o is the initial resistance of the film in fresh air, is shown in Figure 7a as an example.

Sensor Response of ZnPcHal4 Films to Ammonia
The effect of the type of halogen substituents and their positions in the phthalocyanine ring on the sensor response toward gaseous ammonia (0.1-50 ppm) was studied in order to choose the material with the best sensor performance. The typical response S of the sensor, defined as S = (R − Ro)/Ro, where R is the resistance of a phthalocyanine film at a certain concentration of NH3 and Ro is the initial resistance of the film in fresh air, is shown in Figure 7a as an example. All sensing layers showed a noticeable increase in the resistance when exposed to ammonia. When the ammonia supply was stopped, the resistance was restored to its initial value, which indicated fast response and reversibility of the investigated sensors toward ammonia at room temperature. This behavior is typical for p-type organic semiconductors, and has also been observed for other unsubstituted and tetrafluorinated metal phthalocyanines [23]. Based on the fact that the studied phthalocyanines are p-type semiconductors, it was expected that their exposure to NH3 would cause an increase in the resistance due to depletion of the positively charged holes by electrons donated by NH3 molecules [72,73].
The dependence of the sensor response of investigated sensing layers on ammonia concentration is presented in Figure 7b. The sensor response of the investigated layers was All sensing layers showed a noticeable increase in the resistance when exposed to ammonia. When the ammonia supply was stopped, the resistance was restored to its initial value, which indicated fast response and reversibility of the investigated sensors toward ammonia at room temperature. This behavior is typical for p-type organic semiconductors, and has also been observed for other unsubstituted and tetrafluorinated metal phthalocyanines [23]. Based on the fact that the studied phthalocyanines are p-type semiconductors, it was expected that their exposure to NH 3 would cause an increase in the resistance due to depletion of the positively charged holes by electrons donated by NH 3 molecules [72,73].
The dependence of the sensor response of investigated sensing layers on ammonia concentration is presented in Figure 7b. The sensor response of the investigated layers was found to increase in the order ZnPcCl 4 -np < ZnPcF 4 -np < ZnPcF 4 -p < ZnPcCl 4 -p. For example, the sensor response of ZnPcCl 4 -p film to 1 ppm NH 3 is 2 times higher than that of the ZnPcF 4 -np film and 17 times higher than that of the ZnPcCl 4 -np film.
The linear dependence of the sensor response on the ammonia concentration is observed in the range from 0.1 to 1 ppm, and at higher concentrations the curve deviates from the linear one. The detection limits (LOD) of the sensing layers were estimated as 3s/m, where m is the slope of the calibration plot in the linear region, while s is the standard deviation of the sensor response to 1 ppm of NH 3 (Figure 7b inset).
LODs were calculated to be 0.01 ppm for the films of ZnPcCl 4 -p and ZnPcF 4 -p, while its values were 0.08 and 0.1 ppm in the case of ZnPcF 4 -np and ZnPcCl 4 -np films, respectively. The response and recovery time of phthalocyanine layers toward ammonia (1 ppm) was also investigated as presented in Figure 8 and summarized in Table 2.
Chemosensors 2021, 9, x FOR PEER REVIEW 10 of 20 found to increase in the order ZnPcCl4-np < ZnPcF4-np < ZnPcF4-p < ZnPcCl4-p. For example, the sensor response of ZnPcCl4-p film to 1 ppm NH3 is 2 times higher than that of the ZnPcF4-np film and 17 times higher than that of the ZnPcCl4-np film. The linear dependence of the sensor response on the ammonia concentration is observed in the range from 0.1 to 1 ppm, and at higher concentrations the curve deviates from the linear one. The detection limits (LOD) of the sensing layers were estimated as 3s/m, where m is the slope of the calibration plot in the linear region, while s is the standard deviation of the sensor response to 1 ppm of NH3 (Figure 7b inset).
LODs were calculated to be 0.01 ppm for the films of ZnPcCl4-p and ZnPcF4-p, while its values were 0.08 and 0.1 ppm in the case of ZnPcF4-np and ZnPcCl4-np films, respectively. The response and recovery time of phthalocyanine layers toward ammonia (1 ppm) was also investigated as presented in Figure 8 and summarized in Table 2.

Theoretical Study of the Nature of Bonding between Ammonia and ZnPcHal4 Molecules
Although observations of changes in the measured current of MPc sensing layers exposed to NH3 and other analytes are explained by electron transfer, the interaction sites in the phthalocyanine macrocycle or metal center are still a matter of discussion. According to the data of most works, the most energetically favorable cite of NH3 molecule binding is the central metal of MPc molecules [23,74,75]. In the case of the non-planar lead phthalocyanines, two bond critical points characterized the considered interaction between NH3 and PbPcFx were observed: between the Pb and nitrogen atoms as well as between one of the hydrogen atoms of ammonia and the Nβ atom of the PbPcFx macrocycle [76]. These conclusions were based only on quantum chemical calculations. At the same time, the experimental investigations of the interaction sites are sporadic [77]. Chia et al. [77] used in situ X-ray absorption spectroscopy (XAS) for the investigation of interaction of CuPc with NH3 molecule. The first derivative of XANES suggested low or lack of axial position coordination on the Cu metal center. On the other hand, the interaction on the macrocycle was supported by the EXAFS. From the EXAFS of CuPc with NH3, the inter-

Theoretical Study of the Nature of Bonding between Ammonia and ZnPcHal 4 Molecules
Although observations of changes in the measured current of MPc sensing layers exposed to NH 3 and other analytes are explained by electron transfer, the interaction sites in the phthalocyanine macrocycle or metal center are still a matter of discussion. According to the data of most works, the most energetically favorable cite of NH 3 molecule binding is the central metal of MPc molecules [23,74,75]. In the case of the non-planar lead phthalocyanines, two bond critical points characterized the considered interaction between NH 3 and PbPcF x were observed: between the Pb and nitrogen atoms as well as between one of the hydrogen atoms of ammonia and the N β atom of the PbPcF x macrocycle [76]. These conclusions were based only on quantum chemical calculations. At the same time, the experimental investigations of the interaction sites are sporadic [77]. Chia et al. [77] used in situ X-ray absorption spectroscopy (XAS) for the investigation of interaction of CuPc with NH 3 molecule. The first derivative of XANES suggested low or lack of axial position coordination on the Cu metal center. On the other hand, the interaction on the macrocycle was supported by the EXAFS. From the EXAFS of CuPc with NH 3 , the interaction was suggested to be at the benzene ring or bridging nitrogen atom. The experimental investigations of the interaction sites in the case of halogen-substituted MPcs have not yet been carried out.
In this work, the strength and nature of the bonding of ammonia and ZnPcHal 4 molecules were studied using quantum chemical simulation to understand the different effects of chlorine and fluorine substituents. It is known than there are two possible positions for the binding of NH 3 molecule in ZnPcHal 4 , namely central metal and substituents. For this reason, we considered the interaction between NH 3 and ZnPcHal 4 both via the central metal and through peripheral and non-peripheral halogen atoms.
It is important to note that the interaction of an isolated phthalocyanine molecule with NH 3 is considered in quantum-chemical calculations. In fact, in polycrystalline films, the molecules are packed in stacks of parallel molecules with a distance between the aromatic rings of about 3.3-3.4 Å (Figure 3), which is not enough for the penetration of NH 3 molecules between them to the central metal. Therefore, such interaction seems unlikely or possible only with the terminal molecules in the stacks. This, apparently, explains the results obtained in the work of Chia et al. [77] cited above. In addition, the estimated energies (20-24 kcal/mol) look high enough to be responsible for the sensor response to ammonia, which is easily reversible at room temperature.
Thus, it was also reasonable to consider the interactions of ammonia with ZnPcHal 4 molecules via peripheral and non-peripheral halogen atoms. For this purpose, the topological analysis of the electron density distribution function was carried out. As a result, the corresponding bond critical points were established (Figure 9), and the values of ρ(r) and ∇ 2 ρ(r) at these points were estimated. It was shown that the ZnPcCl 4 -np···NH 3 aggregate is characterized by the presence of three bond critical points: two between the hydrogen atoms of the ammonia molecule and the chlorine atom of ZnPcCl 4 -np (BCP1 and BCP2, Figure 9) and one between the nitrogen atom of NH 3 and the non-peripheral hydrogen atom of ZnPcCl 4 -np (BCP3). Similarly, three BCPs characterizing the interaction of NH 3 molecule with phthalocyanines are observed for ZnPcCl 4 -p···NH 3 , but, in contrast to the previous case, BCP2 is located between the nitrogen atom of NH 3 and the non-peripheral hydrogen atom of the benzene ring, which contains the chlorine atom involved in the formation of BCP1.
Phthalocyanines with fluorine substituents are characterized by two bond critical points (BCP1 and BCP2). BCP1 is observed between one of the hydrogen atoms of ammonia and the F atom, and BCP2 is between the nitrogen atom of NH 3 and the non-peripheral hydrogen atom. The difference between ZnPcF 4 -np···NH 3 and ZnPcF 4 -p···NH 3 is that in the case of BCP2, the hydrogen atoms are located on different benzene rings. The parameters of almost all designated BCPs indicate the formation of hydrogen bonds between these pairs of atoms. This follows from the fact that the ρ(r) и∇ 2 ρ(r) values in almost all cases lie in the ranges of 0.013-0.236 e/Å 3 and 0.578-3.350 e/Å 5 , respectively, which are characteristic of a hydrogen bond (Table 3) [44,78]. Only for BCP3 in ZnPcCl 4 -p···NH 3 , the values of the electron density and its Laplacian are significantly lower than the lower limit of these ranges, thus the interaction of the corresponding pair of atoms is rather of the Van der Waals type [79]. Phthalocyanines with fluorine substituents are characterized by two bond critical points (BCP1 and BCP2). BCP1 is observed between one of the hydrogen atoms of ammonia and the F atom, and BCP2 is between the nitrogen atom of NH3 and the non-peripheral hydrogen atom. The difference between ZnPcF4-np … NH3 and ZnPcF4-p … NH3 is that in the case of BCP2, the hydrogen atoms are located on different benzene rings. The parameters of almost all designated BCPs indicate the formation of hydrogen bonds between these pairs of atoms. This follows from the fact that the ρ(r) и ∇ 2 ρ(r) values in almost all cases lie in the ranges of 0.013-0.236 e/Å 3 and 0.578-3.350 e/Å 5 , respectively, which are characteristic of a hydrogen bond (Table 3) [44,78]. Only for BCP3 in ZnPcCl4-p … NH3, the values of the electron density and its Laplacian are significantly lower than the lower limit of these ranges, thus the interaction of the corresponding pair of atoms is rather of the Van der Waals type [79].  As a rule, hydrogen bonds are characterized by the closed-shell interaction between two atoms [44,78,79]. This interaction is characterized by small values of ρ(r) and ∇ 2 ρ(r) at the corresponding critical point (3, −1), while the values of ∇ 2 ρ(r) are positive [43,44,65,66]. Besides, the ratio of eigenvalues (|λ 1 |/λ 3 ) of the electron density Hessian matrix at this point in the case of closed-shell interaction is less than one, which is also observed for all considered BCPs (Table 3). However, negative values of the local electron energy h e (r) in BCP2 in the case of ZnPcCl 4 -p···NH 3 and ZnPcF 4 -p···NH 3 indicate the intermediate interaction between the corresponding pairs of atoms, which could be an indicator of covalent bonds formation [79]. At the same time, the values of ρ(r) at these points are low enough to suggest the formation of covalent bonds; however, they are significantly higher than the electron density values at all other critical points of the bond considered here. It is this fact that determines a stronger binding of the NH 3 molecule with ZnPc derivatives bearing Cl and F substituents in peripheral positions. Finally, the absolute value of E b increases in the order ZnPcCl 4 -np···NH 3 < ZnPcF 4 -np···NH 3 < ZnPcF 4 -p···NH 3 < ZnPcCl 4 -p···NH 3 (Table 3), which is in good agreement with the experimental data. Moreover, calculated Gibbs free energy change values at 298 K are close to zero in all four cases, indicating the reversibility of the NH 3 molecule binding with phthalocyanines. The same tendency of E b change was obtained by additional calculations with the use of the DLPNO-CCSD(T)/def2-TZVPP method ( Table 3, the values of E b in parentheses).
In this type of interaction, the binding of NH3 molecules can occur simultaneously with several phthalocyanine molecules, which leads to an increase in the total energy of the interaction. At the same time, the energy remains sufficiently low, which ensures the reversibility of sorption-desorption of analyte molecules.

Sensor Characteristics of ZnPcCl 4 -p and ZnPcF 4 -p Films
Sensor characteristics of ZnPcCl 4 -p and ZnPcF 4 -p films showing the best sensitivity to ammonia were studied in more detail to demonstrate the possibility of their use for the determination of low concentrations of ammonia in air. The reproducibility of the response of ZnPcR4 layers was studied by repeated exposure to 0.4 ppm NH 3 over a certain period of time, as shown in Figure 10a. Both sensors showed reproducible response after gas-on and gas-off cycle measurements for about one hour. The long-term stability of the sensing layers was also tested by an experiment with 0.4 ppm NH 3 at room temperature. The inset of Figure 10a shows that no more than 6% decrease of the sensor response of a ZnPcCl 4 -p film to ammonia was observed after 120 days, which testify its good stability. To investigate the effects of the relative humidity (RH), the response of both ZnPcF 4 -p and ZnPcCl 4 -p films was tested at different RH values. Figure 10b shows the change of the films' resistance upon exposure to 30-50 ppm NH 3 at 10, 40, and 70% RH. It was shown that an increase in humidity up to 40% did not lead to a change in the initial resistance of the ZnPcF 4 -p film and its sensor response to ammonia, but with an increase in humidity up to 70%, a decrease in the sensor response by about 1.5 times was observed (Figure 10c). This decrease in the sensor response can be explained by competitive sorption of the NH 3 and H 2 O molecules on the surface of a ZnPcF 4 -p film. This behavior is consistent with previously reported results [23,80]. At the same time, the films of ZnPcCl 4 -p are more sensitive to humidity. An increase of the humidity led to the more pronounced decrease in the initial resistance of ZnPcCl 4 -p film than in the case of ZnPcF 4 -p (Figure 10b). In contrast to ZnPcF 4 -p films, the sensor response of a ZnPcCl 4 -p film to ammonia increased with a growth of humidity up to 70% (Figure 10d).
The binding energies of H 2 O with ZnPcCl 4 -p and ZnPcF 4 -p molecules, calculated using the same method as with ammonia, were shown to be −3.0 and −2.7 kcal/mol, respectively. A stronger interaction between H 2 O and ZnPcCl 4 -p may promote the adsorption of more water molecules on the film surface. In the conditions of high humidity a continuous water layer appears to form on the surface of ZnPcCl 4 -p film and physisorbed water layers become to show a liquidlike behavior. Similar behavior was also described by authors of previous work [81,82], and the mechanism describing the increase in the conductivity of sensitive layers at high RH of the environment is known as the Grottuss mechanism [81]. Protons (H + ) formed as a result of water dissociation can move more easily through the water layer, which leads to an increase in the conductivity of the sensing film. With the introduction of NH 3 , the formation of NH 4+ and OH − ions generated from the dissociation of NH 3 in water may facilitate an increase in the sensor response, similar to the case described by other researchers [82,83].
This decrease in the sensor response can be explained by competitive sorption of the NH3 and H2O molecules on the surface of a ZnPcF4-p film. This behavior is consistent with previously reported results [23,80]. At the same time, the films of ZnPcCl4-p are more sensitive to humidity. An increase of the humidity led to the more pronounced decrease in the initial resistance of ZnPcCl4-p film than in the case of ZnPcF4-p (Figure 10b). In contrast to ZnPcF4-p films, the sensor response of a ZnPcCl4-p film to ammonia increased with a growth of humidity up to 70% (Figure 10d). Figure 10. (a) Reproducibility and stability of the response of a ZnPcCl4-p layer to 0.4 ppm NH3, measured at room temperature and RH 10%. Change of the resistance (b) and the sensor response (c,d) of the ZnPcF4-p and ZnPcCl4-p films upon interaction with NH3 at different relative humidity, measured at room temperature.
The binding energies of H2O with ZnPcCl4-p and ZnPcF4-p molecules, calculated using the same method as with ammonia, were shown to be −3.0 and −2.7 kcal/mol, respectively. A stronger interaction between H2O and ZnPcCl4-p may promote the adsorption of more water molecules on the film surface. In the conditions of high humidity a continuous water layer appears to form on the surface of ZnPcCl4-p film and physisorbed water layers become to show a liquidlike behavior. Similar behavior was also described by authors of previous work [81,82], and the mechanism describing the increase in the conductivity of sensitive layers at high RH of the environment is known as the Grottuss mechanism [81]. Protons (H + ) formed as a result of water dissociation can move more easily through the water layer, which leads to an increase in the conductivity of the sensing film. With the introduction of NH3, the formation of NH 4+ and OH − ions generated from the dissociation of NH3 in water may facilitate an increase in the sensor response, similar to the case described by other researchers [82,83].
Selectivity is another important factor for the application of chemical sensors. To investigate the selectivity, the response of the layers of ZnPcF4-p and ZnPcCl4-p to various Selectivity is another important factor for the application of chemical sensors. To investigate the selectivity, the response of the layers of ZnPcF 4 -p and ZnPcCl 4 -p to various analytes, viz. carbon dioxide, dichloromethane, acetone, toluene, ethanol, was tested ( Figure 11). It is obvious that the response of both sensing layers to NH 3 was much higher than to interfering analytes. It is necessary to mention that the concentration of ammonia given in the diagram is much less than that of the other analytes. These results show that the sensors are highly selective against the tested interfering analytes, especially at their low concentrations, which makes them attractive for detecting ammonia in gas mixtures. analytes, viz. carbon dioxide, dichloromethane, acetone, toluene, ethanol, was tested (Figure 11). It is obvious that the response of both sensing layers to NH3 was much higher than to interfering analytes. It is necessary to mention that the concentration of ammonia given in the diagram is much less than that of the other analytes. These results show that the sensors are highly selective against the tested interfering analytes, especially at their low concentrations, which makes them attractive for detecting ammonia in gas mixtures. Figure 11. Diagram of selectivity of ZnPcF4-p and ZnPcCl4-p sensing layers toward various analytes, measured at room temperature and RH 10%.
The sensor response of a ZnPcCl4-p film to ammonia was also measured in the mixture of air with carbon dioxide (10,000 ppm) (Figure 12). It was found that the presence of 10,000 ppm CO2 has virtually no effect on the sensitivity of the ZnPcCl4-p film to ammonia, Figure 11. Diagram of selectivity of ZnPcF 4 -p and ZnPcCl 4 -p sensing layers toward various analytes, measured at room temperature and RH 10%.
The sensor response of a ZnPcCl 4 -p film to ammonia was also measured in the mixture of air with carbon dioxide (10,000 ppm) ( Figure 12). It was found that the presence of 10,000 ppm CO 2 has virtually no effect on the sensitivity of the ZnPcCl 4 -p film to ammonia, e.g., the (R − R o )/R o value increased from 0.38 to 0.44 when 10,000 ppm CO 2 was added to the gas mixture containing 20 ppm NH 3 . It was also shown (Figure 12) that the heating of the films to 100 • C did not cause noticeable changes of the sensitivity of ZnPcCl 4 -p film to ammonia. Figure 11. Diagram of selectivity of ZnPcF4-p and ZnPcCl4-p sensing layers toward various analytes, measured at room temperature and RH 10%.
The sensor response of a ZnPcCl4-p film to ammonia was also measured in the mixture of air with carbon dioxide (10,000 ppm) ( Figure 12). It was found that the presence of 10,000 ppm CO2 has virtually no effect on the sensitivity of the ZnPcCl4-p film to ammonia, e.g., the (R − Ro)/Ro value increased from 0.38 to 0.44 when 10,000 ppm CO2 was added to the gas mixture containing 20 ppm NH3. It was also shown ( Figure 12) that the heating of the films to 100 °C did not cause noticeable changes of the sensitivity of ZnPcCl4-p film to ammonia.  Some examples of chemiresistive sensors on the basis of phthalocyanine films described in the literature are presented in Table 4 and compared with the results obtained in this work. Both ZnPcF 4 -p and ZnPcCl 4 -p films exhibit the lower detection limit in comparison with the films of other metal phthalocyanines.

Conclusions
In this work, the effect of the position of fluorine and chlorine substituents in tetrasubstituted zinc phthalocyanines ZnPcR 4 -np and ZnPcF 4 -p (R = F, Cl) on their structure and chemiresistive sensor response to low concentration of ammonia was studied. The structure and morphology of their films deposited by thermal evaporation in vacuum were investigated by XRD and atomic force microscopy methods. It was shown that both position and type of substituents affect the structure of single crystals and films of zinc phthalocyanines. In the case of ZnPcF 4 -p, the molecules are arranged in parallel stacks similarly to α-polymorphs of unsubstituted phthalocyanines, while ZnPcF 4 -np, ZnPcCl 4 -p and ZnPcCl 4 -np form crystals and films with herring bone arrangements of phthalocyanine macrocycles. According to XRD data, the films of have strong preferential orientation of crystallites relative to the substrate surface; however, the ZnPcCl 4 -np film has poorer crystallinity compared to the films of other phthalocyanine derivatives.
The chemiresistive sensor response of the investigated layers to ammonia was found to increase in the order ZnPcCl 4 -np < ZnPcF 4 -np < ZnPcF 4 -p < ZnPcCl 4 -p, which is in good agreement with the values of bonding energy between hydrogen atoms of NH 3 and halogen substituents in the phthalocyanine rings. ZnPcCl 4 -p films demonstrate the maximal sensor response to ammonia with the calculated detection limit of 0.01 ppm. Additionally, the sensors have good long-term stability and reproducibility. It was shown that both ZnPcF 4 -p and ZnPcCl 4 -p and can be used for the selective detection of ammonia in the presence of carbon dioxide, dichloromethane, acetone, toluene, and ethanol.