A compass needle is placed in the gap of a parallel plate capacitor. The capacitor is connected to a battery through a resistance. The compass needle
while the capacitor is charging, electric field between the plates of the capacitor is varying, as a result a magnetic field is produced which causes the deflection in compass needle and then comes back slowly.