Environmental as well as economic factors are pushing forward the development of sensors and technologies for precision farming practice. Selective application of herbicides requires information on the location of weeds in the field. In this work, a sensor for automatic detection of weeds in the field was developed and tested. Visual detection of weeds requires discnmination between soil and plants, as well as discrimination between crop and weeds. The developed sensor was based on a multispectral imaging system in the range of 500-1000 nm. An electronically tunable filter (Acousto-Optic Tunable Filter - AOTF) was coupled with a high-resolution black and white CCD camera and a frame grabber. The developed sensor was mounted on a mobile platform and a large database of images was constructed by acquiring images of cotton plants and weeds in their early stage of development. Images were acquired from 500 to 1000nm in 5nm increments. Images were then analyzed and characteristic features of cotton plants and weeds were calculated. Weed detection was based on spectral reflectance properties of their leaves.