As my daily job is being a physics PhD student at the Advanced Optical Imaging Group, some good spin-off projects appear which can be released into the open source wilderness. The story starts with a 405nm diode laser, which we installed into a Thorlabs LDC205. The problem with this super controller that there is no RS232 or USB connectivity. Just 3 BNC connectors (1,2,3). As we want to computerize our dSTORM controls, the LDC has to be pimped…
The idea was to use an Arduino Uno R3 to control the driver:
- LD Rem -> TTL logic, Laser On (HIGH)/Laser Off (LOW)
- MOD In -> Set drive current via changing the voltage applied to this connector. (PWM)
- CTL Out -> Get drive current via measuring the voltage on this connector. (A/D)
Here is the manual for the LDC205 for further reading. But I suggest that after calculating the required voltage levels for your setup, you do a fine tuning manually.
Controller commands and functions were inspired by a Cobolt Manual. A LabView vi set is avaliable from their site so there should be no problem in changing them a bit to fit our system.
The arduino uses PWM to generate the “analog DC” voltage. This must be put between quotes, because for the LDC this is not DC. Arduino Pin13 PWM has a 490Hz frequency, and the LDC works up to 10Mhz, so it will see the actual modulation. This is sad, because I don’t want my light source to be modulated. If you measure the channels, it will show up on oscilloscope.
To solve this problem, I had to add an extra Low-pass (RC) filter to the shield. Before doing the calculations, PWM frequency had to be changed to the maximum 31 kHz by adding one line to the setup code:
TCCR2B = TCCR2B & 0b11111000 | 0x01;
This will change Timer2 (which controls Pin 3, 11) frequency divider from the default 64 to 1. Using this calculator it was determined that a 5k3 Ohm resistor and a 1uF capacitor (105) will be sufficient for the job. Noise around 7 mV, setting time below 20ms.
Update #1: DHT22 sensor.
You have to grab DHTlib on your own, and add it to your sketchbook/libraries folder.
Future plans with the project:
Create demo Laser Control Panel in LabView(done) Upgrade the setup with a DHT22 sensor to measure temperature and humidity.(done)
- Resolve undocumented commands, to make it work with a Cobolt Monitor.