## 2 Materials and Methods
### Electronics  
Most of the educational AFM systems [18; 19; 20] use a commercially available photodiode detector for measurement of cantilever deflection. For educational purposes and further cost reduction, the electronic module for signal conditioning is custom-built for our AFM setup. The function of the signal conditioning module is to convert the photo-induced currents from the photodiode into voltage signals, followed by producing a voltage signal that is proportional to the differences in the light intensities between the upper and lower segments of the photodiode. These functions can easily be implemented using common components such as operational amplifiers (op-amp), resistors, and capacitors from the undergraduate electronic laboratory. The 741 op-amp, one of the most commonly used electronic components in laboratory classes, is used extensively in our signal conditioning module.  
A four-quadrant photodiode (Hamamatsu: s5980) with an active area of 5 mm \(\times\) 5 mm is used in our design. A thin package of 1.26 mm makes it an ideal choice to be used in the OBD setup in the developed AFM. For the signal conditioning module, different configurations are used with the op-amps to achieve different operating modes. These include a current-to-voltage converter, a voltage follower, an inverting summer and differential amplifier. The full circuit diagram of the signal conditioning module is illustrated in Figure 3. In general, the circuit can be divided into four stages. At the first stage of the circuit, four current-to-voltage converters are required to convert the currents from the segments of the four-quadrant photodiode. The converted voltage signals are then fed into the voltage followers, which make up the second stage of the circuit, acting as isolation buffers. At the third stage of the circuit, the op-amps are used as inverting summers. Four op-amps are used here to add up signals originating from the photodiode. For example, voltage signals from the top-right segment and the top-left segment of the photodiode are summed together. Voltage signals from the bottom-right segment and the bottom-left segment of the photodiode are added up. The last stage of the circuit is comprised of two differential amplifiers and an inverting summer. The first differential amplifier is responsible for computingthe deflection signal by taking the difference between the top and bottom segments. The second differential amplifier calculates the lateral signal from the difference between the left and right segments. The inverting summer calculates the summed signals from all segments (top-left, top-right, bottom-left, and bottom right). The test results of this module have been presented and discussed previously [22]. Figure 4 shows the printed circuit board of the signal conditioning module.  
Figure 4: Printed circuit board of the signal conditioning module.  
Figure 3: Full circuit diagram of the signal conditioning module. The circuit consists of four stages: current-to-voltage converters, voltage followers, inverting summers, and differential amplifiers. The outputs of the circuits are the deflection signal, summation signal, and lateral signal.