While conducting qualitative tests for identification of cations in the given salt, I encountered this unexpected temperature change. Following are the steps of tests:
Step 1: We made an aqueous solution of the salt and added dilute hydrochloric acid. There was no precipitate, which showed that Group 1 cations ($\ce{Pb^2+}$) are absent.
Step 2: We then divided the solution into two parts, and through one part, passed $\ce{H2S}$ gas. There was no precipitate, which showed that Group 2 cations ($\ce{Cu^2+}$) were absent.
Here, the temperature of the solution through which we passed the gas, rose above the room temperature. It could be easily felt while holding the test tube.
Step 3: To the other part in the test tube, we added $\ce{NH4Cl}$ to make the solution completely alkaline, and then added $\ce{NH4OH}$ till the solution was ammoniacal. We did not get any precipitate, which showed that Group 3 cations (viz. $\ce{Al^3+}$, $\ce{Fe^2+}$ and $\ce{Fe^3+}$) were absent.
It is here that we encountered the temperature change. Before adding $\ce{NH4Cl}$, the solution was at room temperature. However, as we kept on adding $\ce{NH4Cl}$ to make the solution saturated and alkaline, the temperature of the solution went down considerably. After some time, it was so cold that water molecules in the atmosphere had started to condense on the outer side of the test tube. The temperature still went down when we added $\ce{NH4OH}$.
Step 4: Now we divided the solution into two parts and through one part, passed $\ce{H2S}$. We got a white precipitate, indicating the presence of Group 4 cation ($\ce{Zn^2+}$).
It must be noted here that as soon as we passed the $\ce{H2S}$ gas, the temperature of the solution again increased to room temperature.
Step 5: To the other part of the solution, we added $\ce{(NH4)2CO3}$. We got a white precipitate, which indicated that Group 5 cations (viz. $\ce{Ba^2+}$, $\ce{Sr^2+}$ or $\ce{Ca^2+}$) was present.
It must be noted that the temperature remained almost same now.
Later, by confirmatory tests, we determined the salts to be $\ce{Ca(CH3COO)2}$ and $\ce{ZnSO4}$.
Can anyone explain what chemical reactions had occurred which were exothermic and endothermic, thus resulting in a change in temperature of the solution?