Smart coating to protect oil pipes