Modulating Laser with a Logic Signal from a Microcontroller

Thread Starter

SScattered

Joined Apr 1, 2024
10
Hi,
I want to modulate a 5v Laser diode that I have with a signal from a microcontroller. I have researched about this and I still couldn't wrap my head around this. I'm an EEE engineer, but currently I'm working as a Robotics Engineer and not much focused on the electronics so I need help in designing this one. This a hobby project of mine.

Objective
My objective is to build a Short Range Optical Communication system.

What I did so far
I already built a prototype using an Arduino and mosfet to control the Laser, but the thing is this way when PWMing the Laser it turns off which reduces the data transfer speed.

What I need
I need a way to modulate the laser without turning it off. I need to apply some offset to the laser when the signal is applied from the microcontroller. For example let's assume that the laser is driven by a 30mA and when the signal is applied I need the current to be around 25mA or something like that. This way I can have more speed when transferring data without turning the Laser off.

It'd be great if anyone can give me some idea on this one. Is there anyway to increase/apply resistance to the Laser with the Logic signal from the microcontroller? Using a transistor connect/disconnect a resistor? Will it affect the modulating speed?!
 

LesJones

Joined Jan 8, 2017
4,511
You seem to want to control the output power of the laser beam and assume that the path loss never changes. For that to work you would have to keep a fixed distance between the laser and the receiver and ensure that there was no mist or anything else that would change the attenuation of the signal path. Using PWM you only need to know if the laser is on or off. On the receive end you convert the duty cycle of the received signal back into an analogue value.

Les.
 

Thread Starter

SScattered

Joined Apr 1, 2024
10
You seem to want to control the output power of the laser beam and assume that the path loss never changes. For that to work you would have to keep a fixed distance between the laser and the receiver and ensure that there was no mist or anything else that would change the attenuation of the signal path. Using PWM you only need to know if the laser is on or off. On the receive end you convert the duty cycle of the received signal back into an analogue value.

Les.
Thanks! Yes, my first 1st step is to have a fixed distance between the receiver and sender. Of course I have to detect the change in current in the receiving side in order to get data. PWM is rather inefficient that's why I need to try and test this new method
 

LesJones

Joined Jan 8, 2017
4,511
I don't think there is a linear relationship between the drive current of the laser and it's power output. You would have to read the datasheet for the laser to find out. I don't understand why you think PWM is rather inefficient. What is the bandwidth of the signal that you need to transmit. I think the speed of the D to A converter in the microcontroller will be much slower than sending the data in digital form.
Les.
 

Thread Starter

SScattered

Joined Apr 1, 2024
10
I don't think there is a linear relationship between the drive current of the laser and it's power output. You would have to read the datasheet for the laser to find out. I don't understand why you think PWM is rather inefficient. What is the bandwidth of the signal that you need to transmit. I think the speed of the D to A converter in the microcontroller will be much slower than sending the data in digital form.
Les.
When I do PWMing the laser turns off for a moment and next it powers up. My understanding is that fully turning off it and turning on introduce more delay and If I'm able to just control the current instead I should be able send data faster.

Currently with my prototype is able to transfer 3Mb in around 2mins. I'm using ESP32 as microcontrollers

In this method I'll be doing the same PWMing and I need this to decrease the Laser current instead turning it on/off.
 

cmartinez

Joined Jan 17, 2007
8,722
You may want to consider using a PWM to Voltage converter, such as this:

1735822158764.png

Laser diodes, of course, are current driven, and NOT voltage driven. So in addition to the circuit shown above, you will need a voltage to current converter.
There are commercially available hobbyists circuits out there at rather attractive prices. You may also want to consider buying one of those before venturing into building your own.
 

BobTPH

Joined Jun 5, 2013
11,463
When I do PWMing the laser turns off for a moment and next it powers up. My understanding is that fully turning off it and turning on introduce more delay and If I'm able to just control the current instead I should be able send data faster.
It sounds to me like you have a laser module with built in driver and you are applying and removing power. Yes, there would likely be a delay before it would come on, limiting its speed.

To get the speed you want, you need to drive a laser diode directly. The on and off delays should be in the microsecond region.

Edited to add: Also why are you using PWM? That is not a communication protocol. The simplest way to do it would be to use UART.
 

Ramussons

Joined May 3, 2013
1,567
Hi,
I want to modulate a 5v Laser diode that I have with a signal from a microcontroller. I have researched about this and I still couldn't wrap my head around this. I'm an EEE engineer, but currently I'm working as a Robotics Engineer and not much focused on the electronics so I need help in designing this one. This a hobby project of mine.

Objective
My objective is to build a Short Range Optical Communication system.

What I did so far
I already built a prototype using an Arduino and mosfet to control the Laser, but the thing is this way when PWMing the Laser it turns off which reduces the data transfer speed.

What I need
I need a way to modulate the laser without turning it off. I need to apply some offset to the laser when the signal is applied from the microcontroller. For example let's assume that the laser is driven by a 30mA and when the signal is applied I need the current to be around 25mA or something like that. This way I can have more speed when transferring data without turning the Laser off.

