The present study reports on an easy preparation of poly(pyronin Y)/graphene (poly(PyY)/graphene) nanocomposites thin films on indium tin oxide coated glass substrates (ITO). The thin films of poly(PyY)/graphene nanocomposites are prepared by a novel method consisting of three steps; (i) preparation of graphene oxide (GO) thin films on ITO by spin-coating method, (ii) self-assembly of PyY molecules from aqueous solution onto the GO thin film, (iii) surface-confined electropolymerization (SCEP) of the adsorbed PyY molecules on the GO thin film. The as-prepared poly(PyY)/graphene nanocomposites thin films are characterized by using electroanalytical and spectroscopic techniques. Afterwards, the graphene-based polymeric dye thin film on ITO is used as an electrode in an electrochemical cell. Its performance is tested for electrochemical detection of nitrite. Under optimized conditions, the electrocatalytical effect of the nanocomposites thin film through electrochemical oxidation of nitrite is better than that of GO coated ITO. (C) 2016 Elsevier Ltd. All rights reserved.