Laser Driver with Arduino?

I'm trying to see the feasibility of this project...My company has this laser and controller:

The unit came with a USB <-> RS232 adapter so that it can be plugged into a computer and controlled with their proprietary software. The software, however, is limited to manually inputting a desired wavelength, clicking a button, and then the output changes to that wavelength.

What I need to do is scan, in say, 0.1 nm increments, over the laser's entire range (or a smaller one). The manufacturer says this is possible, but that we just have to make our own program to do it.

My basic understanding of how the controller works is: there is a lookup table that has the values of 5 variables (TEC current, etc.) associated with a given wavelength. When you type into their program what wavelength you want, it looks up the associated values, and then transmits the serial data to the controller, which then changes all the currents/voltages/etc. I'd like to create a controller/program that does exactly this, but in an automated fashion so that it scans in increments.

I have attached a document that discusses their communication protocol, and the lookup table that their software uses. I understand the basics of serial UART communication with ASCII characters (built a temperature data logger project), but the information in the .pdf is a bit over my head.

So, the most basic version of this would be an Arduino, into which I could plug the laser controller....probably open an Arduino sketch and serial monitor, tell the scan to start via the serial monitor...and it scans once (which could be repeated ad nauseum). Per the .pdf, the baud rate is 9600 bps.

How feasible is this?

FP451x_CommunicationsProtocol_0v0.pdf (420 KB)

DDk041_Mount161008978XY_2D sweep.txt (863 KB)

How feasible is this?

It is what I do in my current line of work.

You don't even need to involve an Arduino. How's that?

It's feasible to write your own software if you can get a good description of the fields in the lookup file from the manufacturer. Assuming that you don't know how to set the parameters properly for a given wavelength...

You will need a level shifter to change the Arduino's TTL Serial to RS232 Serial. The most common is a MAX232 breakout board. You should probably try to find one with an RS232 connector that matches the laser controller, most likely a 9-pin D connector.

Note: Your data table has 10-digit float values. The Arduino is only capable of 6.9 digits so some precision will be lost.

The data table has 22,501lines with 7 values each. It's going to be hard to fit that into an Arduino UNO which only has 32768 bytes of FLASH memory. Fortunately the first, third, sixth, and seventh columns are constants (150, 100, 0, and 2) so you don't need to store them in a table. That still leaves three floats per row and 22,501 rows. Each float is four bytes so about 540 Kb of memory. The Arduino MEGA 2560 has 256 Kb of FLASH so your table won't even fit there. Perhaps you should have the PC program store the table and have the PC program send the parameters to set the frequency for each step.

The unit came with a USB <-> RS232 adapter so that it can be plugged into a computer

My guess is that it would be much easier to write a program for your PC and not use an Arduino at all. Writing programs on a PC is a lot easier. Any of the PC programming languages should be able to communicate over a USB serial port. My preferred language would be Python.

Or is there some specific reason for using an Arduino?


It makes sense that a PC program would be easier...I just mentioned Arduino because that is what I've been learning on (very similar to C++) so I figured I had the best chance of writing code for an Arduino.

I am intending to learn Python -- I recently got a Raspberry Pi to learn with as well. I'm an applied physics guy, and took an introductory programming course back in undergrad (C++). I've gained a little experience with the basics working on Arduino stuff.

Could anyone point me in the right direction on getting started? Are there any tutorials on programming examples for this specific protocol (i.e. the info the the attached .pdf)?

I understand there is a good chance this is over my head. But it's nice to know what I'd need to work towards. Thank you for your responses.



I suppose this is sufficiently difficulty, since you do this as your full-time job? Probably not something a novice/hobbyist could do in a reasonable amount of time?