One of the peripherals missing in the Raspberry Pi is an analog-to-digital converter (ADC). One low-cost solution is an 8-bit ADC peripheral based upon the PCF8591 chip. You can purchase the bare chip on eBay for about $1.50, but for about 10 cents more, you can get the assembled YL-40 PCB.
This chapter will explore the PCF8591 ADC and the Linux I2C device driver for it. While the driver source code exists in the kernel source tree, it is not likely compiled into your Raspbian release. Even when installed, there are a few simple things you need to do to get the driver operating. Using the Linux driver ...