The present study introduces a modified approach to synthesize polyaniline (PANI) and polypyrrole (PPy) doped with graphene oxide (GO) or graphene (GN) through an in situ emulsion polymerization (EP) technique. Dodecyl benzene sulfonic acid (DBSA) was used as a surfactant and doping agent as well during the polymerization reaction. The morphology and microstructure of the synthesized polymers and their nanocomposites were studied by scanning electron microscopy, transmission electron microscopy, Fourier transform infrared spectroscopy, X‐ray photoelectron spectroscopy, and thermogravimetric analysis. All of these characterization techniques confirmed the superior morphology and thermal properties of the nanocomposites. The electroconductive properties of the synthesized polymers and their nanocomposite pellets containing 5 wt% of either GN or GO pressed at pressures of 2, 4, and 6 tons were investigated with a four‐probe analyzer. Nanocomposites showed very high electrical conductivity compared to individual PANI and PPy samples pressed at the same pressures. The addition of GO and GN not only improved the thermal stability but also significantly enhanced the electrical conductivity of the nanocomposites. Thus, the present work signifies the importance of the direct loading of GO and GN into conductive polymers during the EP process using DBSA as a surfactant to achieve nanocomposites with promising properties for various semiconductive applications. POLYM. COMPOS., 39:2142–2150, 2018. © 2016 Society of Plastics Engineers