I've recently built some fiber-optic bend sensors and I want to read the values I get from them into a computer via an Arduino. I'm measuring the light with this photodiode from Industrial Fiber Optics. Currently, I'm giving the LED on the other end as well as the photodiode 2.2V. My question has to do with the fact that the voltage fluctuations as measured by a multi-meter on the photodiode are linear, but rather small as the fiber is deformed, even quite radically. With the fiber straight, depending on the fiber (its hard to score them identically), the voltage hovers around 1.92V, for instance, and with bending it will it will go up to, say, 1.93-1.94V. I'm not worried about getting the voltages identical as I can scale in software.

What I am worried about is losing resolution when doing A/D with the Arduino. If my voltage fluctuations are on the order of 10mV, won't the Arduino's 10-bit A/D quantize the hell out of it, even if I step the voltage up to 5V with a voltage divider? What I'm looking for is an analog scaler. How can I stretch out that range between 1.92 and 1.94 to cover the full range, from 0V to 5V so that I can take advantage of the full range of the Arduino A/D?

I feel like this has got to be a common operation in electronics, but I've never studied it formally, so a lot of things are lost on me.

(You may be thinking, as davr was, "why are you using fiber optics for bend sensing? Why would you expect a voltage change when the fiber is bent?" The trick is to remove the cladding on one side of the fiber optic cable. This lets light spill out. When the cable is bent away from the scoring, even more light is let out of the cable, causing a voltage drop in the receiver, and vice versa.)

• Would you be so kind as to show a schematic of your receiver? Are you supplying the bias voltage of 1.9 V? – endolith Dec 17 '09 at 17:22
• If you mean the schematic for the receiver itself, I linked to the datasheet above. Here it is again: i-fiberoptics.com/pdf/IFD91.pdf If you mean how I have it hooked up, you can see in the photograph. The receiver is the black one. I'm giving it 2.2V (though, in the photo it's an li-ion battery) through the red wire to the side of the receiver with the orange dot, and I'm measuring the voltage across the resistor that goes to ground on the other side. – terrace Dec 19 '09 at 7:55

So if I understand correctly, you want to be able to "read" a 10 mV variation on top of a 1.9V signal?

If that is the case then I would suggest two separate stages. The first will be a photodiode amplifier (page 9 is the most standard of circuits). This will help to get the current from your photodiode translated into voltage.

The second stage will be an instrumentatation amplifier, such as the INA family from Texas Instruments (the best but also can be expensive). This will help to remove your "common mode" signal, which in this case is the 1.9 V. You can also add gain in to the instrumentation amp or alternately add a simple op amp in a non-inverting configuration at the end to help gain your signal up to the necessary 5 V.

I'm not saying it'll be perfect, but I think that's a good start.

As a final note, I like David's idea above about the clamps, even though those can cause some measurement errors at the A/D converter. What is more important though is if you can swing it, try a better op amp than the 741. Those are common but the specs are terrible. The 3 or 4 mV of offset voltage at the input terminals could really mess up a small signal like you're trying to measure.

~Chris Gammell

• You don't need an instrumentation amp. A simple diff amp will do. You need a constant 1.9 V supply to use as your reference, though. I'm guessing something like this already exists in the circuit as the bias for the sensor. It would help to have a schematic. Also, after removing the bias, you need to re-add another bias to get it between the 0 and 5 V range of the ADC. – endolith Dec 17 '09 at 17:23
• I agree that you don't NEED one, but it's a good idea. An instrumentation amp is just a diff amp with buffers before it (sometimes with added resistors for gain). If you just use a diff amp, you're at the mercy of the resistors in your diff amp; sometimes as low as 1K. If he's trying to measure something, that high impedance (from the buffers of an iAmp) can really help (i.e. no current flow into the measurement device). – Chris Gammell Dec 17 '09 at 19:08

Signal conditioning in this sense is extremely common. You want to use an amplifier in order to make that 10mV range span (for example) the entire 0-5V range of the arduino. This can be done using op-amps such as the LM741. You'll proabably also want to use a "voltage clamp" (ex: two zener diodes) on the output of your signal conditioner/input into the ADC to make sure that the value does not exceed 5V. If you look around online at op-amp data sheets and/or signal conditioning circuits, you should find guides as to exactly what you are looking for.

Suggest you look at the combination of a differential PGA (programmable gain amplifier) and a DAC, with the sensor output going to the "+" input and the DAC going to the "-" input. (Or something integrated that gives you equivalent functionality.) Basically, look at the signal with low gain, figure out what its offset is, put that voltage on the DAC, and crank the gain up.

TI's PGA308 looks like it might be a nice solution.

If you want a less expensive solution, use a fixed-gain differential amplifier (the standard 4-resistor + op-amp would do) + a stable, quiet 8-bit DAC (stability/noise characteristics more important than accuracy), again put the sensor output on the "+" input to the diff amp and the DAC output on the "-" input.

Exercise for the reader: show that you can bring the diff-amp output out of saturation and into a linear range by using a binary search technique with the DAC, and ensuring that the gain is not larger than G1 = the fullscale ADC input voltage, divided by the sum of the DAC's nominal step size and its DNL (differential nonlinearity). I'd probably use the smaller of (G1/2) and G2, where G2 = the fullscale ADC input voltage divided by the sensor output voltage range that you care about.

• Far too ambitious for me at the moment given time constraints, but thanks for the suggestion. I'm excited to dive further into analog signal conditioning for future prototypes. – terrace Dec 10 '09 at 8:37
• Why do you need a DAC? You're just generating a DC offset with it? That seems rather overkill. – endolith Dec 17 '09 at 17:21
• Yeah. The DAC was predicated on the assumption of having to change the DC offset over a wide range. If you have a system with voltage spanning only a narrow range, (assuming you've done your tolerance analysis right) then a resistor divider and a reference may be adequate to produce an offset voltage. Or for a little more complexity, a resistor network + multiplexers (which is what some DACs are). A DAC isn't really that complicated or expensive a device, if you don't need ultra-high speed or ultra-fine resolution. – Jason S Dec 17 '09 at 18:38

Using fiber optics as a bend sensor might be a poor choice, isn't the whole point of fiber optics to easily allow you to bend light around corners with minimal loss?

• Yes, but if you strip the jacket and lightly scrape off the cladding on one side with a razor blade, the amount of light that gets through will vary as you bend the fiber. A nice feature is that you get a bi-directional signal. If you bend away from the scoring, less light gets through, if you bend toward it, more light gets through. You would have to use two traditional bend sensors to get that. They also look cool. – terrace Dec 9 '09 at 6:29

You need two things: to use a differential input to compare against a 1.9v standard (or close to it), and an amplifier to increase the resolution of that difference.

For the best results you should use external high quality instrumentation amps or op amps. But you could try using facilities built into the microcontroller. The Arduino Mega (ATMega2560 chip) and Arduino Leonardo both include the option for differential, amplified inputs to the ADC right on the chip. (The Uno does't have this). An ATMega2560 could do multiple channels (multiplexed) of amplified differential ADC for multiple sensors - read the datasheet to see which pin combinations are possible. It has a 200x amplification option, which would put the full 1024 step resolution across 25 mv. You just have to position that 25 mV window where you need it!

That may or may not be sufficiently noise free for your purposes - it's not as high quality as you could build externally for more .

The harder part may be getting a stable and accurate 1.9v reference to compare against.

• Came here to say this. +1! – Nick Johnson Dec 17 '14 at 16:59