# Photodiode-LED Servo

2,160

23

1

This fun circuit adjusts the brightness of an LED as it is moved in relation to a photodiode so that the photocurrent produced remains constant. Themes from this circuit can be used for a variety of applications. For example, instead of powering a LED, the circuit could adjust window shades to allow a certain amount of light in over the course of the day. By changing the input to a thermistor and the output to a heating source, as the temperature cools, the heater could compensate. These types of circuits are great for stabilizing a mechanism in unpredictable and varying environmental conditions.

This relatively simple circuit only requires understanding of op-amps, photodiodes, and basic applications of Ohms law. This is an example of a servomechanism or “servo”; a system that utilizes the power of a negative feedback loop to correct its output or action with a change in input. This instructable will cover the construction of such a circuit and highlight key points to consider.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: Components

Components:

4 Op-Amps

4 100 K resistors

1 1.5nF capacitor

1 Photodiode

1 LED

1 1K Potentiometer

+15V power supply

## Step 2: Construction

In general this circuit is constantly comparing the signal from the photodiode with a signal that you determine and adjusting output voltage to the LED to make these two signals equal. This circuit can best be understood by compartmentalizing its different functions.

The top branch associated with the photodiode, the op-amp, R1, and R2 establishes Vphoto, the signal coming from the photodiode. Note, that this voltage will be negative because current is flowing from +15V to ground, and then must drop over R1. Using a larger resistor will lead to a more negative V photo that is easier to work with.

The bottom branch associated with the potentiometer and R4 is where you set and adjust your baseline voltage Vset. The potentiometer is simply a voltage divider and the op amp is a follower that stabilizes Vset.

Now, if you analyze the way Vphoto and Vset are connected in conjunction with R5 and the capacitor, you will recognize the summing section. Here, -Vphoto and V set will produce current proportional to their voltage due to the fact that R3=R4, these currents will add at the intersection, and this current will then drop over R5. It is important to remember that with such a design, the output of these types of summers are –(A+B). Therefore, this voltage is –(-Vphoto+Vset) or Vphoto-Vset as indicated on the illustration. Here, the capacitor acts as a low pass filter with a 3dB point of 1KHz to reduce the affect of flickering lights from the laboratory affecting the photodiode.

The final portion of this circuit is where the servoing takes place. To understand servoing, one must understand negative feedback. This is used for mechanical, biochemical, and many other applications. It simply means that the output of a system opposes the early stages of the same system. As mentioned above, the purpose of this circuit is to keep Vphoto equal to Vset, or in other words, Vphoto - Vset = 0. Now, because the output voltage influences Vphoto – V set at the inverting input of the final op-amp, this is a form of negative feedback. When the op-amp is negatively feeding back, it will adjust its output voltage so that the two inputs are equal. Because the non inverting input is ground, the circuit will modify the output LED voltage until Vphoto-Vset=0 and the system is stable.

It is important to note that once you try testing your circuit, just because the LED dims as it nears the photodiode, it does not mean that your circuit is servoing properly. The best way to confirm that your circuit is working is to use an oscilloscope to measure Vphoto-Vset and make sure that it stays at zero as the LED changes proximity to the photodiode. The fact that Vphoto, and Vphoto-Vset are readily available and easy to measure is one of the advantages of this setup.

## Step 3: Conclusion

This is a specific type of servomechanism that can be adapted to suit the designer’s needs. Changing the input and output types can allow this circuit to be used for a variety of purposes as its own unit or as a portion of a larger design. Now it’s up to you to get creative!

## Recommendations

• ### Large Motors Class

13,112 Enrolled

## Discussions

Thanks for taking the time to share your idea! I love learning new things like this.