A temperature compensation methodology for piezoelectric based sensor devices