In this work, we report the development of a low-cost attachment to a commercial cell phone that transforms the phone into a visible-light spectrometer for educational applications.The emission of a visible light source is readily detected and characterized by using the phone camera and a freeware application for Android mobile devices, PhysicsSensor Mobile Edition.The spectrometer has a 350 nm bandwidth with a spectral resolution of 5 nm, which can be achieved through the calibration module that takes as reference the central wavelengths of a couple of LEDs whose emissions are blue and red.We demonstrate the functionality of the system by analyzing the emission spectrum of a sodium flame, a commercial sodium lamp and a commercial mercury lamp.We envision the devices to have immediate relevance in the educational field.