Electronic – Pulling analog DC output from a laptop

analoglaptoppower supply

I am using a laser source that can accept analog input (0-5 V) to set light intensity levels. The input impedance of this driving voltage is 50 Ohms. Typically this is connected to a function generator to create sinusoidal modulations of the light level.

I don't care about AC light signals; I just want to set a DC light signal by providing a level somewhere between 0 (off) and 5 Volts , and I want to be able to do this remotely.

I could use an Arduino or Labjack to drive this signal, but I was wondering if there was a component-free solution that could just use the laptop, analog circuit elements, and some programming.

A couple of ideas I daydreamed about were:

  1. Program the speakers to play a tone that I could connect to the laser source via the headphone jack. (Soft tone would be faint light, loud would be bright). This would seem to involve a bit of work as the headphone jack voltage is too low (~0.3 V) and the output impedance is also about 10 Ohms.
  2. Program the RS232 port in conjunction with a voltage divider. This would involve a bit of work as I don't know how easy it is to program pins directly.
  3. Program the USB output power. After googling around for a bit, this seems tricky to do with Windows.

If anyone has a good idea how to generate an analog 0-5V output from a computer, or could comment on the ideas above, please advise.

Best Answer

You would need a cable of some sort to connect ANY type of solution to the laptop so consider starting with a cable of the type suggested in the answer by @TonyM. Such cable could be the TTL-232R-5V-WE available from the likes of Mouser.

This cable is a USB to serial port converter with 0-5V swing at the output signals. It can also source current from the the laptop USB port out a 5V pin. My proposal is a bit simpler that that posed by the other answers. The idea is to use the serial port TxD line to provide a poor mans PWM to the end of the cable. You can send appropriate characters out the serial port such that the average output if mostly low, mid-range or mostly high. For example for mid range send 'U' characters (0x55), for lows send out NULs (0x00) and for highs try DELs (0x7F).

The TxD waveform can then be fed through a series diode into a low pass filter. The filter would have its own discharge resistor to establish the low level bias of the filter output. The baud rate at which you stuff data out to the TxD pin would want to be high with respect to the time constants of the low pass filter. This filtered signal would then be used to drive the input of an op-amp driver component that is powered from the 5V line and capable of driving the input impedance of the laser device. A rail to rail output op-amp is the best choice here.