Studying and tailoring the properties of nanomaterials for energy harvesting and sensing applications