INTRODUCTION
The measurement of pupillary light response (PLR) is crucial in clinical and research settings for evaluating neurological functions and circadian rhythms. Pupillometry, the study of pupil dynamics, has been widely used to assess autonomic nervous system activity, diagnose various neurological disorders, and understand sleep-wake cycles [1]. However, current pupilometers, often used in clinical and research environments, are expensive and not easily accessible for all institutions or researchers [2]. This gap highlights the need for developing cost-effective, portable devices that can provide reliable data on pupillary responses.
Despite the advancements in pupillometry, there remains a significant disparity between the available high-cost, high-precision instruments and the need for affordable alternatives that maintain accuracy and usability [3]. The scientific community has expressed a strong desire for more accessible tools to facilitate broader research and clinical applications [4]. This need is particularly pressing in low-resource settings and for small-scale studies where budget constraints limit the use of sophisticated equipment [3][5][6].
Results from Lobato-Rincón et al . [7] indicated that the pupillary response amplitude was highest and latency shortest under white and green light for all subjects. Age significantly influenced PLR, with older adults exhibiting increased latency for white light and reduced constriction velocity for green light. Additionally, red light produced the smallest amplitude responses and most prolonged latencies, suggesting lower sensitivity to this wavelength. These findings underscore the age-related variations in PLR and highlight the necessity of incorporating different wavelengths in pupillometric studies to enhance understanding of autonomic nervous system integrity and its diagnostic potential. Moreover, Privitera et al. [8] emphasized the importance of pupillary response differentials in serving as a critical prognostic indicator and incorporating them into routine assessments of neurologically injured patients. The presence of a differential is associated with worse outcomes, highlighting the need for clinicians to monitor both eyes' pupillary response values to predict patient recovery trajectories better. Bonmati-Carrion et al. [9] explored the relationship between the human PLR and circadian system status, highlighting the importance of lateralization in pupil response. Intrinsically photosensitive retinal ganglion cells (ipRGCs), which contain the photopigment melanopsin, play a crucial role in both the regulation of PLR and the entrainment of circadian rhythms through their connections to the olivary pretectal nucleus (OPN) and the suprachiasmatic nuclei (SCN). The study demonstrated that a robust circadian system, characterized by high stability and low internal desynchronization, correlates with a reduced PLR to blue light (460-490 nm). This correlation suggests that pupillometry can be a non-invasive tool to assess circadian system integrity and function, providing valuable insights into the interplay between light exposure, pupillary response, and circadian health. Furthermore, Münch et al . [10] investigated how the PLR varies with circadian phases and levels of wakefulness. The study highlighted the role of ipRGCs in circadian regulation and PLR. Their findings indicated that the pupil's response to blue light, which primarily stimulates ipRGCs, showed significant circadian modulation. This modulation was evident through a stronger post-stimulus pupil constriction during the night, correlating with higher melatonin levels, and a reduced response closer to wake times. In contrast, responses to red light were more influenced by subjective sleepiness rather than circadian rhythms.
These findings underscore the importance of considering circadian and wake-dependent factors when evaluating PLR, particularly in clinical settings where accurate autonomic and circadian function assessment is critical. The study demonstrates that the PLR, especially in response to blue light, can serve as a valuable non-invasive marker for circadian rhythm and overall neurological health.
We developed a low-cost, portable pupilometer using the Raspberry Pi platform in response to this need. This device is designed to measure pupillary responses to different light wavelengths and evaluate their relationship with circadian rhythms and lateral asymmetry. By leveraging affordable technology and open-source software, our pupilometer offers a practical solution for researchers and clinicians who require reliable pupillometric data without the financial burden of high-end equipment.
The remainder of this paper is structured as follows: first, we provide a detailed overview of the materials and methods used to develop and characterize the pupilometer. Next, we present the results of our validation study, including the pupillary response data collected from our test subject. At the same time, we discuss the implications of our findings, potential applications of the device, and the limitations of our study. Finally, we conclude with suggestions for future research directions and potential improvements to the device.
MATERIALS AND METHODS
Development of the instrument and data acquisition
This low-cost portable pupillometer was based on the Raspberry Pi3 with a NoIR V2 camera with a Sony IMX219PQ back-illumination CMOS sensor, operating in the visible (400-700 nm) and near-infrared (800-2500 nm) spectral range. The Raspberry Pi 3 and NoIR V2 camera were chosen for this study due to their combination of affordability, availability, and technical capabilities. The Raspberry Pi 3, a widely available single-board computer, was selected for its ability to handle real-time image acquisition while maintaining a low cost, which is critical for developing accessible biomedical instruments. The NoIR V2 camera, compatible with the Raspberry Pi, was chosen for its capacity to capture high-quality images across the visible and near-infrared spectrum, essential for accurately measuring pupillary light response, as our previous work reported its sensor noise, linearity and spatial resolution [11]. These components were determined to be the most suitable options that meet the project’s requirements for cost-effectiveness, availability, and functionality. While these components effectively fulfilled the needs of this study, future iterations of the device may consider integrating higher-resolution cameras or more powerful processing units to enhance performance further. The camera was software controlled from the Python programming language using the PiCamara API application programming interface. An external timer electronic circuit was added to provide a delayed visual stimulus while recording video (Figure 1A). Since microprocessor-based systems are not inherently capable of performing parallel tasks, this circuit was used to add a delay and duration to the stimulus, ensuring that the pupillometer was recording before the stimulus was presented, thereby allowing the complete time course of the pupillary response to be captured. Images in raw data format were preprocessed (contrast-adjusted and formatconverted) on the Raspberry Pi with Python and then handled in MATLAB R2017b and ImageJ 1.52p for further analysis.
Experimental protocol
The study was conducted with a 24-year-old female participant in good ocular and general health according to her routine medical checkup. Measurements were carried out over a period of 20 days, which were chosen according to a sample size computation. Two measurement sessions were performed each day, one in the morning (8:00 AM) and one in the evening (8:00 PM), to evaluate pupillary responses at different times of the circadian cycle. This 12 hour difference between sessions was chosen per the work of Münch et al. [10]. According to Tekin et al. [12], each light stimulus lasted 200 milliseconds and was provided at random to prevent biases in the pupillary response; an example of pupillary response can be seen in panel B of Figure 1. Ambient lighting conditions were kept constant throughout the experiment to ensure uniformity of measurements, by turning all artificial light off and shutting the door of the room where the experiments were carried out. Two types of light stimuli were used: red light (635 nm) and blue light (463 nm), as depicted in Figure 1C. These stimuli were selected because of their differential influence on retinal photopigments and their relevance to circadian modulation and because it has been found that both stimuli produced reliable and repeatable pupillary responses, with no significant difference in repeated measures [13][14]. Each measurement session included multiple repetitions for each stimulus type, with 10 repetitions per stimulus in each session, resulting in a total of 800 measurements. This allowed averaging and reduced intraindividual variability in pupillary responses. Before each measurement session, the participant underwent a 10-minute dark adaptation period. During this time, the participant remained in a room with controlled lighting to stabilize the pupillary diameter before exposure to stimuli. Our dynamic pupillometer was used to record pupillary diameter before, during, and after the presentation of the light stimuli, as illustrated in Figure 2. Measurements were taken at a rate of 25 frames per second, allowing rapid changes in pupillary diameter to be captured.
Image processing and statistical Analysis
Pupil diameter was manually obtained from the image series in ImageJ software v1.52p, with the ellipse selection tool as depicted with a dotted red line in Figure1B, and then all subsequent analyses were carried out in MATLAB R2017b (Mathworks Inc., Natick, MA). Pupillary response measurements were analyzed to determine minimal pupillary contraction amplitude and response latency [9]. Results were compared between morning and afternoon sessions to identify possible circadian variations.
The Shapiro-Wilk test was used to assess the normality of our data, as it is the method that has demonstrated the greatest statistical power [15][16]. Simultaneously, Q-Q plots were produced to appreciate the distribution of our data visually. For data that do not show a normal distribution, quantile normalization was performed before comparison between groups, which involves first ranking the pupillary response time of each sample by magnitude, calculating the average value of pupillary response times occupying the same range, and then replacing the values of all response times occupying that range with this average value. The next step is to rearrange these response times of each sample in their original arrangement [17]. To compare the time and minimum diameter (maximum constriction) of the pupillary response between groups, a 3-way analysis of variance (ANOVA) was performed with the factors: time of acquisition, wavelength, and eye laterality. Tukey-Kramer-type corrections were then performed for multiple comparisons [18].
RESULTS AND DISCUSSION
The average pupillary responses are shown in Figure 3; panel A contains the results from the 8:00 AM (morning) experiment, and panel B contains the results from the 8:00 PM (evening experiments). The red curve depicts the average response to the stimulus at 635 nm and the blue curve shows the average response to the stimulus at 463 nm. Standard deviation is denoted by the shading around the average responses. The black dotted line marks stimulus duration and onset. It can be appreciated from the graphs that the 635nm stimulus elicits a reduced and earlier response than the 463nm stimulus, regardless of the time of the experiment and lateralization (left or right eye). Two features were extracted from these curves: the minimum diameter of the pupillary response and the time at which this minimum diameter was achieved, i.e., the response latency. Figures 3C and E show the minimum diameter during the morning and evening experiments. Despite the different times, the minimum diameter is always smaller for the 463nm stimulus, i.e., a greater constriction is reached with blue light stimuli. These results are supported by the work of Kardon et al. [14] where they compared chromatic pupil responses and found that blue light stimuli preferentially activate melanopsin-mediated responses, leading to greater pupil constriction than red light stimuli, especially at lower intensities. This is significant for understanding the distinct roles of different photoreceptors. Figures 3D and F show the response latency during the morning and evening experiments. It can be observed that the response latency is always greater for blue light stimuli than for red light stimuli. Furthermore, this response latency is greater during the morning experiments for both stimuli, suggesting a circadian effect in the pupillary response.

