We theoretically propose a switching device that operates at room temperature. The device is an in-plane heterostructure based on a periodically boron-doped (nitrogen-doped) armchair graphene nanoribbon, which has been experimentally fabricated recently. The calculated I-V curve shows that for a realistic device with interface width longer than 20 nm, nonzero electric current occurs only in the region of bias voltage between -0.22 and 0.28 V, which is beneficial to low-voltage operation. Furthermore, in this case, the electric current is robust against the change of the potential profile in the interface since the metallic impurity-induced sub-bands with delocalized wave functions contribute to the transmission exclusively. This also suggests the high response speed of the proposed device. We also discuss the temperature dependence, the output impedance, the effect of phonons, and the possible regimes to extend our work, which suggest that our model may have potential room-temperature nanoelectronics applications.