Carbon and TiO2 based electrodes with metal alloy electrode for self-powered detection of water