In this work we investigated the encapsulation of C20 and C30 fullerenes into semiconducting carbon nanotubes to study the possibility of bandgap engineering in such systems. Classical molecular dynamics simulations coupled to tight-binding calculations were used to determine the conformational and electronic properties of carbon nanotubes with an increasing fullerene concentration. We have observed that C20 fullerenes behave similarly to a ntype dopant while C30 can provide p-type doping in some cases. The combined incorporation of both types of fullerenes (hybrid encapsulation) into the same nanotube leads to a behaviour similar to that found in electronic pn-junctions. These aspects can be exploited in the design of nanoelectronic devices using semiconducting carbon nanotubes. © 2007 IOP.Publishing Ltd.