This paper presents an anomaly detection approach with non-invasive on-chip temperature sensing for hardware Trojan detection, which is coupled with a proposed anomaly detection technique using an autoencoder-based machine learning (ML) algorithm. In a case study, the developed algorithm identifies the Hardware Trojan with over 90% accuracy for a Trojan power consumption that is as low as 2.5% of the circuit under test. Besides identifying the Trojan, the algorithm can also provide information about the location of the Trojan on the chip. The proposed on-chip anomaly detection approach with machine learning is under development as a solution for enhanced hardware security in modern electronic systems, particularly for Internet of Things applications.