Pyrene and long-chain alkanes were linked through bisquaternary functionality in the sensor which could interact with heparin via supramolecular assembly.