Robust Arduino controlled spin coater using a novel and simple gravity chuck design

Graphical abstract


Hardware in context
Spin coating is a widely used process for the deposition of uniform thin films on flat substrates from a precursor solution. The technique is common for fabricating thin films of photovoltaic materials, small organics molecules, polymers, nanoparticles, metal oxides, etc. [2][3][4]. A substrate is mounted on the spin coater then a liquid precursor is applied to cover the substrate. The spinning process drains precursor solution from the substrate using centrifugal force, while viscosity and surface tension restrict this process [5]. The film thickness and quality is affected by rotational speed, atmosphere, solvent evaporation, the rheology of the precursor, and surface wetting of the substrate [2,5].
Commercial spin coaters are most commonly available with either gravity or vacuum chucks to mount the sample. A vacuum chuck exposes a sample to a low vacuum through an opening in the sample chuck. The size and shape of the chuck varies, with the simplest implementation being a small hole in the centre of the chuck. One advantage of vacuum chucks is the ability to accommodate any sample shape and a wide range of sizes, provided the sample's base can make a good seal against the chuck. Vacuum chucks require a vacuum pump and a rotary union suitable for high speeds, adding both cost and complexity. Another consideration is that the suction of a vacuum chuck may warp very thin substrates (such as 300 lm Si) [1].
Gravity chucks typically take the form of an inset shape matching a specific sample size. These may require either a different chuck entirely for each sample size, or a compound inset where an inset for a smaller sample is set into a larger inset. Gravity chucks are mechanically simpler, and are not subject to clogging or failures related to vacuum systems, which are notorious for breaking down or requiring repair. The absence of a vacuum system and rotary union allows for a more cost effective and simpler implementation. Some more ''affordable" vacuum chuck based spin coaters costing a few thousand dollars (USD) have, at least within our research institution, been unreliable and subject to repeated failure and/or down-time usually related to the vacuum chuck, vacuum system and the path between. This observation is localised and may not be a fair representation of the manufacturers of these devices.
When designing shorter term research projects such as in MSc and undergraduate studies the wait time for new equipment or for parts to repair existing equipment can elapse a significant fraction of a student's available time. This is strongly affected by geo-bureaucratic circumstances, including the time required to organise and process funding for equipment, shipping time, customs delays, and costs. Also when working with imported commercial equipment, repair costs and logistics can result in significant down-time while waiting for a technician, shipping the instrument, or arranging finances.
While commercial builds cost a few thousand dollars, with additional sample chucks costing from $90 to a few hundred dollars (examples in SI Section 13), DIY spin coater builds can cost a few hundred dollars or even less making them a far more attractive option when cost, cost of repair and ease of repair are of primary importance.
In this paper, we present a simple, low cost 2-stage spin coater with a novel gravity chuck design. This makes use of a chuck and mask system with the full build planned around repairability, robustness and simplicity. These benefits are in part a result of bypassing the common points of failure in vacuum dependent designs.

Hardware description
This spin coater consists of a gravity chuck, motor, power supply, electronics, software, and the enclosure. It is a low cost device with simple circuitry built around an Arduino Nano compatible microcontroller to drive a DC motor and provide information on a Nokia 5110 display. The novelty of the chuck design lies in the plate like sample holder mask, and the round pins extending from the chuck on which the mask rests as the holding mechanism. In order to accommodate samples of different sizes, only the sample mask needs to be exchanged, in a quick tool free process. Two prototype implementations are presented in Fig. 1.
This hardware can be useful in any facility where thin films are being studied, which includes research in the following fields: Thin-films device fabrication, including thin film solar cells. The study of optical and optoelectronic properties in thin films. Education to show an application of centrifugal force, and the relationship between spin speed and film thickness. This spin coater can be simplified as in hardware Version 1 (hV1) (See reference [6]) for applications such as teaching motor control or optical properties of materials [7].

Motor
The spin coater is driven by a permanent magnet DC motor which is mounted to the enclosure, with a rubber gasket between as a vibration dampener. In Hardware version 2 (hV2), the motor axle had an M8 thread while hV3 had a 6.35 mm smooth shaft. Some commercial spin coaters have shafts of 3 mm. Under normal operation, it is inconceivable that any issue would arise from this, yet considering the surprising feats students are capable of, the motors were chosen to have thicker shafts which cannot easily be bent. The rotation speed is motor dependent, in the case of hV2 the motor operates comfortably between 600 and 7000 rpm. At lower speeds the force exerted by the motor magnets is significant and when the PWM (pulse-width modulation) duty cycle is below 5 % (PWM 13/255, AE 500 rpm), the motor magnet and other mechanical resistive forces are very close to or exceed the force generated by the motor coils potentially stalling the motor.

