In IoT (Internet-of-Things) era, the number and variety of hardware devices become continuously increasing. At that time, if an attacker can directly modify a hardware device and insert a malicious circuit into it, we may face severe security risk. The malicious device normally sleeps and is separated from the original hardware device. It can be rarely activated and works as a malicious function. Capacitance measurement is one of the very powerful ways to detect a malicious device. Particularly, measuring capacitance while the hardware device is running is a major challenge but there exists no such researches proposed so far. This paper proposes a capacitance measuring device which measures device capacitance in operation. We firstly combine the AC (alternating current) voltage signal with the DC (direct current) supply voltage signal and generates the offset signal. We supply the offset signal to the target device instead of supplying the DC supply voltage. Then it is theoretically shown that, by effectively filtering the observed current in the target device, the filtered current can be proportional to the capacitance value and thus we can measure the target device capacitance even when it is running. We have implemented the proposed capacitance measuring device on the printed wiring board with the size of 100mm × 81.3mm and applied to the hardware device with a small malicious device. The experiments demonstrate that the proposed capacitance measuring device successfully detects the malicious hardware installed on the original hardware device.