Analog to Digital convertor using capacitor
Use two GPIO pins, alternate between input and output mode

Steps:

Discharge the capacitor

Charge one known resistor 

Discharge capacitor

Charge the UNKNOWN resistor (the sensor)

http://www.doctormonk.com/2013/12/analog-sensors-without-analog-inputs-on.html

Use GPIO as input mode to detect the charge up reaching theshold (about mid point voltage) 

This technique allow simple low cost MCU without build in ADC to read analogue sensor (variable resistance depending on sensed quality), including temperature (thermistor), humidity, light (CdS), force, etc.  

Good absolute accuracy if the known resistor is high accuracy. Tolerance of capacitor is cancel out.   

Widely used in consumer electronics device. Have excellent resolution, can be up to 16 to 20 bits or so. Typical conversion time in range of 100ms.  Faster conversion can be traded with smaller resolution. Can use MCU hardware timer.

Raspberry Pi (vs Arduino) has no build in ADC and this technique is often used.

One pin version, lower absolute accuracy as affected by capacitor tolerance.
http://www.raspberrypi-spy.co.uk/2012/08/reading-analogue-sensors-with-one-gpio-pin/

Also, three pin version, use one pin for sensing (input mode) and quick discharge (output), for quicker conversion time.