Tachometer
The motor speed was read using an infra-red proximity sensor. In hV2 the underside of the sample chuck was patterned into evenly spaced alternating sections of black 1000 grit sandpaper and bare reflective aluminium, as shown in Fig. 2b. The sandpaper provides a very good light absorbing surface, with the roughness diffusing any light that could be reflected by a smooth black surface. This approach required mounting of the sensor directly under the chuck, as shown in Fig. 2a. In hV3 (Fig. 2c) this system was replaced by mounting a reflector on the small portion of shaft protruding from the bottom of the motor. This reflector was made from a brass strip bent into a ''U" shape. This was painted black with the outer sides covered with a reflective aluminium tape. The infra-red sensor gain/sensitivity needs to be set such that it is not close to either providing false positive nor false negative readings. Both implementations make use of a strong reflector/absorber type contrast. This allows strong discrimination between reflective and ''dark" conditions. Additionally, the sides of the infra-red receiver on the sensor was covered with black heat shrink (glued in place) to reduce the light received directly from the adjacent transmitter. This allows a higher sensitivity/gain to be set on the sensor, while preventing false positive readings from this  effect. Comparing the sensor placement in hV2 and hV3, the sensor in hV2 was in the coating chamber directly under the sample chuck. This resulted in a more complicated mounting implementation requiring a protective enclosure. In hV3 the sensor mounting was entirely in the main enclosure. The tachometer assembly is included in SI documents ''Assembly of Spin-Coater hV2.pdf" and ''Assembly of Spin-Coater hV3.pdf". Sample chuck and mask The chuck design (Fig. 3) makes use of a flat top with two 3 mm pins positioned 45 mm apart. On these, an easily machined sample mask sits, allowing quick and simple interchange between sample sizes without removing the chuck, and the easy crafting of new masks for different sample sizes. The chuck was machined by a workshop technician from a cylindrical aluminium block with a CNC router to form the top with pins, and a lathe to shape the profile. hV2 makes use of a chuck with a thread tapped in the centre to fit on a motor with a threaded shaft, while hV3 has a blind hole in the chuck with 2 grub screws to fix it on a smooth motor shaft. An alternative chuck version for a motor can be made without these machining tools, as described in SI Section 3.1.
The sample mask is a 0.7 mm brass plate that has two 3 mm holes corresponding to the chuck's 3 mm pins, along with a cut-out in the centre corresponding to the sample/substrate size used. The sample mask should be thinner than the samples to allow easy drainage of the precursor solution while coating. The 0.7 mm mask was paired with 1.1 mm thick samples, this being the thickness of the microscope slides and ITO coated glass used within our research group. The sample mask is easily exchanged, which is especially valuable in a lab where multiple users work with substrates of different sizes.
The sample chuck and mask system is ideal for substrates slightly thicker than the sample mask. Very thin samples such as a 300 lm silicon wafer risk slipping under the mask. To avoid this, they can be mounted with double sided tape on a glass slide or equivalent for spin coating. As mentioned, vacuum chuck spin coaters risk creating a curvature in ultra thin samples, and this may similarly be remedied by mounting onto a glass slide. Another good alternative for very thin samples is to use inset type chucks [8]. With these, thin samples cannot slip between the sample chuck and mask. Inset type sample holders can be made to fit the presented chuck design using holes corresponding to the pins of the hV2/hV3 chuck for easy mounting. These can be produced by either 3D printing, using a CNC router, or by gluing a sample mask to a backing plate (these have not been produced for this work). Commercial alternatives using vacuum or gravity chucks typically require the entire chuck to be exchanged to change the sample mount [1,[9][10][11]. Mounting systems in open-source designs include the use of double-sided tape, vacuum chucks when using hard drive motors, gravity chucks where adjustment for sample size requires tools and measurement, and chucks using removable screws to secure samples [12,13,7,2,14]. In comparison, the chuck design presented here provides a simple, rapid, easy, and tool-free method to exchange the sample mounting configuration which takes close to 5 s to swap the sample mask. Commercially, chucks are available at purchase prices ranging from $90 to $300. In cases where chucks can be 3D printed [8], the associated knowledge and access to a 3D printer with a fine enough print resolution is required. In the design presented, the majority of technical expertise rests in the manufacture of the chuck, while the brass masks which accommodate samples are less sensitive to machining accuracy, and are easily crafted with readily available tools and inexpensive materials (i.e. a drill, saw or tin snips, small metal files and brass sheet). This offers the advantage of lower cost, reliable access without the risk of parts being discontinued, and avoids shipping, logistics and other potential delays in favour of locally available components. [15,16].
The need to accommodate a new shape and size of sample can occur long after the spin coater was commissioned. There is no guarantee the same individuals, technical knowledge and resources that were involved when equipment was commissioned will still be accessible. The simplicity and ease of machining a sample mask from brass plate serves as an advantage over other commercial and open source alternatives [15].
All the components are supported by, and housed in the enclosure as shown in Fig. 1. It serves to support the motor and protect the electronics in a lab environment, while the stainless steel bowl acts to contain the waste fluid from the spinning process. An enclosure can be bought or built using whatever non-flammable materials are most accessible. In our case, this was offcuts of steel barge flashing (a roofing material). Information regarding the materials for and assembly of the enclosure is provided in the SI documents ''Assembly of Spin-Coater hV2.pdf" and ''Assembly of Spin-Coater hV3.pdf"

Electronics
Inputs An Arduino Nano compatible microcontroller (Nano) formed the core of the electronics as seen in Fig. 4. The Nano functioned to control the DC motor with a pulse-width modulated (PWM) signal through an IRF540 n-channel MOSFET. In hardware version 2 (hV2), 50 kX potentiometers (pots) were used to set the spin parameters, with each sending a voltage between 0 and 5 V to the analog pins of the Nano for each parameter. Momentary contact buttons for start and reset functions were included in hV2. The pots used in hV2 provided unsTable 10-bit values (0 to 1023). The source of the instability could be related to the 5 V 3A USB power supply used for the Nano, which may additionally be affected by the power draw of components directly connected to the Arduino in our build. The instability was managed using a software based approach discussed in the software section.
To simplify the design and side-step the instability of the values read from the pots, hardware version 3 (hV3) replaced the pots and buttons with an incremental type rotary encoder containing an inbuilt momentary contact button. This functioned using the button to cycle through parameters, while rotation of the encoder adjusted parameter values, as shown in  The logic level voltages of an Arduino Nano are inherited from its ATMega328 microcontroller. The digital input voltages are > 3.0 V for a digital high and < 1.5 V as a low [17]. An IR-proximity sensor working on 3.3 V was connected to the Nano through a logic level converting NOT gate, with a threshold of 1.7 V and output of 5 V made using a NE555 timer. During testing of hV2, a direct connection between the sensor and Nano did not reliably trigger a digital high input. The logic level converting NOT gate was included to address this for the specific IR sensor board used.
Power delivery The motor was powered by a 24 V PSU in hV2, and 12 V in hV3. In hV2, power was delivered to the microcontroller by a step-down converter which delivered 5.2 V to the USB port of the Nano; a small voltage drop is expected in the USB cable. In hV3, a L7809 linear regulator reduced the voltage to 9 V which was then fed into the Power in (Vin) pin of the Nano. The Vin pin on the Nano is specified to accept 7-12 V input [18] which is regulated to 5 V by a LM1117 regulator. By dropping the voltage to 9 V prior to the Vin pin, the heat which the small onboard regulator will need to dissipate is reduced, [19]. Linear regulators reduce voltage by resistively dissipating energy as heat, while step-down/buck converters use PWM (pulse width modulation) typically followed by low pass filters to provide a reduced DC voltage at a high conversion efficiency.
Testing a 24 V PSU with the 9 V LM7809 (TO-220 package) for the hV2 configuration resulted in slow heating in a L7809 regulator, leading to thermal overload. While the heat dissipation can be accelerated with a heatsink, a step-down converter is preferable due to the higher conversion efficiency and reduced heat generation. The lower heat generation is desired as it allows the enclosure to be sealed without a need for vents or a fan. The absence of vents reduces the gradual accumulation of dust. This is of great importance in environments such as fume-hoods, where the strong air flow accelerates dust accumulation. The chemicals a researcher uses can require a spin coater to be used in a fume-hood due to OHS considerations.

Setting parameters
The spin parameters consist of the speed and time for each of the two stages (speed 1, speed 2, time 1, time 2) and the ramp time (ramp), which is the time to be allocated in total for ramping up the speed from stationary to the first speed, and between the first and second speeds. Parameters are either set using pots in hV2, or an incremental type rotary encoder in hV3. In hV2, 10-bit (0 to 1023) DAC readings are taken from 50 kX pots in the range 0 to 5 V. These readings were collected by averaging 5 readings, each 5 ms apart. Parameter values were updated if the new average values differed from the stored values by more than 5 units, equivalent to 24 mV. These values were converted into the spin parameters, of which the parameters with the finest increments are speed. Speed 1 was defined by ''s1 = byte(float(a[0])*242/1023)+13;", where s1 is speed 1, and a[0] is the averaged value read from the first pot. This converts the 10-bit value averaged from the DAC reading to 8-bit (byte) value with extrema of 13 and 242, defining limits on the minimum and maximum PWM duty cycles chosen for the specific motor. This provided good parameter control with the caveat that parameter values occasionally shifted by one unit. The parameter values are fixed when a run is started, as such these values should be checked on the display prior to each operation run.
This minor instability was addressed in hV3 by utilising a rotary encoder in place of relying on DAC read signals from the pots. Each time a parameter is updated on rotation of the rotary encoder in hV3, a delay of 10 ms is observed to allow for effects such as contact bounce before reading the state of its ''SW" and ''DT" pins (see Fig. 4). This provided a stable, reliable means of adjusting parameters.

Motor control
The motor speed is controlled using a MOSFET driven by a PWM signal. This can be generated by software, switching the signal through loops, or hardware driven, using the Nano's analogWrite() command. A software based PWM loop did not provide consistent speed control which was attributed to the computational processes demanded of the Nano single processing core. The most intensive being the processing and updating of the graphics display, and the hardware interrupt signals from the tachometer which trigger priority execution of the associated software function. In contrast, consistent operation of a hardware controlled PWM signal was obtained, irrespective of the other demands on the processor. The drawback of the hardware PWM is the fixed PWM frequency and discrete steps in the PWM duty cycle, limiting the accessible speeds to discrete intervals. On a Nano, hardware based PWM is limited to a byte value between 0 and 255, corresponding to a target duty cycle of 0 and 100 % respectively.
Calibration Prior to the first use, the spin coater should be calibrated (speed in RPM vs duty cycle). Calibration can be accessed though the menu as per Fig. 5, which calls a function void Calibrate(). Once initiated, the motor speed is measured at values across the AnalogWrite() PWM range. The motor is allowed time to get to speed, followed by sampling the tachometer reading and averaging 5 values (hV2), followed by time idle between each speed. The result for each PWM duty cycle is written to the Nano's EEPROM non-volatile memory.
Bypassing RPM calibration Operation can rely either entirely on the PWM duty cycle, or on RPM values as determined by the menu parameter bRPM4ramp. When bRPM4ramp is set to True, the speed will ramp linearly with time using the RPM calibration values. When set to False, the duty cycle will ramp linearly with time. In hV2, ''bRPM4set" toggles whether the speeds are set using RPM or PWM values, while hV3 allows the speed to be set by either at the pre-run display, where parameter are displayed and set.
Tachometer During operation the tachometer code relies on system interrupts to measure the time between successive transitions of the infra-red sensor's signal from low to high. The motor used in hV2 will not exceed 8000 rpm (7.5 mS per revolution), with 3 interrupts per revolution this leaves 2.5 mS between transitions. The interval between interrupts is stored when successive interrupts occur slower than 2 mS apart. This minimum interval prevents multiple readings for a single transition. When the display refreshes, it calls the function showRPM() which averages the last 18 intervals to provide the rotational speed.

Boost function
The DC motors used require more torque to overcome the resistance to rotation when the motor is stationary compared to when it has some inertia. To allow the motor to run at lower duty cycles, a ''boost function" was implemented in hV3. The ''boost function" increases the PWM duty cycle for 50 ms to generate additional torque in the motor. The activation criteria for the boost function requires that the tachometer reads 0, and that it is between 50 and 500 ms from the start of the spin program.
Should the tachometer ever fail and be unable to provide the microcontroller with readings, the spin coater can continue to operate provided the boost function is toggled off. This serves to reduce the risk of a user facing unusable equipment while plans are made for hardware inspection and repair.

Modularity
The circuity, motor and tachometer are not specifically paired, allowing easy substitution of these components for repairs and modification. A replacement motor can be easily set-up by running the calibration function accessible in the menu.
There are both DIY and commercial spin coaters available offering more advanced software. Some of these include features such as active speed correction using PID control. Many available spin coaters operate with 2 stages, while some commercial and DIY devices allow for a larger number stages in the coating process. The code written for this project provides 2 stages and an easy-to-use interface.

Build instructions
The spin coater build consists of an enclosure, motor, and the electronics which include the power supply. Safety should be the first priority when building and operating equipment. A selection of considerations are listed below, with some additional precautions and best practices in the SI Section 10. This is intended as informative and is not comprehensive: When working with electricity all connections and wiring should be done while the power is off and the device is disconnected from mains.
Capacitors, such as those present in power supplies (PSUs) store charge even after the PSU is disconnected from mains power. These can discharge explosively if shorted. Soldering involves high heat, care should be take to avoid burns while good ventilation is required for the fumes produced from solder, fluxes, and potentially but hopefully not, your components. When working with a motor keep the area clear of anything that could get caught by the motor such as loose clothing, jewellery, or hair. The spin coater's chuck and sample mask should not be touched when rotating. At speed the sample mask could potentially mimic a rotary cutting tool.
The components needed for the power supply depend on the chosen motor.
A 12 V motor should be paired with a 12 V PSU with a sufficient power rating to supply the motor. The voltage of the PSU also affects how power can be supplied for the microcontroller. The microcontroller steps down the input power from the Vin pin using a linear voltage regulator which dissipates heat proportional to the voltage difference between the input and output voltages. To reduce the heat dissipation on the board itself the 12 V was lowered to 9 V using a LM7809 linear voltage regulator to supply the microcontroller's Vin pin. For the 24 V motor and PSU in hV2 there is a much larger voltage difference making a linear voltage regulator less suitable due to heating concerns. For this a buck converter with a 5.2 V USB output was used to power the Nano through its USB port.
The connections for the electronics are as per the circuit diagram in Fig. 4. The following considerations were made in assembly: Use of female headers on the PCB to allow detachable connections for the Arduino Nano compatible microcontroller, rotary encoder, display and tachometer sensor. These connections were made with ribbons of jumper leads. For the power in and motor power connections PCB mounted screw terminals were soldered to the PCB. A DIP8 socket was soldered to the PCB to house the NE555 timer chip. The remaining connections were soldered in place. The use of removable components allows for easier trouble-shooting as components can be disconnected or exchanged for testing. The choice of infra-red proximity sensor will affect whether the logic converting circuit is needed for signals to be reliably read by the Nano. For proximity sensors which provide 5 V logic signals the NOT gate sub-circuit will not be needed. Ideally 3.3 V logic signals should work reliably directly connected to the Nano, yet with the sensor tested in our application this was not the case. It is suggested that 3.3 V proximity sensors should be tested in a bread board to assess the need for logic level converting circuit, such as the NOT gate sub-circuit.
The enclosure can be built in innumerable ways such that the motor is supported, the electronics are protected, and a chamber is present for collecting the waste liquid thrown off the sample during coating. Enclosure build instructions are available as follows: See the SI document, ''Assembly of Spin-Coater hV2.pdf" See the SI document, ''Assembly of Spin-Coater hV3.pdf" Instructions for hV1, which makes use of a simpler design is available at [6]

Operation instructions
The spin coater operation consists of loading a sample, setting parameters, and initiating the run. Appropriate safety precautions should be observed when working with spin coaters. A few prominent safety concerns are mentioned here, with the caveat that the list is by no means exhaustive. Precursor solutions used in spin coating are expected to be aerosolised and/or evaporated to some extent. It is necessary to take appropriate precautions such as working in a well ventilated area, in a fume-hood, or in a glovebox as determined by the chemicals in use. The spin coater includes a rotating motor, spinning chuck, and sample, thus appropriate precautions include not wearing loose clothing, and keeping anything that could potentially get caught by the moving parts clear of the space. Protective eyewear is essential, as the device does not include a cover for the enclosure-bowl. The spin coater chuck and mask should not be touched while in motion. Some additional information on best practices and safety precautions are offered in the SI Sections 10 and 11.
1. Ensure that the inner part of the enclosure-bowl is lined with aluminium foil 2. Make a protective paper ring from strips of A4 paper cut lengthways by joining the paper with folds, masking tape or staples. Place the paper ring inside the enclosure-bowl along the outer edge (see Fig. 3b). This collects most of the excess precursor from the spin coating process. This can then be changed after each set of samples to reduce the risk of sample cross-contamination and prevent gunk build-up in the coater.
3. Ensure the desired sample mask is in place, or change the mask for the substrate being coated. 4. Turn on the spin coater at the power switch. 5. (Calibration, first use) If the spin coater has not been previously calibrated, load a test or old substrate/sample and run the built in calibration program. Calibration is best run with a sample and sample mask in place to provide conditions similar to standard operation. Access the menu (described below) and cycle through the options as explained on the screen. Select calibrate and allow the calibration to run. It will cycle through the PWM parameter values up to 255, saving an average RPM for each value as it progresses (this takes about 2 h on hV3). hV2. To access the menu on hV2, long press the red start button. hV3. To access the menu on hV3, long press the rotary encoder with any item other than ''Start" selected. 6. Adjust the spin coating parameters as appropriate for the hardware variant: hV2. Adjust the 5 pots, each of which correspond to a single parameter. There will be a ''>" in front of the parameter while it is being adjusted. hV3. Use short presses on the rotary encoder to scroll through parameters, the selected item is indicated with a ''>" on the LCD display. Rotate the rotary encoder to adjust the parameters. 7. (Optional) Warm up the motor by running the spin coater for 2 min. This affects the motor grease viscosity and coil windings resistance which can affect motor speed for a specific PWM duty cycle. A comparison of the tachometer reading and spin parameters is valuable to assess whether the motor needs to be warmed up, and as an assessment of the calibration values. hV2. Press the red button to start a run. hV3. Long press on the rotary encoder with ''Start" selected to start a run. 8. Place a substrate in the cut-out of the sample mask. 9. Place precursor solution on the substrate using a dropper or micro-pipette. 10. Start the program as described in Step 7 11. (Optional) To stop the spin coater early press the red button (hV2), rotary encoder (hV3). 12. Remove the coated sample. 13. The spin coater returns to the parameter editing mode after a run and can be started again as done in Step 7, using the red button. 14. Remove and dispose of the contaminated paper ring from Step 2 once finished. 15. Clean and store.

Validation and characterization
Direct and indirect indications of spin coater performance were assessed. This includes the stability of the calibration speed vs duty cycle calibration data, the effect of repeated operation, and the analysis of thin films fabricated with hV2 by means of highly sensitive measurements.
The calibration function was run on the spin coater. Once completed, the speed vs. PWM parameter data was read from the spin coater's EEPROM, then converted into speed vs duty cycle for Fig. 6. This was fitted with a 6th order polynomial, R 2 ¼ 0:9997, Residual std. error ¼ 31:3, Figure SI-14. The magnitude residual std. error is dependent on the choice of motor and power supply stability. At higher speeds the PWM control allows finer increments as the calibration curve's gradient decreases. This is represented by the mean step in the RPM values of 81 below 3000 RPM, and 37 between 4000 and 6000 RPM. This imposes a granular selection of spin speed and informs on the step size limitations of the Nano's hardware based PWM control. Fig. 6. The relationship between motor speed and duty cycle for the 24 V DC motor controlled through a n-channel MOSFET with an Arduino Nano equivalent microcontroller as used in hV2.
A. Shnier, F. Otieno, C. Billing et al. HardwareX 14 (2023) e00422 In testing the effect of extended operation of the spin coater, a cycling experiment was conducted. For each cycle, the spin coater was operated at a set duty cycle for 30 s followed by 30 s idle. The spin coater was started on the beginning of each minute over an hour. Multiple readings of the motor speed (> 5) were taken and averaged for each data point during the 30 s active period (Fig. 7a). This was carried out with the enclosure fully assembled, as per standard operation.
In a separate instance, K-type thermocouples were placed on the back of the MOSFET used for PWM control, and on the top of the motor housing. The thermocouples were monitored using digital multimeters with a resolution of 1°C, as shown in Fig. 7b. In cases where the multimeter reading was unstable between 2 consecutive integers, the average was taken leading to some values with a half. The cycle number was denoted by n; From time (ðn À 1Þ Á 60 s) to ((ðn À 1Þ Á 60 s)þ30 s) the motor is running, after which the motor is idle until the n th minute. The MOSFET-Hi temperatures were taken at (ðn À 1Þ Á 60 s) + 30 s while the MOSFET-low temperatures ( Figure SI-15) were taken at the end of the cycle on the minute mark (n Á 60 s). The motor casing/housing temperature was recorded as the maximum stable value over the 1 min period of the cycle, Fig. 7c.
In Fig. 7a, the spin coater (hV2) motor speed remains reasonably steady with cycling at around 2200 rpm while operating at a duty cycle of 12%. When this is increased to a duty cycle of 31%, the motor speed gradually increases from 5050 to 5300 rpm, this constitutes a 5% increase in speed, after an hour of cycling. This was suspected as an effect of heating in either the motor or the MOSFET controlling the motor. The temperatures of both components were tracked using the same 30 s on 30 s off cycling approach (Fig. 7c). The MOSFET was quick to stabilise between 26-27°C during cycling at a 31% duty cycle, while the temperature of the motor housing rose in a similar trend to the speed in Fig. 7a (see Fig. 7c).
To support assignment of motor temperature as the cause of the speed increase, we consider the motors no-load speed n 0 as a suitable indicator for the trend in operational speed. This neglects the effect of the weight of the sample chuck which is minimal. The relation is given in Eq. 1 where K E is the voltage constant of the motors permanent magnets, and a m is the permanent magnets temperature coefficient [20,21]. For small changes in a m DT ða m % À0:002 C À1 ; < 40 CÞ; n 0 can be approximated to increase linearly with increasing DT.
With Eq. 1 in consideration, the increase in motor speed was attributed to an increase in motor temperature during cycling at a the higher PWM duty cycle of 31 %. The motor used in hV2 had a sealed housing which does not allow air to pass through for cooling of the motor. It is recommended that either a motor be used that generates less heat or one which has a better heat dissipation. To accommodate this dynamic behaviour in hV2, the PWM duty cycle set point can be monitored and modified in cases of extended operation to minimise the error in spin speeds. Alternatively a software based correction can be implemented.

Application example
With the purpose of a spin coater being the fabrication of thin films, such films were fabricated on hV2. These were then assessed using characterisation techniques sensitive to film quality.
Polymer blend thin films were prepared using the hV2 spin coater, followed by surface measurements using atomic force microscopy (AFM). A precursor solution was used containing 20 mg/ml of PBDB-T:PC71BM (1:1 ratio) in chlorobenzene. The solution was stirred overnight at 40°C. A dropper was used to cover a clean glass substrate with the solution followed by spin coating at between 1000 and 5000 rpm for 60 s.
The AFM measurements and roughness of the thin films are presented for various spin speeds in Fig. 8. The roughness appeared quite modest and consistent across the measurements. The roughness was lower at 1000 and 2000 rpm, highest at 3000 rpm and decreased thereafter. In a line-trace of the 3000 rpm sample (Figure SI-16) a maximum peak to valley height of 11 nm was observed which is comparable to the 8 nm over a 5 lm length for PCBM in literature [3]. Differences in the viscosity and concentration of the polymer blend solution, and the boiling point of the solvent used will have a strong influence on the film topography and roughness, yet these measured values are sufficient as a positive reflection on the hV2 spin coater.
X-ray reflectometry (XRR) measurements provide an indication of film quality. XRR demands high quality films with a roughness of no more than a few nanometres for the observation of Kiessig fringes. With this in mind PMMA thin films were coated on a glass substrate at 4000 rpm using hV2 with a 0.5 or 1 wt% solution of PMMA (PMMA Sigma-Aldrich 445746). The samples were dried for 20 min at 60°C then annealed for 60 min at 95°C in an Ar filled annealing chamber. XRR measurements were then taken on a Bruker D8 Discover with Goebel mirror and 2 bounce Ge (022) monochromator. The data was fitted using LEPTOS (Bruker AXS, V7).
The measurements provided exceptionally good XRR patterns for samples prepared using spin coating, as seen in Fig. 9. Due to the low electron density and small volume of the PMMA films its density information was obscured by that of the substrate. The density of the PMMA films was thus fixed to a literature based value of 1.18 g/cm 3 [4,22]. While this assumption reduces the absolute accuracy of the modelled thicknesses, it increases the stability of the determined thicknesses, thus improving the relative accuracy between measurements, which is valuable for the following comparison. The thicknesses for the samples made from the 1 wt% precursor were 27.0 AE 0.3 and 26.2 AE 0.3. For the 0.5 wt% precursor thickness were modelled to 7.3 AE 0.2 and 7.9 AE 0.2. Comparable values were observed for the resulting films within each precursor weight percent solution, the slight variations observed may have contributions from minor variance in the application of the precursor to the substrate, and the wait time between this application and the start of the spin coating program.

Capabilities and limitations:
Quick to change samples and sample masks 600-7000 rpm 2-stage spin program Max / 45 mm sample size limited by the distance between pins on the chuck Sample masks unsuitable for ultra-thin samples In-built speed calibration program Absence of a speed correction algorithm Intuitive controls and display The spin coater design presented provides good functionally and ease of use. hV2 as presented has survived use in a multi-user research lab in South Africa since 2019, while hV3 has been in a Kenyan research lab since 2021, without a need for repair or maintenance, exceeding the performance of at least some more costly commercial alternatives. Accommodating additional sample sizes by cutting a new mask from brass sheet is manageable by any individual competent with hand tools. This spin coater is cost effective, and allows the fabrication of high quality thin films. This makes it ideal for research groups where a reliable, repairable product is needed on a minimal budget. The cost and maintenance aspects of open-source hardware can offer utility to low budget institutes and groups where the commercial equivalent may be prohibitively expensive or otherwise inaccessible. Commercial alternatives using motors with less internal resistance provide smoother operation at low speeds compared to the motors used in hV2 and hV3. Since this is entirely dependent on the motor, this can be upgraded in future versions to close this gap.
Many of the design considerations implemented or features avoided were inspired by the authors experience (direct and indirect) with failure points and repairs of commercial spin coaters and their related vacuum systems. This includes precursor solution clogging vacuum chucks, various problems with vacuum pumps for which vacuum pumps are notorious [1], motor problems, tachometer issues causing glitches in speed regulation, and precession due to a slightly bent motor shaft among other issues.
The motor in hV2 showed gradual heating at higher PWM duty cycles. This is attributed to a closed motor housing design which leads to heat retention. In response to this, hV3 instead uses a motor with an air cooled housing.
Speed correction could be implemented to address the effects of changes in conditions, such as motor temperature on the spin speed, a simple means of speed correction would be to adjust the motor speed towards a target based on the tachometer reading. With the PWM duty cycle set by a byte value, a threshold is required to avoid constantly cycling between two adjacent speeds. The threshold can be defined relative to the step size between consecutive speed calibration values closest to the target speed, this accommodates larger steps at lower speeds and smaller steps at higher speeds consistent with Fig. 6. For more advanced speed correction Arduino libraries are available for implementation methods such as PID control [23].
To reduce the size increments of accessible speeds at lower duty cycles, effectively continuous PWM steps can be implemented. This can be achieved by using software controlled PWM. Initial tinkering showed inconsistent speed control when using software based PWM where the same microcontroller was also handling the display and tachometer. This could be easily remedied with a dedicated microcontroller to drive the software based PWM at the expense of additional cost and complexity. The finer speed increments could also benefit any speed correction implementations.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Dr. Francis Otieno is currently a full-time lecturer at the department of Physics and Materials science, Maseno University, Kenya. He holds an Msc and PhD in Physics and recently completed a 3-year postdoctoral fellowship at the University of the Witwatersrand, South Africa funded by the Synchrotron Techniques for Africa Research and Technology-Global Challenge Research Fund (START-GCRF). He is a recipient of several funding including the British Council -South Africa, under the Newton Fund in partnership with the Department of Higher Education and Training (DHET) South Africa and recently the ARUA/Carnegie Early Career Research Fellowship. His research interest includes fabrication and characterization of thin films solar cell devices including organic solar cells, dye sensitized solar cell and perovskites with a view to enhance performance using plasmonics, spectral conversion, varied device structure and probing into the morphology using Synchrotron Soft X-Rays. His focus is on thin film growth and characterization via physical deposition techniques such as sputtering, thermal evaporation, pulse laser deposition etc.
Caren Billing is currently an Associate Professor at the University of the Witwatersrand, South Africa, in the field of electrochemistry. Her research currently includes investigating energy materials with a focus on solid electrolytes for fuel cell and battery applications, through electrochemical techniques and a range of structural characterisation techniques. Other research areas include electroanalysis, studying of metal-ligand equilibria using voltammetry, and investigating mineral leaching and corrosion inhibition.
Daniel Wamwangi is currently an associate professor at the School of Physics, at the University of the Witwatersrand where he has been based since 2010. His research interests include the development of novel materials for energy conversion and information storage using advanced characterization tools. He is a Member of the Center of Excellence in Strong Materials, Materials Physics Research Institute (MPRI) and the defunct ''Materials for Energy Research group" (MERG).
David Billing is currently a professor at the School of Chemistry, at the University of the Witwatersrand. His research currently focusses on structure-property relationships in solid eletrolyte materials typically for energy applications, using advanced X-ray and Neutron diffraction and total scattering techniques. Of particular interest is the use of in situ and in operando studies, as well as the use of synchrotron based techniques to gain a better understanding of the real structure and performance of the materials under investigation.