Electronics
Introduction
This guide assumes some basic electronics and soldering ability.
Base board
While prototyping an earlier revision, we developed a board that implements power delivery, the LED drivers, heater control, and some other (now-deprecated) features.
The full board layout and bill of materials suitable for having this board manufactured are available here.
We have been iterating on our hardware features since then. Since we have not formalized them into a new board design yet, instructions for assembly on prototyping boards are available here instead.
LED voltage selection
By default, the HAT’s LED connectors output 20V, which works well for the UV boards but will damage the visible light boards. To fix this, select 5V output on the LED N and S sections:
Camera trigger
The instrument software needs to be able to arbitrarily start and stop camera exposures at any time. We do this by outputting to the camera’s vertical sync or external trigger functionalities, which need to be wired into a GPIO pin on the Pi. The methods for doing this vary by camera:
Vision Components camera
For best results, we recommend the Vision Components IMX183 (grayscale, not the C version). This offers good image quality with the full field of view, potentially enabling tens of thousands of reads per slide.
Using the repeater board
The easiest way to access the external trigger is using their repeater board. Simply connect the trigger input to GPIO pin 6 on the Pi using a jumper cable.
By reworking your Pi
If you don’t have the repeater board, you can instead rework your Raspberry Pi to redirect the trigger input to GPIO pin 6.
Once either is completed, the camera module can be connected normally to the Pi per Vision Components’ instructions.
Pi HQ camera
A Pi HQ camera can achieve adequate results, though we recommend using a grayscale module — i.e. one whose Bayer filter has been removed. We do not recommend performing this removal on your own as it is very easy to accidentally damage the module. Instead, pre-modified modules can be purchased from several third parties.
Once completed, the camera module can be connected normally the Pi.
Andor microscope camera
We have used a Andor Zyla camera during development. While it produces very good image quality, it has a narrow field of view and is not mechanically compatible with our current hardware. External trigger is accessible on a VGA/DE-15 connector (contact Andor support for pinout) and also requires a level shifter as this uses a 5v logic level.
This camera will need to connect to a Windows PC that has the Andor driver software installed and is on the same network as the Pi.
Stepper motor driver
We use stepper motors to rotate the filter wheel and adjust focus. To enable precise control, we opted to connect two sets of dual-channel H-bridges (Adafruit TB6612 breakout board for prototyping) directly to the Pi GPIOs. To make these connections cleaner, we mounted the H-bridges to a prototyping HAT.
While the two motors do end up using 10 GPIO pins total, the wiring is fairly straightforward:
TB6612 breakout | Pi GPIO: Focus | Pi GPIO: Filter |
---|---|---|
AIN1 | GPIO 24 | GPIO 7 (CE1) |
AIN2 | GPIO 25 | GPIO 8 (CE0) |
PWMA | GPIO 5 | GPIO 12 |
BIN1 | GPIO 26 | GPIO 14 (TXD) |
BIN2 | GPIO 27 | GPIO 15 (RXD) |
PWMB | GPIO 5 | GPIO 12 |
STBY | (disconnected) | (disconnected) |
Vcc | 3.3V | 3.3V |
Vm | 5V | 5V |
GND | GND | GND |
Note that GPIO 26 is not actually accessible using any of the through holes on the prototyping HAT. Instead, we have had to connect it directly to corresponding pin on the GPIO header.
The connectors to the motors are basic right angle jumper connectors. When wiring the motors, just make sure that MOT.A is connected to opposite sides of the same winding, etc.
Note that this powers the motors directly from the Pi’s 5V supply, and may draw as much as 1.5A. In our case, the I3A4W008A033V-001-R 5V buck converter provides more than enough power for the Pi and our peripherals.
Temperature control
We maintain the temperature of the slide using a temperature sensor and high-power resistors as heaters controlled using a PID loop.
Temperature sensor
Our software supports two types of temperature sensors to monitor slide temperature: a thermistor or a 1-wire sensor. One of the following temperature sensors should be mounted in the corresponding cutout in one of the heatsinks:
Thermistor and ADC
The thermistor-based temperature sensor is the easiest to maintain, as it does not require any hardware on the heatsink other than the thermistor itself. This greatly simplifies heatsink maintenance and replacement.
It does require a separate circuit to power the thermistor as part of a voltage divider and a ADC to read the value. For prototyping, we have been hand-soldering an Adafruit ADS1115 breakout board along with the appropriate resistors on a prototyping HAT:
In our application, we replace the Arduino with the ADS1115 ADC. 3.3V is used as the reference voltage instead, and the voltage divider output through the thermistor goes to A0 on the ADC.
1-wire sensor
In the past, we have used a 1-wire sensor to measure the temperature. While this made it easy to implement software to read the output, it required some point-to-point microsoldering to power the sensor. This part would have to be remade if the heatsink that the sensor was mounted to needed to be replaced for any reason.
Heater wiring
The heater consists of resistors mounted directly to the heatsinks. These should be wired together in series and then connected to the output, which is currently on the same 6-pin FFC cable as the 1-wire sensor as shown above. If you are using the thermistor/ADC setup, simply leave the 1-wire sensor disconnected from the FFC cable and do not insert the FFC cable into the heatsink.
HAT feature bypasses
These features use GPIO pins that cannot simply be output to because of functionality on the base board. These will be need to be bypassed.
On the prototyping board for either the stepper drivers or the thermistor ADC, cut the pins corresponding to GPIO 5 and 6 such that the HAT above it will not be connected to them. This is demonstrated above in the stepper motor driver board.