Figure 3 Pupillometry results. (A) Pupillary response for the morning experiment (8:00 AM) for the left eye, right eye and their average; (B) same as A but for the evening experiment (8:00 PM); (C) Minimum diameter for both wavelengths during the morning experiment; (D) Response latency for both wavelengths for the morning experiment; (E) same as C but for the evening experiment and (F) same as D, but for the evening experiment.
Table 1 shows the results from the 3-way ANOVA based on maximum constriction (minimum diameter) data. There was no significant difference (F(1, 73) = 1.29, p = 0.2597) in the pupillary response based on the time of the experiment (8:00 AM vs. 8:00 PM). There was a highly substantial difference (F(1, 73) = 284.37, p = 6.9e-27) in the pupillary response between red (635 nm) and blue (463 nm) light stimuli, with blue eliciting a significantly greater constriction than red. Our results indicated a significant difference in the pupillary response between the left and right eyes (F(1, 73) = 12.36, p = 0.0008), where the left eye consistently showed greater constriction than the right eye. Finally, the effect of color on the pupillary response differs significantly between the left and right eyes (F(1, 73) = 10.24, p = 0.0020). Table 2 presents the results of a post-hoc Tukey-Kramer test for repeated measures, analyzing the differences in the minimum diameter of the pupillary response between various combinations of Color and Side (left or right eye). The pupillary response was generally smaller for blue light than red light in both eyes, with significant differences observed. Also, there is a significant lateral difference in the pupillary response to blue light, with the right eye showing a larger response (lesser constriction) than the left eye. Finally, no significant lateral difference is observed in the response to red light between the right and left eyes.
Table 1 Analysis of variance for the minimum diameter data as the dependent variable. Statistical significance is denoted with bold figures.
| Source | Constrained Type III sum of squares | d.f. | Mean Square | F | Prob>F |
|---|---|---|---|---|---|
| Time | 58.24 | 1 | 58.24 | 1.29 | 0.2597 |
| Color | 12837.09 | 1 | 12837.09 | 284.37 | 6.9e-27 |
| Side | 558.15 | 1 | 558.15 | 12.36 | 0.0008 |
| Time*Color | 26.66 | 1 | 26.66 | 0.59 | 0.4447 |
| Time*Side | 85.14 | 1 | 85.14 | 1.89 | 0.1739 |
| Color*Side | 462.38 | 1 | 462.38 | 10.24 | 0.0020 |
| Error | 3295.33 | 73 | 45.14 | ||
| Total | 17322.98 | 79 |
Table 2 Post-hoc Tukey-Kramer test for repeated measures of minimum diameter. Statistical significance is denoted with bold figures.
| Group A | Group B | Lower Limit | A - B | Upper Limit | corrected Prob. |
|---|---|---|---|---|---|
| Color=Blue,Side=Right' | Color=Red,Side=Right' | -26.11 | -20.53 | -14.94 | 6.23E-14 |
| Color=Blue,Side=Right' | Color=Blue,Side=Left' | 4.50 | 10.09 | 15.68 | 5.79E-05 |
| Color=Blue,Side=Right' | Color=Red,Side=Left' | -25.64 | -20.05 | -14.47 | 1.63E-13 |
| Color=Red,Side=Right' | Color=Blue,Side=Left' | 25.03 | 30.62 | 36.20 | 2.19E-22 |
| Color=Red,Side=Right' | Color=Red,Side=Left' | -5.11 | 0.47 | 6.06 | 0.9960 |
| Color=Blue,Side=Left' | Color=Red,Side=Left' | -35.73 | -30.14 | -24.56 | 5.23E-22 |
Table 3 shows the results from the 3-way ANOVA based on response latency data. Contrary to the minimum diameter data, there was a significant difference (F(1, 73) = 12.02, p = 0.001) in the pupillary response latency based on the experiment's time (8:00 AM vs. 8:00 PM). Also, a highly significant difference (F(1, 73) = 81.98, p = 1.4e-13) was found in the latency of the pupillary response between red (635 nm) and blue (463 nm) light stimuli. Furthermore, the main effect of ‘side’ on the pupillary response latency is significant (F(1, 73) = 4.25, p = 0.043), thus indicating a substantial distinction in the pupillary response latency between the left and right eyes. Finally, the interaction between ‘color’ and ‘side’ is significant (F(1, 73) = 4.25, p = 0.043), suggesting that the difference in latency due to color varies between the left and right eyes. Table 4 explores the interaction between the side and color variables through a post-hoc Tukey-Kramer test to correct for multiple pairwise comparisons. The analysis revealed that the response latency is generally shorter for red light than blue light, with significant differences observed in both eyes. Moreover, a notable lateral difference exists in the response latency for both colors, with the right eye exhibiting a shorter latency than the left eye. Furthermore, a significant difference in response latency is observed between red and blue light in the left eye. Münch et al. [10] found that the post-stimulus pupil response to blue light, indicative of intrinsic melanopsin activity, shows a circadian pattern, peaking after nocturnal melatonin secretion. This aligns with our findings that blue light elicits greater pupil constriction and that the response latency is longer in the morning, suggesting a circadian influence. Münch et al. [10] also reported that red light responses correlate more with subjective sleepiness than the circadian phase, which might explain our observation of lesser and earlier constriction with red light stimuli, independent of the experiment time. Our study adds to this by highlighting lateral differences in pupillary responses, with the left eye showing more significant constriction and longer latency, particularly to blue light. In general, lateralization is not examined explicitly in pupillometry. However, some individual differences in neural responsivity (including locus coeruleus-norepinephrine activity) suggest that lateral differences in autonomic responses could be an area for further research [19].
Table 3 Analysis of variance for the response latency data as the dependent variable. Statistical significance is denoted with bold figures.
| Source | Constrained Type III sum of squares | d.f. | Mean Square | F | Prob>F |
|---|---|---|---|---|---|
| Time | 0.78 | 1 | 0.78 | 12.02 | 0.001 |
| Color | 5.31 | 1 | 5.31 | 81.98 | 1.4e-13 |
| Side | 0.28 | 1 | 0.28 | 4.25 | 0.043 |
| Time*Color | 0.09 | 1 | 0.09 | 1.40 | 0.240 |
| Time*Side | 0.00 | 1 | 0.00 | 0.00 | 0.988 |
| Color*Side | 0.28 | 1 | 0.28 | 4.25 | 0.043 |
| Error | 4.73 | 73 | 0.06 | ||
| Total | 11.46 | 79 |
Table 4 Post-hoc Tukey-Kramer test for repeated measures of response latency. Statistical significance is denoted with bold figures.
| Group A | Group B | Lower Limit | A - B | Upper Limit | corrected Prob. |
|---|---|---|---|---|---|
| 'Color=Blue,Side=Right' | 'Color=Red,Side=Right' | 0.05 | 0.26 | 0.48 | 8.25E-03 |
| 'Color=Blue,Side=Right' | 'Color=Blue,Side=Left' | 0.37 | 0.58 | 0.79 | 2.22E-09 |
| 'Color=Blue,Side=Right' | 'Color=Red,Side=Left' | 0.50 | 0.71 | 0.92 | 2.05E-12 |
| 'Color=Red,Side=Right' | 'Color=Blue,Side=Left' | 0.11 | 0.32 | 0.53 | 1.00E-03 |
| 'Color=Red,Side=Right' | 'Color=Red,Side=Left' | 0.24 | 0.45 | 0.66 | 2.43E-06 |
| 'Color=Blue,Side=Left' | 'Color=Red,Side=Left' | -0.08 | 0.13 | 0.34 | 3.77E-01 |
Overall, these results highlight the importance of considering both the stimulus's color and the eye being measured when analyzing pupillary responses. The findings align with current scientific literature, such as studies by Herbst et al. [13], Kawasaki et al. [14], and Rukmini et al. [20], which also emphasize the differential effects of blue and red light on pupillary response and the potential circadian influences on these responses.
A comparison of commercially available pupillometers used in scientific studies and the prototype here developed is included in Table 5[21][22][23]. The authors acknowledge that this comparison accounts solely for the material costs of the prototype and excludes additional expenses common to commercial devices, such as labor, scaling, and other overheads.
Table 5 Post-hoc Tukey-Kramer test for repeated measures of response latency. Statistical significance is denoted with bold figures.
| Feature | NeurOptics NPi-300 | NeuroLight Algiscan | This work |
|---|---|---|---|
| Type | Handheld, Infrared Pupillometer | Handheld, Infrared Pupillometer | Portable, Infrared Pupillometer |
| Spatial resolution | ±0.03 mm | ±0.1 mm | ±0.33mm |
| Measurement Time | 2 seconds for single measurement | 1 second for single measurement | Single frame: 40ms, needs at least 2 seconds to record pupil constriction |
| Data Storage | Internal storage, data can be exported | Internal storage, data can be exported | Internal storage, data can be manually exported |
| Weight | 344g, portable | Lightweight, portable | 150g, portable |
| Price | Approximately $3,350 USD | Approximately $3,015 USD | Approximately $85 USD |
CONCLUSION
This study successfully demonstrated the development and characterization of a low-cost, portable pupilometer based on the Raspberry Pi platform. This device can effectively measure pupillary responses to different light wavelengths and evaluate their relationship with circadian rhythms and lateral asymmetry. However, our study has several limitations. Firstly, the sample size was limited to a single participant, which may not comprehensively represent the population. Additionally, the study did not account for potential inter-individual variability in pupillary responses, which could influence the generalizability of the findings.
Future research should include a more extensive and more diverse sample to validate the results and enhance the robustness of the conclusions. It would also be beneficial to investigate the impact of different environmental factors, such as light exposure history and sleep patterns, on pupillary responses. Furthermore, integrating additional sensors to monitor physiological parameters like heart rate and skin conductance could provide a more holistic understanding of the autonomic nervous system's role in pupillary dynamics.
Potential improvements to the device could involve enhancing the camera resolution and sensitivity to capture more precise measurements and incorporating real-time data processing capabilities to facilitate immediate analysis. Expanding the device's functionality to include various light intensities and durations could offer more comprehensive insights into the mechanisms underlying pupillary light reflexes. These advancements would significantly contribute to the utility of the pupilometer in clinical diagnostics and therapeutic monitoring, particularly for circadian rhythm disorders and phototherapy applications.










nueva página del texto (beta)





