This paper reports a new type of nanocomposite of poly(nile blue A) with single-walled carbon nanotubes (PNb–SWNTs). This nanocomposite was fabricated by the functionalization of SWNTs with poly(nile blue A), which was formed by electropolymerizing an Nb monomer through the use of cyclic voltammetry. Scanning electron microscopy (SEM), ultraviolet–visible spectroscopy (UV–vis), cyclic voltammetry and electrochemical impedance spectroscopy (EIS) were used to characterize the PNb–SWNTs. The cyclic voltammetric results indicated that PNb–SWNTs were able to electrocatalyze the oxidation of NADH at a very low potential (ca. −80mV versus SCE) and lead to a substantial decrease in the overpotential by more than 700mV compared with the bare glassy carbon (GC) electrode. A biosensor, ADH–PNb–SWNT/GC, was developed by immobilizing alcohol dehydrogenase (ADH) onto the PNb–SWNT/GC electrode surface. The biosensor showed electrocatalytic activity toward the oxidation of ethanol with a good stability, reproducibility, and higher biological affinity. Under optimal conditions, the electrochemical response to detect ethanol has the typical characteristics of Michaelis–Menten kinetics with an apparent Michaelis–Menten constant of K M app ∼6.30mM, and depends linearly on the concentration of ethanol from 0.1 to 3.0mM (with a correlation coefficient of 0.998), with a detection limit of ∼50μM (at a signal-to-noise ratio of 3). The facile procedure of immobilizing ADH used in the present work can promote the development of electrochemical research for enzymes (proteins), biosensors, biofuel cells and other bioelectrochemical devices.