8: Example 2. Amplifying a signal from a sensor when it has an offset voltage
Many common sensors will produce a voltage that does not "sit" on the 0V rail, as shown in the blue line in this example.
The green signal is too small (say 0.04V) to measure with any accuracy; however by amplifying it by 100 we get a signal of around 0.04*100 = 4V that can be measured.
However the signal on the blue line is small, but has a dc offset of about 2.5V; multipling that by 100 gives a 25V signal that still can't be measured. If the DIFFERENCE between the signal and a fixed offset (the orange line) is amplified it gives a nicely measurable signal. The amplification (or gain) and offset can be adjusted to suit your particular sensor.
I used a hall effect sensor A1302 for my own experiment, to look for small changes in magnetic field. It gives a bidirectional voltage output biased to Vcc/2. Load cells used for weighing give similar outputs. The sensor is shown in the diagram below as a pair of thermistors (you could use those, or light dependent resistors)
The above diagram was produced using "Circuit Diagram"
How it works
The sensor gives an output near 2.5V (V1); A divider chain gives an adjustable voltage V2 so the offset can be "nulled out". Then the difference amplifier, consisting of the op amp, resistors r1 and r2 amplifies the voltage difference between points A and B, and passes it to the analog input of the arduino.
The gain of the amplifier is R2 / R1 so in the diagram its 10M / 100k = 100 times. You can change the value of the r2 resistors to give the gain you require for your own project. 1M for a gain of ten would perhaps be a good start.
If the sensor gives a negative voltage difference the connections to points A and B can be reversed to provide a positive voltage at the output.