Due to its unique electronic properties and wide spectrum of promising applications, graphene has attracted much attention from scientists in various fields. Control and engineering of graphene's semiconducting properties is considered to be key to its applications in electronic devices. Here, we report a novel method to prepare in situ nitrogen-doped graphene by microwave plasma assisted chemical vapor deposition (CVD) using PDMS (polydimethylsiloxane) as a solid carbon source. Based on this approach, the concentration of nitrogen-doping can be easily controlled via the flow rate of nitrogen during the CVD process. X-ray photoelectron spectroscopy results indicated that the nitrogen atoms doped into the graphene lattice were mainly in the forms of pyridinic and pyrrolic structures. Moreover, first-principles calculations show that the incorporated nitrogen atoms can lead to p-type doping of graphene. This in situ approach provides a promising strategy to prepare graphene with controlled electronic properties.