A pentaquinone based compound 3 has been synthesized which works as a selective and sensitive chemodosimeter for mercury ions via Hg2+ promoted hydrolysis of an imine linkage to generate a fluorescent change in mixed aqueous media.