Design of CMOS-MEMS based thermoelectric generator