In previous studies, experimentally measured resonance frequencies of carbon nanotubes have been used along with classical beam theory for straight beams. However, it is found that these carbon nanotubes are not straight, and that they have some significant surface deviation associated with them. This paper deals with the nonlinear vibration analysis of a wavy single-walled carbon nanotube based mass sensor, which is doubly clamped at a source and a drain. Nonlinear oscillations of a single-walled carbon nanotube excited harmonically near its primary resonance are considered. The carbon nanotube is excited by the addition of an excitation force. The modeling is carried out using the elastic continuum beam theory concept, which involves stretching of the central plane and phenomenological damping. This model takes into account the existence of waviness in carbon nanotubes. The equation of motion involves two nonlinear terms due to the curved geometry and the stretching of the central plane. The dynamic response of the carbon nanotube based mass sensor is analyzed in the context of the time response, Poincaré maps, and fast Fourier transformation diagrams. The results show the appearance of instability and chaos in the dynamic response as the mass on carbon nanotube is changed. Period doubling and mechanism of intermittency have been observed as the routes to chaos. The appearance of regions of periodic, subharmonic, and chaotic behavior is observed to be strongly dependent on mass and the geometric imperfections of carbon nanotube. Poincaré maps and frequency spectra are used to elucidate and to illustrate the diversity of the system behavior.