PCB and schematic for an STM32G431-based Laser Scanning Microscope v2
The above GIFs show a slow zoom into a CD (all the way to the pits and lands), and a rose leaf, respectively. Both were taken with V1 of the microscope.
When V2 (likely V1 too) is powered on, the DAC/PWM pins are pulled high during the boot process. This cannot be fixed through software as far as I know. The effect is that the laser driver circuit is given 3.3v on the DAC line briefly each time the PCB is plugged in. The current then provided to the laser is beyond what it can handle, and while it does not instantly burn out, it gets noticeably dimmer over time as the PCB is power-cycled. This effect is worsed by flashing firmware either with an STLink or through USB, as while in programming mode the pins are also pulled high. Therefore, make sure to disconnect the OPUs before flashing new firmware.
The solution I've found is to add a pull-down resistor to the laser DAC's output. I was able to hand-solder one, but a PCB fix will be required nonetheless as doing so is very finicky.
This issue also affects the VCMs as well. This results in a loose sample being thrown off the holder if one is present on power-on.
Also, U5 and the VCM/DAC_COARSE and VCM/DAC_Y resistors get uncomfortably hot during prolonged operation. This may be exacerbated by using heavier samples that increase the needed current to drive the bottom VCM.
For now, I recommend not directly using the project, and more as a source of inspiration. I am currently working on a new LSM version that fixes these issues (and others), but it will take a while.
Uses two Optical Pickup Units (or OPU), model HOP-150x, one to hold the sample, the other to scan the sample with a laser. Each pickup covers one horizontal axis, while both use the Z axis to focus (bottom pickup for coarse focus, top one for fine focus)
Required parts (V2):
1x 3mm diameter metal rod, preferably 5cm. (I salvage mine from old CD/DVD players)
1x 26pin, 0.5mm pitch, 10cm length FFC with pins on the same side (for bottom OPU) (https://www.aliexpress.com/item/1005004140412156.html works for this and next part)
1x 26pin, 0.5mm pitch, 10cm length FFC with pins on the opposite side (for top OPU)
1x V2 PCB (I had mine entirely manufactured by JLCPCB - I chose as many of JLCPCB's "basic parts" as possible to reduce assembly cost)
1x 3D-printed enclosure (I printed mine using basic PLA on my own printer, but I assume you can also use JLCPCB's 3d-printing service for this too)
1x 3D-printed sample holder (WIP, not ready for prime time)
2x HOP-150x OPUs (I get mine from aliexpress)
Assembly (V2):
To flash the PCB:
Method 1 (requires STLink, allows debugging):
Method 2 (no STLink required, but no debugging):
To install the required packages and load LSM-client, open a terminal in the LSM-client folder and run:
python3 -m pip install -r requirements.txt
Then to launch the software:
python3 LSMclient.py
NOTES:
Credit to https://github.com/kototoibashi/dvd-pickup-microscope-poc and https://github.com/GaudiLabs/OpenLaserScanningMicroscope for schematic ideas and OPU pinout