Problem with Photodiodes
Working with photodiodes can present a computational problem to the circuit designer. The following provides a detailed illustration of this problem.
Photodiodes take light energy and convert it to electric potential similar to photovoltaic cells. An equation that may be used to describe the relationship of the light brightness to the voltage produced is:
Voltage Produced = Maximum Voltage * [1-e-brightness]
The purple line in the graph shown above illustrates the voltage output function of a photodiode where the maximum output voltage is 3 millivolts. (NOTE: THIS MODEL APPLIES ONLY FOR THE POSITIVE DOMAIN.) Notice the line symmetry about y=x between the voltage output function and its inverse. All 2d functions which have inverses demonstrate this same symmetry about y=x.
We will use the inverse function shown above, the curved dotted line and the blue y(x) shown in the bottom right, to transform our voltage output values to a linear , straight line, function. This is a beneficial transformation to apply for many applications involving photodiodes.
Problem with Servos
Working with servos can present a computational problem to the designer. The following provides a detailed illustration of this problem.
A servo is an electrical component with a drive axis that turns to a specific angle based upon the voltage input through a yellow signal wire. Inside is an electrical motor and gears that reduce the speed of rotation but increase the ability turn larger arms or wheels. A programmable controller such as an Arduino is commonly used to send signals to the servo, telling it to go to specific angles. The problem lies in the fact that most servos are slightly different in their responses to signal values. The Arduino Servo library has a write() function which takes an angle as an argument. Ideally, sending a message like myservo.write(45) would result in the servo rotating to an angle of 45 degrees. However, in reality, the result is most always not 45 degrees. In fact most servos have a unique maximum value that will send the arm to 0 degrees and a unique minimum value that will send the arm to 180 degrees. Most all servos will respond in a linear fashion between those two values so a simple linear mapping (transformation) is all that is required.
An Exercise in Fixing these Two Problems
An Arduino application containing both a photodiode and a servo may benefit from an application of both the mentioned transformations. Below is a link to a Desmos.com/123d.circuits.io activity addressing this very concern.