Switchable materials have tremendous potential for application in sensor development that could be applied to many fields. We are focusing on emerging area of wireless sensor networks due to the potential impact of this concept in society. Spiropyran-based sensors are probably the most studied type of photoswitchable sensing devices. They suffer from many issues but photofatigue, insufficient selectivity and lack of sensitivity are probably the most important characteristics that hinder their wider application. Here, we are address these issues and demonstrate that covalent attachment of modified spiropyran into a polymeric film significantly reduces photodegradation. The observed signal loss after 12 th cycle of switching between the spiropyran and merocyanine forms is only about 27% compared to the loss of 57% of the initial signal in an equivalent experiment based on nonimmobilized spiropyran. This has enabled us to demonstrate at least 5 reversible cycles of detection of an ion of interest (in our case H + ) with minimal signal loss. Furthermore, we demonstrate that the sensitivity can be increased by incorporation of additional binding groups in the parent spiropyran molecule. Using molecular modeling to calculate the relevant bond lengths as a measure of interaction between MC and H + , the calculated increase of H-bond strength is approximately an order of magnitude for a derivative containing a methoxy group incorporated in the o-position of the parent spiropyran in comparison to the equivalent unsubstituted phenol. This theoretical result was found to correspond very well with experimental observation. As a result, we have increased the sensitivity to H + by approximately one order of magnitude.3