top of page

BUILDING A NON-MYDRIATIC FUNDUS CAMERA

Introduction
A friend of mine originally introduced me to this project. He wanted to be able to take pictures of his own retinas on a monthly basis to monitor them for any changes. Standard equipment for imaging the human retina is expensive, bulky and not available to individuals. My friend found a paper coauthored by Bailey Y. Shen and Shizuo Mukai titled "A Portable, Inexpensive, Nonmydriatic Fundus Camera Based on the Raspberry Pi Computer" and asked me to follow the paper's instructions to build the camera. 
​
A nonmydriatic fundus camera is a camera that takes images of the retina (i.e. fundus of the eye) without requiring dilation of the pupil (i.e. it is a nonmydriatic camera because the pupil remains at normal constriction). The advantage of this type of camera is that patients do not need to have their pupils dilated, which is uncomfortable and time consuming, since the effects of the dilating drops can last for several hours. Dilation can also present a small danger to patients susceptible to narrow-angle glaucoma in that the drops could trigger an adverse event. The camera that Shen and Mukai designed uses an infrared LED to light up the interior of the eye without triggering the pupil's constriction response, since the human eye cannot detect infrared light. The camera is sensitive to IR and so the user can orient the camera relative to the retina to get the best image, and then a flash of white light is delivered when the actual image is taken. The camera is used in conjunction with a 20D lens to magnify the back of the eye. 
​
All credit for this project belongs to Shen and Mukai of the University of Illinois and Harvard Medical School, respectively. The link to their paper is given above. Since the paper was written in the spirit of open-source development, I have faithfully documented the modifications I made to the original design should anyone want to reproduce them. Please feel free to contact me with any questions on my work. 
​
Citation: 
​
Bailey Y. Shen and Shizuo Mukai, “A Portable, Inexpensive, Nonmydriatic Fundus Camera Based on the Raspberry Pi® Computer,” Journal of Ophthalmology, vol. 2017, Article ID 4526243, 5 pages, 2017. doi:10.1155/2017/4526243
​
Bill of Materials
​

The original creators of the camera wrote a bill of materials (BOM) which you can download as an Excel sheet from the link posted above. However, I made some modifications to the BOM since some parts had been discontinued. Specifically, I replaced the specialty infrared LED (which has been discontinued) with one white LED and one infrared LED (940 nm wavelength). I also added a small breadboard and male to female jumper cables to help organize the LEDs and buttons to control the camera. 

​
1. Setup Raspberry Pi Board
​

The first step in this build is to setup the Raspberry Pi board. If you order the product listed on the BOM, you should get a microSD card included in your purchase that is pre-loaded with the recommended Debian operating system. However, I found that the microSD card came corrupted and so I had to reformat the SD card and reload the OS onto the card. You can find free SD formatting software here, and instructions for loading the Raspberry Pi OS onto the card here. You will also need to use these tools if you have bought your own microSD card to use with your Raspberry Pi. 

​

When you are ready to turn the Raspberry Pi board on for the first time, be sure to connect it via an HDMI cable to a monitor, and connect a USB keyboard and mouse to 2 of the USB ports, as well. (I would recommend using a wired connection, not a Bluetooth connection, for initial testing.) When you connect the microUSB power port to a power source (like your laptop or a portable battery), you should see a loading screen indicating that the Raspberry Pi is installing its OS. If you see the "rainbow screen of death" (as shown below), that indicates that the SD card is corrupted and you need to reformat it and reinstall the OS. 

​

2. Setup the Raspberry Pi for Required Peripherals

​

This build uses some peripheral tools such as the Pi NoIR camera and the HDMI backpack touchscreen. You will need to adjust the config file for the Raspberry Pi computer, as well as some other settings, in order to be able to use these peripheral tools. 

​

To edit the config file of the Raspberry Pi, open the Terminal and type in: 

​

sudo nano /boot/config.txt

​

Follow the instructions here for modifying the config file for the HDMI backpack touchscreen. When you are done editing the file, follow these keystrokes to save and reboot the computer with the new settings: 

​

Press control-x

Press y

Press [Enter]

​

sudo reboot

​

(Source: Wikipedia)

​

When the computer has rebooted, you can edit the preferences for using the camera. Open the Terminal again and enter: 

​

sudo raspi-config

​

Then follow these instructions

​

3. Connect the Hardware
​

Once you have all the preferences set on the Raspberry Pi, connect the hardware to the computer. 

​

The HDMI backpack should be connected via HDMI cable to the Raspberry Pi video port. The microUSB port on the backpack should also be connected to a regular USB port on the Raspberry Pi (if you neglect this connection, the commands that you enter on the backpack touchscreen will not be communicated to the computer). 

​

The rechargeable battery pack should be connected via USB to microUSB cable to the power port on the Raspberry Pi. 

​

Plug the Pi NoIR camera into the camera slot on the board per these instructions. You can check that the camera works by opening up the Python IDE (which comes with the Debian OS) and writing this quick Python program:

 

from picamera import PiCamera

from time import sleep

camera = PiCamera()

camera.start_preview()

sleep(10)

camera.stop_preview()

​

Source: https://www.raspberrypi.org/learning/getting-started-with-picamera/worksheet/

 

In the creator's instructions, they recommend using jeweler's pliers to adjust the focus on the camera. However, I found that the newer camera models come with a small adjustment tool that you can use to adjust the camera's focus, so there is no need to remove the glue around the lens to adjust its focus. The creator's instructions suggest setting the focus to 8 cm. I did this by putting a sticky note with a circle drawn on it on a ruler, sticking up, 8 cm away from the camera. I ran the program that is listed above and adjusted the focus on the camera with the tool until the circle was in focus. (You may want to increase the sleep time from 10 seconds in the program above to 60 seconds or more to give yourself enough time to make adjustments.)

​

4. Setup the LEDs and Tactile Switch

​

The creators did not really provide for a good way to assemble the white and infrared LEDs, along with their resistors and the tactile switch, so I decided to put all of these components on a small breadboard. I used male to female jumper cables to connect the breadboard to the Raspberry Pi. I have included a pinout diagram of the Raspberry Pi below to help with the wiring. Please note that when the creators' instructions refer to GPIO pin 23 (also written as GPIO23), that corresponds to pin 16 on the diagram. I have also included a diagram showing how to distinguish between the anode and cathode of an LED. Based on the camera program that the creators included in their instructions, I connected the components as follows: 

​

  • White LED

    • Anode:​ 3.3V power (pin 17)

    • Cathode: GPIO 23

  • Infrared LED

    • Anode: ​3.3V power (pin 1) 

    • Cathode: GPIO 22

  • Tactile switch

    • Side A:​ GPIO 17

    • Side B: ground

    • Sides are interchangeable!

​

Notice that I kept the LEDs as close to the camera as possible so that they would help illuminate the field of view during the photograph. The infrared LED is kept on while the user is setting up for the shot. The infrared light is not detectable to the naked eye so it doesn't irritate the patient but it does help the user find the best orientation for the image, because the camera can detect the light. Once the user is ready to take the picture, they can press the tactile switch and the IR LED will switch off and the white LED will flash. Since the IR LED is kept illuminated most of the time, a resistor is wired in series with the LED to prevent the LED from being damaged by the voltage. â€‹

​

bottom of page