+For making voltage measurements above $V_{cc}$, a voltage divider allows reduction of the voltage at the ADC. By constructing the voltage divider using a variable resistor, the range of measurable inputs could be manually adjusted.
+
+The diodes shown in Figure Figure \ref{fig_ADC_normal} ensure that the ADC is protected from accidental exposure to voltages outside the acceptable range. In normal operation both diodes are off. If $V_{\text{adc}}$ were to become greater than the reference point $V_{cc}$, current would flow between the ADC input and the reference point, acting to reduce $V_{\text{adc}}$ until it reached $V_{cc}$. Similarly, if $V_{\text{adc}}$ fell below ground, current would flow from ground to the ADC input, acting to increase $V_{\text{adc}}$ until it reached ground.
+
+The voltage at the ADC input can be related to the input of the voltage divider using Kirchoff's Voltage Law and Ohm's Law:
+\begin{align*}
+ V_{\text{adc}} &= \frac{R_1}{R_1 + R_2} V_{\text{in}}
+\end{align*}
+Where $V_{\text{in}}$ is the voltage at the input of the circuit, $R_1$ is a fixed resistor, and $R_2$ is variable resistor.
+
+$V_{\text{in}}$ can be therefore be determined from the registered ADC counts by:
+\begin{align*}
+ V_{\text{in}} &= \frac{\text{ADC counts}}{2^{10}} \times \frac{R_1 + R_2}{R_1} V_{cc}
+\end{align*}
+
+\subsubsection*{Differential ADC Input}
+
+During the testing of the TCS experimental apparatus, it became desirable to measure the emission current of the electron gun. The electrometer used for this current measurement was capable of producing an analogue output in the range of $0-1V$. However, the negative terminal of this output was not at ground potential, but rather at the same terminal as the negative input terminal. Directly connecting the electrometer output to one of the ADC inputs discussed above would create a short circuit between the initial energy power supply, and ground (refer to Figures \ref{} and \ref{}). Therefore, it was decided to add a differential stage before the input of one of the ADCs.
+
+Figure \ref{} shows the modification made to the input for ADC5 on the AVR Butterfly. The original voltage divider and input protection discussed above are still present. The modifications include the addition of an instrumentation amplifier, and low pass filters.
+
+The instrumentation amplifier consists of two stages of operational amplifiers (op-amps); input buffers, and a difference amplifier.
+The difference amplifier can be shown using the ideal op-amp model to produce an output voltage proportional to the difference between its inputs:
+
+\begin{align*}
+ V_{out} &= \frac{R_2}{R_1} \left(V_{2} - V_{1}\right)
+\end{align*}
+
+The two op-amps at the inputs to the differential amplifier act as unity gain buffers. Although the output of the unity gain buffer is equal to the input on its positive terminal, the buffer prevents current from flowing from the positive terminal to ground. With the buffer amplifiers absent, a current of: would flow between each of the input terminals and ground.
+
+Instrumentation amplifiers are usually constructed in the schematic shown in Figure \ref{}. In this version, the gain of the amplifier can be changed by altering a single resistor. However, more resistors are required. The version actually constructed was designed based upon the small number of resistors available, within a short time frame. Although the design could have later been changed, this would have been of no real benefit, since there was no requirement to adjust the gain of the amplifier.
+
+In principle, two ADC channels could be used to record the positive and negative outputs of the electrometer seperately, with differencing done in software. However this would require modification to the output cable of the electrometer, which may prove inconvenient for future uses.It was decided that the modification of the cable and added complexity of the software required would be more time consuming than differencing the two inputs using the hardware methods described above.
+
+The low pass filters were added to the inputs of ADC5 after it was found that an unacceptable level of AC noise was being output by the electrometer. The level of noise was too high to be filtered in software, for reasons that will be discussed in Appendix D.
+