It'd be great if anyone can give me some idea on this one. Is there anyway to increase/apply resistance to the Laser with the Logic signal from the microcontroller? Using a transistor connect/disconnect a resistor? Will it affect the modulating speed?!
AFAIK, Laser communication is by ON OFF of the laser. Never heard of PWM'ing a laser.
 

ElectricSpidey

Joined Dec 2, 2017
3,312
If you "really" want to drive the LASER with PWM and not have the LASER turn completely off, then that is as simple as bypassing the MOSFET with a resistor.
 

MisterBill2

Joined Jan 23, 2018
27,186
What has never been stated, although I am guessing is the case, is if the "laser" is actually a laser module that includes driver circuitry, or is it an actual laser diode without any external driver circuit.
My guess is that it is a module, and that being a module there is a limitation in the response time. So of course, using an external PWM scheme will not work as desired.

What sort of arrangement is used for receiving the laser signal?? The receive response will determine what sort of modulation scheme can work. What amount of intensity change can be sensed at the desired data rate?? Laser diodes are certainly non-linear, like most other diodes. Having an internal driver circuit makes that even more complex.
What may work well enough is a small amount of Amplitude Modulation, achieved by a small amount of supply voltage modulation to the module. But the effectiveness of that scheme will depend on the ability of the receiving detector to respond to smaller intensity variations.
 

Thread Starter

SScattered

Joined Apr 1, 2024
10
hi SS,
What is the lasing current threshold for the laser type you are using?
What is the required lasing turn On and Off times you are requiring?

E
I'm using a generic Red Laser I purchased locally here.
Currently, I'm able to control the laser to deliver similar around 230400bits/s. Yes, finally I tried using UART instead my own protocol that used PWM.
 

Thread Starter

SScattered

Joined Apr 1, 2024
10
It sounds to me like you have a laser module with built in driver and you are applying and removing power. Yes, there would likely be a delay before it would come on, limiting its speed.

To get the speed you want, you need to drive a laser diode directly. The on and off delays should be in the microsecond region.

Edited to add: Also why are you using PWM? That is not a communication protocol. The simplest way to do it would be to use UART.
The laser I'm using is a generic red one that I purchased here in my country. So, essentially I need to buy a laser diode that don't have any internal circuitry, I see.

First I used PWM, then switched to UART and was stable until I reach speed 230400bit/s
 

Thread Starter

SScattered

Joined Apr 1, 2024
10
That’s pretty good actually. I would not expect to get over 1M with direct control of the laser diode. How much are you looking for?
I was hoping the to at least to reach 900k or higher, but whenever I try go above the 230400, things not working well.

So, I guess my next attempt should be to buy a laser diode that don't have a internal driving circuitry and also check the response rate of my receiver.
 

Thread Starter

SScattered

Joined Apr 1, 2024
10
What has never been stated, although I am guessing is the case, is if the "laser" is actually a laser module that includes driver circuitry, or is it an actual laser diode without any external driver circuit.
My guess is that it is a module, and that being a module there is a limitation in the response time. So of course, using an external PWM scheme will not work as desired.

What sort of arrangement is used for receiving the laser signal?? The receive response will determine what sort of modulation scheme can work. What amount of intensity change can be sensed at the desired data rate?? Laser diodes are certainly non-linear, like most other diodes. Having an internal driver circuit makes that even more complex.
What may work well enough is a small amount of Amplitude Modulation, achieved by a small amount of supply voltage modulation to the module. But the effectiveness of that scheme will depend on the ability of the receiving detector to respond to smaller intensity variations.
Yes, I guess this laser has some internal circuitry. So, using a 3-pin laser diode should give me more control over the laser then? I'm not much familiar with them, I will try searching.

Sorry, I don't have any idea about the receiver response times. It's didn't come to my head to check it's limits. I'll test the receiver and see if the receiver is unable to detect the laser when it's being driven at higher speeds.

Thank you! Will check again
 

MisterBill2

Joined Jan 23, 2018
27,186
To modulate the laser less than 100% (on/off), you can use a transistor across a resistor in the power feed to reduce the voltage from six volts to five volts. That reduced change should not turn the laser off, but only reduce the intensity enough to be sensed by the receiver.
An interesting alternative will be to try modulating a high intensity LED, which will not have an internal driver that limits the response time. If you are using a fiber-optic connection that should not be a problem.
 

Jon Chandler

Joined Jun 12, 2008
1,560
At a recent maker space meeting, a laser audio link was demonstrated. It doesn't get much simpler than this.

In a TOSLINK sender, the LED was replaced by a diode laser.

On the receiving end, a boom box, the TOSLINK receiver connector was disassembled to expose the receiving element.

The link worked well over a distance of about 15 feet, hand-holding the laser end. Alignment is critical and difficult to maintain but the resulting audio was good.

A lens to defocus the laser might be helpful, as might be a diffuser (like from a PIR detector) in front of the receiver.

Just reporting what I observed at a demonstration. It's partially relevant here.
 
Top