In this part you’ll install all the software you need, and collect your first SFDI image. This section is broken up into the following steps:
a) Making electrical connections
- The LEDs will be switched on and off by sending a TTL signal from the Arduino to the “modulation” pin of the LED drivers. Start by inserting the 3 LED drivers on the electrical breadboard. Connect the modulation pin for the 630 nm driver to Pin 5 of the Arduino using a piece of solid core wire. Connect the 660 nm driver to Pin 6, and the 850 nm driver to Pin 7.
- If you followed along you should already have power and ground from the 12 V supply running along the rails of the breadboard. Connect all of the driver V+ pins to the 12 V rail and the driver V- pins to the ground rail.
- Connect the ground (GND) pin of the Arduino to the ground rail of the breadboard
- Connect the red wires from the LEDs to the LED+ pins on the driver, and the black wires from the LEDs to the LED- pins.
- Plug the Arduino USB into your computer
- Plug one end of the USB3 cable into the camera and the other into a USB3 port of the computer
- Plug the USB2 cable into the DMD control board USB port, and hook the other end up to the computer
- Plug the HDMI cable into the mini-HDMI port of the DMD and the other end into the HDMI port of the computer
b) Programming and testing the Arduino
The Arduino controls the LEDs by sending a TTL signal to the modulation pin of the LED drivers. The computer communicates with the Arduino using serial commands communicated via the USB.
- Download the Arduino code here
- Open the code in the Arduino IDE browser
- Make sure the Arduino is detected and the port is correct
- Click the “Upload” button
- When uploading is complete press the “Serial Monitor” button on the IDE
- Set the baud rate for the connection as 115200
- Type “1” into the command line in the serial monitor and press “Enter” to send it. The 660 nm LED should come on. Try also pressing “2”, “3”, and “0” to turn on the 730 nm LED, the 850 nm LED, and turn off all the LEDs respectively. If those commands work as expected your wiring was correct and the Arduino is working as it should
c) Preparing the DMD
In this step you’ll configure the DMD to stream patterns from the PC over the HDMI cable without doing any preprocessing to the images. If the preprocessing is included the images will be distorted and you’ll run into demodulation errors.
- Open the control GUI that came with the DMD
- Click the “Pattern Sequence” radio button
- Click the “Pattern Sequence” tab
- Click the “Sequence Settings” tab
- Select “White” as the color from the pull-down menu
- Select “8” as the bit-depth from the pull-down menu
- Click on the G0-G7 block
- Click “Video Port” for the Pattern Source
- The “Trigger Mode” should automatically set itself to “Vsync”, but if it doesn’t then click that
- Set both the “Pattern Period” and the “Pattern Exposure” to 16667 microseconds
- Click “Add Pattern To Sequence”
- Click “Send”
- You will be taken automatically to the “Pattern Sequence Start/Stop/Pause tab
- Click “Validate Sequence” and wait for the green light to appear under “Sequence Validated”
- Click “Play” At this point an image of your Desktop background should appear on the DMD. If not, make sure the computer sees the DMD as an external display and the display mode is set to “extend”
- Click “Save Solution” to save an .ini file with the correct configuration for SFDI
- Click the “Image/Firmware” tab
- Click the “Firmware Build” tab
- Use the “Browse” button to select the existing firmware .bin file. It should be in the install directory for the GUI
- Add a firmware tag along the lines of “OpenSFDI”
- Click the “Select .ini File” button and choose the .ini file you created a few steps ago
- Click “save updates” and name the new file with the extension .bin
- Click the “Firmware Upload” tab.
- Click the “Browse” button and select the .bin file you just created
- Make sure “Skip bootloader” is checked and click “Upload”
- Wait for the upload to complete (ca. 2 minutes)
- You can now unplug the USB. When the DMD boots up it will be correctly configured to stream patterns over the HDMI port.
d) Installing LabView code
The openSFDI platform currently runs on LabView which is, alas, not open source. It should be relatively easy to port over to Python, but I haven’t had the time to do it yet. If anyone out there wants to take it on, shoot me an e-mail at: firstname.lastname@example.org
- Download the LabView software from here
- Open the “testLED” file
- Set the COM port associated with the Arduino and the Baud rate (115200).
- Type 1, 2, or 3 into the box and click “Send.” One of the LEDs should turn on. Test all the LEDs to make sure they can be controlled via LabView
- If everything worked open the “Main” VI
- Make sure the hardware constant for the USB and camera are set correctly
- Press “Start”
- Enter “.05” for the first element of “SFDI Spatial Freq (1/mm)”, “.1” for the second, and “.2” for the third. “Go”
- Make sure striped patterns appear on the DMD
If no patterns appear, one potential problem might be that the DMD is being detected as an external monitor to the left of the main monitor. If you switch it around so the DMD is to the right of the main monitor, it should work.
That’s it for this section. At this point you should be ready to acquire an SFDI data set. Click on Acquisition for a walkthrough of that process.