Silver doped LiFePO4 powder was synthesized using the hydrothermal method, and was used as a sensing material. An Optical WaveGuide (OWG) sensor which reacted to Volatile Organic Compound (VOC) was developed by spin-coating a thin film of LiFe0.99Ag0.01PO4 onto a Tin-diffused glass optical waveguide. This OWG sensor was used to detect formaldehyde gas as a typical example of VOCs. The experimental result showed that the sensor easily and repeatedly detected 100ppt of formaldehyde, with a short response time (less than 2 s). At the low concentration (below 10ppm), the volatile organic compounds caused no interference with the detection of formaldehyde vapor. The sensor also had the characteristics of high sensitivity, a simple structure, and easy fabrication.