Herein, a novel imprinted sol–gel electrochemical sensor based on multi-walled carbon nanotubes (MWNTs) doped with chitosan film on a carbon electrode has been developed. Prior to doped, the MWNTs have been decorated with Fe 3 O 4 nanoparticles which have been coated uniformly with SiO 2 layer. The characterization of imprinted sensor has been carried out by X-ray diffraction and scanning electron microscopy. The performance of the proposed imprinted sensor has been investigated using cyclic voltammetry and differential pulse voltammetry. The imprinted sensor offers a fast response and sensitive benzylpenicillin quantification. The fabricated benzylpenicillin imprinted sensor exhibits a linear response from 5.0×10 −8 to 1.0×10 −3 molL −1 with a detection limit of 1.5×10 −9 molL −1 . For samples analysis, perfect recoveries of the imprinted sensor for benzylpenicillin indicated that the imprinted sensor was able to detect benzylpenicillin in real samples successfully.