Electron energy-loss spectroscopy (EELS) has been used to characterize the electronic structure of charcoal phases at the nanoscale, thus demonstrating that the technique can be applied to environmental science. Activated charcoal is extensively used to remove pollutants from liquid and gaseous sewage. It is mainly obtained by activation of coke or charcoal produced from ligneous precursors. The present study concerns the use of by-products of local Caribbean agriculture, such as sugar cane bagasse, fruit stones and seeds, for use as activated charcoal precursors. Charcoal phases are prepared by high-temperature pyrolysis of lignocellulosic raw materials under a nitrogen gas flow. With the aim of optimizing the pyrolysis temperature and duration and oxygen content, the concentration of carbon sp2 hybridized chemical bonds and structural ordering have been followed by EELS for different treatment temperatures. To quantify the carbon sp2 content, near edge structure (NES) at the carbon K edge has been measured to determine the strength of pi --> pi* and 1s --> pi* transitions. Three precursors of plant origin, shells of Terminalia catappa and Acrocomia karukerana and seeds of Psidium guajava, with the pyrolysis temperatures between 600 and 900 degrees C, were investigated. The fraction of carbon sp2 bonding is found to increase when the temperature rises from 600 degrees C to the range 700-750 degrees C and becomes stable at higher temperatures. For temperatures in excess of 700 degrees C, structural ordering probably occurs and well-defined 1s --> sigma* NES is present, whose intensity increases with increasing preparation temperature. For the highest temperature of around 900 degrees C, the structure of the final product is less well organized than graphitized carbon but a few per cent of a highly ordered phase is found.