2-Nitro- and 4-fluorocinnamaldehyde based receptors as naked-eye chemosensors to potential molecular keypad lock

New-generation chemosensors desire small organic molecules that are easy to synthesise and cost-effective. As a new interdisciplinary area of research, the integration of these chemosensors into keypad locks or other advanced communication protocols is becoming increasingly popular. Our lab has developed new chemosensor probes that contain 2-nitro- (1–3) and 4-fluoro-cinnamaldehyde (4–6) and applied them to the anion recognition and sensing process. Probes 1–6 are colorimetric sensors for naked-eye detection of AcO−/CN−/F−, while probes 4–6 could differentiate between F− and AcO−/CN− anions in acetonitrile. Using the density functional theory (DFT), it was found that probes 1–6 acted as effective chemosensors. By using Probe 5 as a chemosensor, we explored colorimetric recognition of multiple anions in more detail. Probe 5 was tested in combination with a combinatorial approach to demonstrate pattern-generation capability and its ability to distinguish among chemical inputs based on concentration. After pattern discrimination using principal component analysis (PCA), we examined anion selectivity using DFT computation. In our study, probe 5 demonstrates excellent performance as a chemosensor and shows promise as a future molecular-level keypad lock system.


Results and discussion
The chemosensors designed with the presence of -NH and C=S functional groups on probes to increase the reactivity of the probes. The two step synthesis yielded compound 1-6 as probe (receptors) in good yield (76-88%). The structures of all the probes were characterized by with different spectroscopic techniques including FTIR, 1 HNMR and 13 C NMR, Mass spectrometry. The IR spectrum of probes 1-6 showed characteristics C=S stretching frequencies at 1186-1198 cm −1 , for C=N at 1580-1590 cm −1 and for N-H at 3119-3219 and 3318-3334 cm −1 . The 1 H NMR showed two characteristics singlet peaks at 11.67-10.03 and 9.13 ppm for N-H protons.
Colorimetric analysis and UV-visible spectral studies. The UV-visible spectra of probes 1-6 were recorded without the anion. The chromophore effect could be seen among the two groups, i.e. nitro-derivatives receptors 1-3 and fluoro-derivatives receptor 4-6. Specifically; upon comparing the absorption maxima of 1 (318 nm) and 4 (342 nm), where the receptor unit were the same however the chromosphere unit were different. The difference calculated due to the chromophore effect was about ~ 24 nm which was attributed to π-π* and/or n-π* transitions in the two separate range groups as expected depending on the electron-withdrawing effect of substituents (Scheme 1). Initially, probes 1-6 were evaluated for anion sensing ability by the naked eye. We found that the reaction of the probe 1-6 with the anions solutions (F − , Cl − , Br − , I − , ClO 4 − , AcO − , HSO 4 − , CN − , and SCN − ) caused a change in the color which could be seen by naked eyes. The intense color change was observed with fluoride, while less prominent with cyanide and acetate ion solutions. However, other anions did not show a visible change in color (Fig. 1). Probe 1-3 which were nitro-derivatives showed a change from colorless to dark red while the fluoro-derivatives 4-6 changed from colorless to yellow.
The absorption spectrum of probes 1-6 with the anions (F − , Cl − , Br − , I − , ClO 4 − , AcO − , HSO 4 − , CN − , and SCN − ) reveal that only fluoride and cyanide could cause obvious changes in the spectrum while some change by acetate anion. As shown in Fig. 2 new broad absorption bands between 350 and 500 nm appeared upon addition of fluoride and cyanide anions for probes 1-3 while new absorption band between 350 and 450 nm appeared after the addition of the same anions in probes 4-6. The addition of acetate anion to probes 1-6 showed a decrease in the intensity of the ICT band to a broad shoulder band and concomitant formation of new bands similar to fluoride and cyanide anion addition, however, subtle differences were noted. These overall changes indicate anion binding, through hydrogen bonding at the electron-rich thiourea, attached to electron-withdrawing functional groups which create a push-pull effect and consequently shift the absorption wavelength towards red.
The ratiometric response of the probes 1-6 was studied by incremental addition of fluoride, acetate, and cyanide ions (1 × 10 −2 M) to the fixed volume of receptor probes ( These observations were attributed to experimental more favorable towards ICT process (π-π* and/or n-π*) in 1-3 due to charge propagation to the electron-deficient (-NO 2 ) moiety, and a significant intense color change due to extended conjugation 35 . During titration of receptors with acetate anion, we observed specific and unique changes. We noted that absorption maxima for receptor 1-3 at around 320 nm decreased Reflux, 2-3 hrs + EtOH-HCl  www.nature.com/scientificreports/ slightly and new broadband appeared around 350 nm and 460 nm with significant 'tailing off ' . Thus we notice a subtle difference in the spectra of titration with acetate anion. Titration of receptor 4-6 with fluoride and cyanide revealed that absorption maxima for 4, 5 and 6, at 342, 343, and 339 nm collapsed and a new band at around 246 nm and a new red-shift sharp band at 400, 401 and 402 nm appeared and developed with isosbestic points at 287, 363 nm (4) 296, 362 nm (5), and 292, 359 nm (6) respectively with a change in color of the solutions from colorless to yellow. The ∆λ max of 63, 64, and 67 nm were observed. The new red-shift band induced by fluoride anions match well with recent reports of anion sensors 36 , suggesting that it could be the response towards deprotonating of receptors 1-6 as also predicted by our theoretical calculation. For receptor 4-6 upon titration with acetate anion as noted above the absorption maxima reduced only slightly and new broad bands appear around 248 nm and at around 406 nm giving a slight yellow color solution. The spectra for 1-6 upon titration with acetate revealed only 10-20% reduction in the absorption maxima. Among all the receptors the least changes in the absorption maxima observed for receptors 3 and 5 (Fig. 2c-e).
A comparison of the fluoride and acetate anions titration plot with model receptor 5 are shown in Fig. 3. It could be seen that the absorption maxima of 5 collapsed upon titration with fluoride while the absorption maxima reduced only 20% upon titration with acetate. Hence we propose that these changes are due to the direct   www.nature.com/scientificreports/ interaction of the acetate anion with the receptor probes in a specific and unique manner and not by a common mechanism such as deprotonation of the thiourea protons, as such a mechanism would have led to the formation of the same product for all the anions and hence, identical absorption spectrum. The detection limit is an essential function of the anion sensor. All the receptors 1-6 were efficient sensors for fluoride anion with the detection limits in the range of 4.49 × 10 -7 M to 2.57 × 10 -6 M. The detection limit of 4.49 × 10 -7 M for fluoride was much lower compared to some recent reports on chemosensors 37 . The cyanide anion detection limits was in the range of 4.78 × 10 -7 M to 1.98 × 10 -6 M. The detection limit of 1.98 × 10 -6 M was much less that phenylthiourea derivatives 38 , and azo-benzyldenethiourea reported previously According to the World Health Organization, concentrations lower than 5.3 mM for fluoride are acceptable in drinking water 39 , which means that probe 1-6 are valuable tools for the detection of fluoride in safe drinking. The stoichiometry of the receptor to anion ratio was determined by taking equimolar combinations of receptors and tetra-butylammonium salts of anions in CH 3 CN. The calculations were done using Job's Plot. All the compounds show receptor: anion ratio as 1:2 for 1-6 ( Fig. S2a-f). From the above titration results, the anions indeed interacted with the (N-H) protons of the semicarbazone 40 . The Benesi-Hildebrand equation was applied to calculate the association constant 41 . It was found that nitro-based receptors show a lower association constant value compared to fluoro-based receptors. Specifically, comparing 1 and 4, their associations constant were 1.64 × 10 4 and 1.63 × 10 5 respectively where the receptor unit are the same only the chromophoric units are different (Table 1). Similar substituent effect have been reported recently 42 . Among the nitro-based receptors, compound 3 has the highest association constant which could be attributed to the push effect of the tertiary amine group on the receptor. Whereas, among the fluoro-based receptors, probes 4 and 6 had high association constants which are attributed to the para-and ortho-para position of the fluorine substituent on the receptors respectively. It was very predictable that the highest association constant would be for 6 with ortho-para difluoride substituted receptor unit which provides a greater electron-withdrawing effect. Our result are inline with our previous report of Coumarin-thiosemicarbazones and Acridine based thiosemicarbazone receptor compounds as shown in the Table 1, however, the association constant values for compound 6 are higher in the current study compared to the earlier reports. The nature of interaction between thiourea protons and the anion plays a critical role. Most likely the sensing for acetate was due to hydrogen bonding interaction with thiourea protons, however for fluoride initial hydrogen bonding interaction followed by ion-pair complex formation (bifluoride ion) HF 2 − , due to its deprotonating ability 43 .
Dividing the intercept with slope from BH Plot, K a was calculated. Compound 1-3 did not show fluorescence. This could be due release of absorbed energy in a non-radiative process such as transferring excess energy to surrounding molecules, decay to lower but close energy states or reacting with surrounding molecule as has been observed for non-fluorescent compounds 19 . Compound 4, 5, and 6 give fluorescence as expected reason being imine derivatives of 4-fluorocinnamaldehyde having fluoro-substituent attached to phenyl rings on both sides of thiourea moiety. They were further investigated for fluorescence studies. It was observed that a new band has appeared at 525 nm when excited at 405 nm. Incremental addition of TBAF (10 equiv) in a fixed volume of compounds 4-6 (1 × 10 -4 mol L −1 ) was observed to increase the intensity at 525 nm as shown in Fig. 4 below.
Spectroscopic pattern analysis. All compound (1-6) exhibit capability for sensing for F − , AcO − , and CN − but derivatives 3 and 5 showed sensing responses to AcO − anions with distinct spectral patterns. Some recent studies have reported fluoro-substituted phenyl giving a curved conformation to the compounds 42 . A curved conformations where a cavity is formed limits the receptor/anions interaction by allowing the anions to approach for the -N-H proton based on the anion size 44 . Among probes 4-6 we selected probe 5 with a fluoro-substituent at meta-position (Fig. 5a) as it has intermediate selectivity for anions but distinct spectral response (Fig. 5b). Hence we anticipated that the fluoro-derivative 5 due to the difference in the interaction of www.nature.com/scientificreports/ the receptor and anions (AcO − /F − /CN − ) could lead us to optimize sequential chemical input and generating distinct spectral responses. We first analyzed the ability of 5 to distinguish between ratios of the same input anions. We noticed that 5 was able to distinguish between the addition of anions (F or C), followed by the second addition of the same anion (FF and CC), indicating that 5 could lead to the generation of a distinguishable absorption pattern (Fig. 6a). According to this, changing the concentration affects the ratio between them. Secondly, we analyzed the ability of 5 to distinguish between different input anions. We used changing the anion i.e. input to CF, which revealed altered interaction of the probe 5 to give changed spectra (Fig. 6b). Upon reversing the sequence the spectra showed minor differences (Fig. 6c). However, probe 5 could recognize AcO − and F − at different spectral patterns. Probe 5 on the addition of AcO − followed by F − could induce 348 nm and 401 nm absorption bands; however, only 401 nm absorption band was observed when reversed the addition sequence. The absorption response at four different wavelengths 254, 317, 340, and 402 nm were recorded to see the change in the spectra between different sequential input systems. The plot in Fig. 6d shows a significant change between the different sequences analyzed. This indicated that the sequential addition of anions favorably interacts with the same sites. This  www.nature.com/scientificreports/ tendency are higher in multivalent receptors which exhibit binding and conformation dynamics which allows the compounds to discriminate among different sequential inputs 46 . Thus we found that our system could produce spectral patterns of distinctive nature and could also distinguish among "passwords" containing different inputs and different ratios of inputs. The principal component analysis (PCA, Fig. 7) of the complete spectral data shows the probe 5 could discriminate between all possible permutations of anions (F, C, A, FF, CC, FC, CF, etc.) akin to an equivalent 2-digit electronic keypad device. The PCA score plot in Fig. 7 shows the complete segregation of keypad passwords of  www.nature.com/scientificreports/ different combinations. However, the complete separation among the different combinations of passwords are clearly seen along PC-1. The score plot of the PCA model also shows that PC-1 contributes more to separate among sequential combinations as compare to factor-2. PC-1 carries 57% of the spectral variation and PC2, 32% respectively. Since probe 5 shows absorption maxima at 348 nm and 401 nm for AcO − and F − respectively hence sequential chemical input AcO − and F − could be utilized as password of the molecular keypad lock for molecular traffic signal with 2-chemical inputs. These observations inspire us to explore probe 5 to develop molecular keypad locks or chemical passwords. To develop a simple molecular keypad lock, chemical input-1 and input-2 were assigned at "A" and "B" while, the outputs signals at 348 nm and 401 nm were assigned at "M" and "E". Key "R" was assigned for the "OPEN" state of the lock. Now when the input "A" was added first giving 348 nm followed by "B" giving 401 nm absorption band, when detected by the system, this would result in "OPEN" state of the lock. This sequence of chemical inputs would open the lock and the password would be "AMBER" (Fig. 8). All the other sequences would fail to open the lock.

Combinatorial 3-input password analysis.
The changes in the anion (A vs. B) and /or its concentration (i.e. A vs. AA or B vs. BB) could lead to distinct patterns for passwords A, B, AA, and BB. Thus this system could generate unique optical "fingerprints". Upon addition of OAc − , F − , and CN − anion, as distinct code entries denoted by A, B, or C a more advanced molecular security system that has the capability of the 3-digit passwords consisting of different permutations of 3-input keys could be developed. Although this possess the challenge of differentiating between the 27 combination as shown in Table 2 below, however, many could be readily be differentiated by the molecular device.
We conducted the sequential additions and the final 3-digit molecular password system was created after testing a wide range of permutation and eliminating any group of sequences that generated overlapping spectra. The non-overlapping patterns generated by different passwords consisting of acetate (A), fluoride (B), and cyanide (C) as input signals are presented in Fig. 9a. The resulting PCA plot was applied to differentiate between the unique chemical passwords (i.e., BBB, CCC, CCB, BCA, BCC, CBB, and AAA) and the remaining combinations that resulted in overlapping patterns i.e. Groups A-C. The pattern analysis of the combinations reveals that seven 3-digit passwords could be authorized by the unimolecular security systems (Fig. 9b). The overlapping spectra formed in three groups. Group A formed from overlapping BBA, CCA, ACC, BAA, AAC, CAA, CAC, ACA while Group B formed from overlapping ABA, BAB, CAB, ABC, ABB, CBA, and group C had BBC, ACB, AAB, BCB, CBC, BAC.
Thus our attempted to explore the ability of this system to process a diverse set of chemical inputs shows that probe 5 possesses the ability to generate patterns based on the chemical inputs, secondly the pattern generated by the UV-Vis system was efficient in distinguishing among different concentrations of the chemical inputs. This system could authorize multiple users without changing the "lock" or "the key". Each user could change his password by altering the chemical input. The chemical anions are all colorless and transparent in the visible  www.nature.com/scientificreports/ region and hence their structural and concentration level cannot be determined visually which gives an added security to this system. This work presents an insight to design anion sensors for future information security systems and multifunctional logic devices.
Theoretical analysis. The scheme of optimized geometries with B3LYP-D3 47,48 , /6-311 + G(d,p) 49-51 , with water as solvent by applying the implicit solvent model SMD 52 , are shown in the Fig. 10 and Figs. S9 and S10. These calculations were used to obtain the thermodynamic data to calculate the equilibrium constants, pK a and Hammet constants of sensors. These geometries were after utilized to perform the TD-DFT calculations with ωB97X-D3 53 , functional and basis set ma-def2-TZVP 44,54 , with water as solvent by applying the SMD model. Initially it was investigated the reactivity of the chemosensors 1-6 through frontier molecular orbital (FMO) analysis (Table 3). Though the FMO analysis was verified that overall, the chemosensors showed FMO energies remarkably close with an even larger similarity between the chemosensors derived from nitrocinnamaldehyde, particularly 1 and 2 and between derived from fluorocinnamaldehyde, 4-6. The compounds 1 and 2 showed lower HOMO and LUMO values and with lower ΔE HOMO-LUMO energy than 4-6 (fluorocinnamaldehyde derivatives). Compound 3 showed an equivalent LUMO energy to 2, however with higher HOMO energy than 1 and 2 thus presenting the lowest ΔE HOMO-LUMO between them. This behavior could be explained by the donor nature of the amine group. The compounds derived of fluorocinnamaldehyde (4-6) showed a behavior remarkably analogous to compound 0 (non-substituted) demonstrating a low influence of -F groups on the FMO of chemosensors in relation to the -NO 2 group. Although the compound 6 (with two -F substituent groups) demonstrated lowest HOMO and LUMO energies than 4 and 5 and higher ΔE HOMO-LUMO .
The analysis of the surfaces of HOMO and LUMO orbitals of compound 0 and 1-6 showed that the HOMO and LUMO orbitals are remarkably similar for all compounds (Table S1), however, the chemosensors derived from nitrocinnamaldehyde (1-3) have their LUMO surface with a large concentration in the -NO 2 group while the derived of fluorocinnamaldehyde have low participation of -F in the LUMO orbital. Demonstrating the higher influence of -NO 2 group on the FMO of chemosensors. Figure 11 demonstrates this behavior. Besides that, it was verified that the HOMO of compound 3 (Fig. 12) was concentrated near of amine group, which explains its slightly higher energy than other chemosensors as discussed before.  Table 4 and demonstrated that the compounds 1-6 have a significant analogous reactivity which was expected from the FMO analysis. The high ΔE HOMO-LUMO showed by the compounds 1-6 demonstrate high stability in which the 4-6 indicates slightly higher chemical stability than 1-3.
The compound 2 present the highest ionization potential (IP) values which indicate higher chemical stability and inertness. Overall, the compounds 1-3 showed higher values of electronic affinity (EA) than 4-6 which demonstrate that compounds 1-3 can easily take electron than 4-6; this behavior should be related to the -NO 2 group. The sensors 1-3 also showed slightly higher values of electronegativity (χ) and higher negative values of chemical potential than 4-6, these two indices associated indicate that compounds 1-3 have a higher tendency to attract electrons than 4-6. However, the compounds 4-6 showed higher hardness (η) values than 1-3; this behavior should be related to the presence of -F groups. The compounds 1-3 also showed higher values of electrophilicity (ω) than 4-6. Thus, the chemosensors 1-3 should attract the anions more than 4-6. The sensors 1-3 also presented higher values of softness (σ) than 4-5.
To further, investigate the excitations of chemosensors were performed the hole-electron analysis of chemosensors. The first ten excitations (states 1-10) of chemosensors 1-6 were calculated (Tables S2-S8). However, to facilitate our analysis just the two main excitations of chemosensors (1-6) were further evaluated. Thus, the two excitations with the highest f osc were chosen. These excitations are arranged in Table 5 (largest f osc ) and Table 6 (second largest f osc ). Were observed that for chemosensors 1-3 (nitrocinnamaldehyde derivatives) the excitations with larger f osc are the excitations S 0 → S 4 (state 4) and for chemosensors 4-6 (fluorocinnamaldehyde derivatives), are the excitation S 0 → S 2 (state 2). Overall, the nitrocinnamaldehyde showed lower wavelengths and higher excitation energies (for its equivalent excitations) than fluorocinnamaldehyde derivatives.     www.nature.com/scientificreports/ As for FMO and GRD analysis, the hole-electron analysis showed indices values remarkably similar for compounds 1-6. However, the nitrocinnamaldehyde derivatives (1-3) presented some slight differences in relation to fluorocinnamaldehyde derivatives (4)(5)(6). Though the analysis of hole and electron distribution were verified that the D indices for 1-3 present medium values, however, the compounds 4-6 presented low D indices values which indicate that the S 0 → S 2 excitations of 4-6 have a lower distance between hole and electron distribution than S 0 → S 4 excitations of 1-3 compounds, and consequently higher E Coul than 4-6. The Sr index of compounds 4-6 was also higher than 1-3. However, the H index of compounds 1-3 was higher than 4-6, which indicates that a higher extension of the hole and electron distribution of compounds 1-3. The t index was substantially < 0 indicating that the main excitation of compounds 1-6 are a local excitation (LE). Finally, the HDI and EDI indices of sensors 1-3 showed slightly lower than 4-6 indicating a higher spatial extension of hole and electron of 1-3. The hole-electron analysis indices demonstrated that the main excitation of compounds 1-6 is a local excitation (LE)of π-π* type, as verified by experimental results.
The analysis of hole + electron surfaces (Tables S9-S15) demonstrates that the excitation with highest f osc along 1-6 are again similar. However, it could be observed in Fig. 13 that 1 respective excitation has a higher hole extension and electron spatial distribution than 4 besides a higher separation between hole and electron. This behavior should be related to the presence of -NO 2 group in the sensors 1-3 and demonstrates a higher CT character in 1-3 than 4-6.
For the excitations of sensors 1-6 with the second highest f osc , although the values of hole-electron analysis indices are remarkably similar, the trend between 1-3 and 4-6 were exchanged. The sensors 1-3 showed higher wavelength and lower excitation energies than 4-6. For this excitation, the sensors 4-6 showed medium values of D indices as for 1-3 sensors, although also lower than 1-3. The S r index values of this excitation are lower than the excitation with the highest f osc which indicates a possibility of n-π* excitation type. The t index remained with a value < 0, but with lower values, which indicates an increase of CT in the excitation. The HDI and EDI also are higher than the previous excitation and indicate an increase of CT in the excitation. However, this excitation were still a local excitation.
It was verified, through the analysis of hole + electron surface (Fig. 14) and the analysis of atomic contributions to the hole, that the excitation S 0 → S 1 of compound 1 have a contribution of 11.93% of S atom to the hole and the excitation S 0 → S 3 o sensor 4 have a contribution of 50.45% of S atom to the hole (Tables S17, S20, respectively). Therefore, along with the hole-electron indices analysis, the hole + electron surfaces indicate that the excitation Table 5. Hole-electron analysis indices for the excitations with highest f osc of compounds 0 and 1-6.  Table 6. Hole-electron analysis indices for the excitations with second highest f osc of compounds 0 and 1-6.  www.nature.com/scientificreports/ S 0 → S 1 of compound 1 was an excitation of π-π* type while the S 0 → S 3 of compound 4 was an excitation of n-π* type which demonstrate the importance of the S atom of thiosemicarbazides to the excitations of the molecule which should be reflected in the UV-vis spectrum of sensors. Besides that, other important excitation with lower f osc beyond low excitation energies are excitation of n-π* type with the n orbitals of S atom. This excitation was present in all sensors and has in general the lowest excitation energy with an exception for compounds 1 and 3.
The plot of the hole and electron distribution of this excitation were shown in the Fig. 15, for compound 1 this excitation was the excitation S 0 → S 2 , but for compounds 0 (reference, non-substituted), 2, 4, 5 and 6 was the excitation S 0 → S 1 , and finally for sensor 3 was the excitation S 0 → S 3 as could be verified in Tables S9-S15. This excitation demonstrates the importance of the S atom as a donor in the sensors. In the compounds 4-6 the influence of the S atom were even more highlighted representing on average 80% of contribution to the hole of the first excitation (Tables S16-S22).
Is also, important highlight, that the hole and electron of compounds 1-6 are composed of more than one molecular orbital (MO) with different percentages of contributions to the formation of holes and electrons. In the supplementary material are showed the contributions of each MO with the percentage of contribution above 5% to the hole or electron (Tables S16-S22). The main MO that contributes to the composition of hole and electron of main excitations of compounds 1-6 are shown in Tables S23-S29.
In order to further understand the nucleophilic regions of the sensors were performed a charge analysis of compounds 1-6. Through the analysis was verified that the bond N-H of thiosemicarbazides were the more nucleophilic bonds and the charges of H atoms and atoms that are neighbored to it were shown in Table 7. The GRD analysis indicates that sensors 1-3 showed slightly high nucleophilicity and the CHelpG charge distribution   www.nature.com/scientificreports/ of H atoms bonded to N atom from thiosemicarbazides agree with this behavior. The charge analysis demonstrates that H11 and H14 atoms of compounds 1-3 were more positively charged than 4-6. Besides that, the H14 atom was more positively charged than H11 for all compounds along with the N14 atom (bonded to H14) was negatively charged against the N11 atom (bonded to H11) was positively charged, which indicates that H14 should be the H atom first dissociated in an acid-base equilibrium. Thus, the H14 atom was considered more acid for the dissociation of the sensor in the acid-base equilibrium to the calculation of acid-base equilibrium and pK a of 1-6. The optimized structures of sensor anions are shown in the Fig. S1 and the geometries for compound 0 and its anion are shown in the Fig. S2.
To study the acidity of chemosensors and the influence of substituents its pK a and theoretical Hammet constants were calculated. To validate our results were performed a brief test of methodology by calculating the pK a and σ X of the benzoic acid and some and substituted benzoic acids (R-bza, R = m-NO 2 -, p-NO 2 -, m-F-, or p-F) and compare with experimental results 55 . The results are shown in Tables S30 and S31. It was observed a large error of the calculated pK a calc and σ X calc with implicit solvent SMD in relation to experimental values, as verified by Thapa and Schlegel 56 . Although, the average error for pK a was about 34%, the acidity trends and influence of substituents in the reactivity of the compounds was maintained. Thus we considered this method suitable to the study of chemosensors.
The calculated results for receptors 1-6 are shown in the Table 8 and the thermochemical data used to calculate it are shown in Table S32. The analysis demonstrated that in general compounds 1-3 was slightly more acids than 4-6, with an exception for compound 6 that showed a second higher acidity followed by 3. This behavior demonstrates that the push-pull effect in 3 (due to the presence of the donor amine group and the electron-withdrawing substituent -NO 2 ) besides the inductive electron-withdrawing effect of two -F substituents in 6make the receptors more capable to interact with anions as verified by experimental results of association constants. However, the compound 4 showed the lowest acidity along with all receptors, including the reference 0 without substituents, which do not agree with experimental association constants. This behavior demonstrates that other effects should be associated with receptors reactivity beyond the widespread substituent effects.
The calculated Hammet constants σ X reveal that all sensors showed positive value of σ X , which demonstrate that the substituents favored the proton dissociation, except for the compound 4 that showed a σ X = − 0.  Table S34. It was observed through our analysis that just the anions F − , AcO − and CN − presented equilibrium constants above the order of 10 -10 , demonstrating equilibrium with these three anions are favored, in agreement with experimental results. It was observed through our analysis that just the anions F − , AcO − and CN − presented equilibrium constants above the order of 10 -10 , demonstrating a equilibrium with this three anions are favored, in agreement with experimental results. Furthermore, the K eq for F − , AcO − and CN − anions showed the follow trend: CN − > F − > AcO − (Table 9), in Table 7. CHelpG charges of selected atoms of compounds 0 and 1-6.  Table 8. Relative Gibbs free energy ( G * aq , calculate by using the Eq. (10)) in kcal/mol, equilibrium constant ( K a , calculate by using the Eq. (14)), pK a (calculate by using the Eq. (10), and Hammet constant ( σ X , calculate by using the Eq. (12)).  ) for such chemical systems. However, as discussed before, this model was considered suitable for a qualitative evaluation of dissociation equilibrium between sensors and anions. Is expected that anions interact with sensors though H-bonds with thiourea protons before its deprotonation though a excited state proton transfer (ESPT) 57,58 . In order to evaluate this anion-sensor interactions were performed geometry optimization calculations of receptors interacting with anions through H-bonds with thiourea protons. The relative Gibbs free energies and enthalpy energies for the receptor-anion interaction were calculated and their values are shown in the Tables S35-S36. It was verified that the Gibbs free energies (Table S35) presented negative values for receptor-anion interactions for the complexes with F − anion. Meanwile the receptor complexes with CN − and AcO − anions showed endergonic, except for compound 2 that showed slightly negative values of interactions with CN − and AcO − (− 0.03 and − 0.04 kcal/mol, respectively). However, the enthalpy energies (Table S36) showed negative values and demonstrated that the strength of interaction between receptors and anions follows the trend F − > AcO − > CN − . This trend is different of the binding energies trend that showed higher binding constants for CN − than AcO − , but this behavior is associated to the H-bonds with thiourea protons and neglect the equilibrium and interactions between anions and solvent as discussed before.
To further investigate the H-bonds between receptors and anions F − , CN − and AcO − were performed AIM analysis of these complexes. The AIM molecular graphs for the receptor-anion complexes are shown in Fig. 16 (Compound 1 interacting with F − , CN − and AcO − anions) and Fig. S11 (compounds 1-6 interacting with F − anion), Fig. S12 (compounds 1-6 interacting with CN − anion), and Fig. S13 (compounds 1-6 interacting with AcO − anion). The AIM properties for BCPs a and b with are relate to the H-bonds with thiourea hydrogen are shown in Table S37. It was observed, through the analysis of molecular graphs, the presence of bond paths, BPs (orange lines), between H atoms (of thiosemicarbazide group) and anions which proved the existence of the H-bond between sensor and anions. The bond critical points, BCPs (tiny orange spheres), of the interaction were labeled as a and b.
The analysis of AIM properties (Table S37) demonstrate that H-bonds (BCP a and b) are non-covalent interactions due the positive values of Laplacian of the electronic density, ∇ 2 ρ(r), a long with electronic density values, ρ(r) < 0.1 a.u. In order to simplify the analysis of H-bonds strength through the AIM properties were performed calculations of binding energy of the H-bonds through the equation presented by Espinosa 59 , that allows to calculate the BE by applying the density of potential energy, V(r), at the BCP. The BE values are shown in the Table 10 and demonstrate a similar behavior to the enthalpy values for receptor-anions interaction. It was observed the same trend of H-bond strength (H-bond stronger between sensor and F − followed by AcO − and CN − , respectively) than verified trough enthalpy energy analysis.
Moreover, other important observation is that compound 4 has higher experimental association constant values than 1. The theoretical calculations (through GRD, hole-electron and Hammet constant analysis) demonstrate that 1 have more electrophilic character than 4, due to the electron-withdrawing effect of -NO 2 group that exerts a withdrawal effect by resonance, which was verified through the hole-electron analyses of excitations with great participation of MO at -NO 2 group. Although, this electrophilic behaviour for 1, the AIM analysis demonstrate that the BCP a, related to the H-bond between anion and the hydrogen that should be deprotonated, has higher BE for 4 (BE = − 13.68 kcal mol −1 ) than 1 (BE = − 12.86 kcal mol −1 ), that should related with higher experimental association constant values for 4 than 1.
This trend observed for compounds 1 and 4, through the theoretical calculations agrees with the experimental 55 , trends presented by Hammett constants(σ m−NO 2 exp = 0.71 and σ p−F exp = 0.06) which demonstrate a higher electron withdrawing of m-NO 2 group (substituent in 1) than p-F (substituent in 4). Thus, the 4 experimental association constants higher than 1 should be related with other effects instead of widespread p-F electron-withdrawing. Overall, the theoretical results indicate that compounds 3 and 6 showed the higher electrophilic character and capacity to interact in the anions which agree with experimental association constants, although all the sensors presented in this work showed a remarkably similar reactivity behavior. Table 9. Equilibrium constants ( K eq ) for compounds 1-6 proton dissociation equilibrium between sensors and anions (F − , CN − , and AcO − ).

Conclusion
In Summary, we have developed new types of cinnamaldehyde (2-nitro & 4-fluoro) sensors 1-3 and 4-6, respectively, for anion sensing based on substituted thiosemicarbazides. These have been characterized by UV-Vis, IR, 1 H NMR, 13 C NMR, and mass and theoretical calculations. The theoretical analysis demonstrates that all receptors 1-6 showed a similar reactivity, although the GRD beyond the analysis of calculated pK a and Hammet constants showed that compounds 3 and 6 showed higher electrophilicity in agreement with experimental association constants. The analysis of proton dissociation equilibrium between 1-6 and anions showed that higher equilibrium www.nature.com/scientificreports/ constants for equilibrium between 1-6 and anions F − , CN − and AcO − . The electronic structures analysis of substituent factors demonstrates that -NO 2 substituent showed a high withdrawing effect than -F substituent which reflected in the excitations of compounds and their nucleophilicity, pK a, and Hammet constants. The presence of -NO 2 demonstrates highlighted influence when the amino group were also a substituent in receptor due to the push-pull effect which increases the electrophilicity of 3. It was observed that the main excitations in 1-6 was π-π* type, however, it was verified that overall n-π* excitations showed lower excitation energies with a large participation of S atom to the excitation. Besides that, compounds 4-6 showed higher participation of the S atom in the excitations due to the influence of -F substituent. It was observed that all receptors 1-3 could recognize fluoride anion in ACN solvent and receptor 4-6 could recognize AcO-and F-in ACN medium. Further, receptor 5 with AcO − and F − has been used to construct a password for molecular keypad lock with AcO − and F − as inputs. Combinatorial sensing was demonstrated as a powerful technique for password protection at the molecular scale. Eleven 3-digit passwords could be authorized by the uni-molecular security system. This work provides new insight into the design of anions sensors for future multifunctional logic devices.

Materials and methods
All the reactions were carried out at room temperature. All chemicals and solvents (HPLC grade) were procured from Merck and were used without further purification. Tetra n-butyl ammonium salts for anions employed for colorimetric analysis were obtained from Sigma Aldrich and stored in a fridge or desiccators until use. Progress of the reaction was followed by thin layer Chromatography. Shimadzu 840/Shimadzu prestige-21 and Bruker alpha FT-IR were used for the measurement of FT-IR spectra of the samples. 1 HNMR and 13 C NMR spectra were recorded using Bruker (Rhenistetten-Forchheim, Germany) AM 300 MHz and 75 MHz spectrometers. MestNova software was used for integration and calculating coupling constants. Deuterated Dimethyl Sulfoxide (DMSO) and Chloroform (Chloroform-d) were used as standards with specific peaks. UV-Visible and fluorescence spectra were recorded using Shimadzu UV-1800 and spectrofluorophotometer Shimadzu RF-6000 respectively. UV absorbance data were recorded in the range from 200 to 800 nm. Absorbance was recorded in quartz cell (1-cm Width). (1-6). General synthesis. The functionalization of receptors compounds 1-6 were carried out in two steps following our previously reported protocol. Briefly, the key thiosemicarbazide based receptor-ligands were prepared by reflux reaction in ethanol and addition of hydrazine hydrate (18 mmol) drop wise in reaction vial containing isothiocyanate (15 mmol) at 80 °C for 1-2 h. The reaction was followed by TLC until completion. Precipitates were collected by placing the reaction mixture in an ice bath and then filtered and washed repeatedly using cold ethanol. In the next step reflux condensation reaction of 2-nitrocinnamaldehyde (1-3) and 4-fluorocinnamaldehyde (4-6) with corresponding thiosemicarbazides in a 1:1 stoichiometry, at 80 °C in ethanol in presence of Hydrochloric acid (0.1 mmol) as catalyst afforded the pure products (Scheme 1).

(E)-4-(2,4-difluorophenyl)-1-((E)-3-(4-fluorophenyl) allylidene) thiosemicarbazide
Florescence studies were carried out using emission spectrum of (4-6) molecules having fluorophore nuclei on both sides of the thiourea moiety. Measurements and pattern analysis. 2-Input chemical passwords. The dependence of the absorption pattern on the sequence of addition was demonstrated by adding 10 equivalents of two different anion to acetonitrile solution of 5 (30 µM, 3 mL) in different orders. The mixture was allowed to equilibrate for about 1 min after each anion addition. Solutions of acetate anion (10 mM) and fluoride (10 mM); Fluoride (10 mM) and Cyanide (10 mM), were used for obtaining the various 2-input chemical passwords. Absorption experiments were performed in three replicates and principal component analysis (PCA) was applied to distinguish between the absorption patterns generated.

UV-visible and fluorescence titration.
3-Input chemical passwords. As a first step toward developing 3-input chemical passwords, solutions of various Anion were prepared (75 µL, 10 mM) and each solution was added separately to a solution of 5 (30 µM, 3 mL) www.nature.com/scientificreports/ in Acetonitrile. Following a 1 min equilibration absorbance spectra were recorded in three replicates and PCA was applied to identify chemical inputs that could potentially be used for obtaining 3-digit chemical passwords, namely, the anions that induced the most distinguishable changes to the absorption patterns.
Principle component analysis. PCA is a non-supervised multivariate exploratory data analysis tool used to reveal the hidden structure within large data sets, to reduce the dimensionality of a complex data set without much loss of information, to extract the most important information from the data, to identify noise and outlier in the data set and to visualize the pattern of grouping based on similarities and dis-similarities in the data. It is also known as a projection method, because it takes information carried by the original variables and projects them onto a smaller number of latent variables called Principal Components (PC). Each PC explains a certain amount of the total information contained in the original data and the first PC contains the greatest source of variation in the data set. The procedure of PCA is based on to convert a set of correlated variables into a new set of uncorrelated variables called principal components. PCA redistributes the total variance of the data set in such a way that the first principal component has maximum variance, followed by second component and so on. The covariance of any of the principal component with any other principal component is zero (uncorrelated) and they are orthogonal to each other. By plotting PCs important sample and variable interrelationships could be revealed, leading to the interpretation of certain sample groupings, similarities or differences.
In this study PCA was applied to classify sensing behavior of a molecular level keypad lock stimulated by two sequential chemical inputs (AcO-and F-), which has potential for application in security devices. In order to build the PCA models UV-Vis absorption spectral data were used data to build the PCA model and model was internally validated, using a leave one out full cross validation procedure using Singular Value Decomposition (SVD) algorithm with 67 segments and total of 7 components.
In order to explore the non-covalent interactions between receptors and anions it was performed AIM (Atom in Molecules) analysis [61][62][63] , by applying the Multiwfn package 64 . The AIM data was calculated with B3LYP-D3/6-311 + G(d,p) method with solvent model SMD (water). In order to obtain a more accurate analysis of the excitations and frontier molecular orbitals (FMO) were performed TD-DFT calculations from the optimized structures of 0 and 1-6 with ωB97X-D3 53 , functional and ma-def2-TZVP 44,54 , basis set with continuum solvent SMD (water) in Orca package (version 4.2.1) 65,66 , were performed and analysis of the global reactivity descriptors (GRD) which were obtained by applying the equations shown below. The GDR analysis is based in FMO that is in the highest occupied molecular orbital (HOMO) and lowest unoccupied molecular orbital (LUMO) energies (in eV) of compounds 0 and 1-6.
To study the excitations in the chemosensors was applied the hole-electron theory [74][75][76] . In this theory the electron leaves the hole and goes to the electron in an excitation. For an excitation that is perfect described as a HOMO → LUMO transition, the HOMO could be described as the hole and LUMO as the electron. However, as   www.nature.com/scientificreports/ for Natural Transition Orbitals (NTOs), commonly the hole and electron are composed by multiple molecular orbitals (MO) contributions with different participation percentages to its representations. The hole and electron distribution could be quantitative characterized through indexes that measure the extension of hole and electron distributions and the separation between them which could be used to evaluate the type of excitation (charge transference, CT, or local excitation, LE). The hole delocalization index (HDI) and electron delocalization index (EDI) measures the breadth of spatial distribution of hole and electron. The HDI and EDI indices showed larger values for concentrate spatial distributions of hole and electron and lesser HDI and EDI indices for delocalized spatial distributions. In a local excitation (LE) the spatial distribution of hole and electron are close. The charge-transfer excitation (CT) has a separation between the hole and electron spatial distribution. The S r index is a measure of the extension of the overlap between hole and electron distribution. A large S r index indicates an excitation of type π-π* while lower S r index indicates a n-π* type of excitation. The D index is the magnitude of charge transference (CT) length that is a measure of the distance between centroid of hole and electron, thus high values of D index reveals a CT excitation. The H index is a measure of spatial extension of hole and electro distribution. The t index measures the separation degree between hole and electron in CT direction. A t index < 0 indicates a small separation between hole and electron due to CT while t index > 0 reveals a substantially separation between hole and electron distribution that indicate a CT excitation. Finally, the Coulomb attraction energy (E coul , also called excitation binding energy between hole and electron) is also related with the excitation type along with D index in which higher D index leads to lower E coul values.
To evaluate the de acidity through pK a values and the influence of -R substituent groups in thiosemicarbazide derivatives were calculate the Hammet constants 77 , in terms of calculated pK a values, beyond that these results were compared with calculated aromatic indices. All this indices were calculated from thermochemical data obtained through the geometrical optimizations with B3LYP/6-311 + G(d,p)/SMD method.
The pK a values were calculated using as reference the work ofThapa and Schlegel 56 , by applying the Eq. (9) below: The compounds 0 and 1-6 was considered as a protonated sensor ( SH ) in a proton dissociation equilibrium in water (simulated through continuum solvent SMD), thus the equilibrium can be written as SH ⇌ S − + H + . Therefore, the by applying the Eq. (10): In which, G * aq (S − ) and G * aq (SH) are the Gibbs free energy of deprotonated and protonated, respectively, chemosensor in water (SMD) and G * aq H + were calculated as demonstrated in the Thapa and Schlegel 56 , work and presented a value of − 270.296808 kcal/mol. The theoretical Hammet constants 77 , were calculated from an adaptation of the Eq. (11) presented in the work of Hansch et al. 78 .
Thus, adapting the Eq. (4) we can write the Hammet constant as the Eq. (12): In our approach in the adapted Hammet Eq. (5), the pK a H is the pK a of non-substituted thiosemicarbazide derivative (compound 0) and the pK a X is the pK a of chemosensors 1-6.