Graphene–boron nitride–graphene (h-NSHs) heterostructures can be used for discriminate sensing of 2,4-dinitrotoluene (DNT), octahydro-1,3,5,7-tetranitro-1,3,5,7-tetrazocine (HMX), pentaerythritol tetranitrate (PENT), and 2,4,6-trinitrotoluene (TNT) molecules.