Use digital potentiometer and transistor to drive pigtailed laser diode

Hello,

My Arduino board is Uno.

I want to drive 650nm and 405nm pigtailed laser diodes.

I don't want to use PWM, so I choose a digital potentiometer MCP4161 10k ohm.
But the current is not high enough to drive laser diodes,
so I searched from the forum and found that I can use a transistor like PN2222 and 2N3904 .
The reference is How to TTL a laser? - General Electronics - Arduino Forum

My schematic is https://flic.kr/p/LhK1Fh

The step of digital potentiometer is 255.
Then the pigtailed laser diode is the brightest.

When I drive 650nm pigtailed laser diode,
current through the base of transistor is 199uA,
current through the collector of transistor is 30mA,
the resistor between digital pot and base is 19k ohm,
the voltage from the regulator is 3.7 volt.

Now the current for the 405nm pigtailed laser diode is over 35mA.
But the current can't go high anymore.
Batteries are added to 8 volt.
What is the problem of my circuit?
The voltage from the regulator is not enough?
If so, then I can choose different resistor to get a higher voltage out.

Thank you.

The websites are data sheets of
-digital potentiometer MCP4161
http://docs-asia.electrocomponents.com/webdocs/1380/0900766b81380d79.pdf

-transistor 2N3904

-regulator 7805
https://www.fairchildsemi.com/datasheets/LM/LM7805.pdf

The attachments are data sheets of
-transistor PN2222
-650nm and 405nm pigtailed laser diode

My English is not good enough. Sorry about that.
Thanks for helping me solve the problem.

Thank you.

650nm 3mW.pdf (471 KB)

405 3mW.pdf (470 KB)

PN2222A.pdf (279 KB)

The base current controls the collector current. Use a lower value base resistor to increase both.

That is not a good design, because the collector/laser diode current will be strongly temperature dependent. Laser diodes generally require a constant current driver.

Definitely you need constant current circuit, and the right current. Don't expect much range
of adjustment - too much current the device will be damaged, too little and it will become
just an expensive LED, not a laser.

Perhaps you are expecting a linear brightness response from a laser diode? The physics is
against you, they aren't like that.

Almost any use of a digital pot is a mistake here - mostly we see on these forums circuits that are
better done with a DAC and an opamp. The normal exception is controlling an audio signal volume
where you have an analog signal to modulate, not an analog voltage/current to generate.

DACs generate an analog signal, pots modulate an existing analog signal.

Thank you, jremington.
Thank you, MarkT.

Is constant current driver like this?
Imgur

So I should use a DAC, not a digital pot?

Sorry that I didn't mention the use of the pigtailed laser diode.
The laser diodes are the light source, then I will take some pictures.
The shutter time is 250us, and I'm afraid that using PWM(or change the frequency of Arduino pins) will let me have a black picture.
So I need an real analog current, not a digital current.

I'm new to Arduino and electrics.
Thanks for helping me.

There is one thing I forgot to say:
I need to modulate the power of laser diode.
Does DAC can do this? Or just write code to modulate?

As I said, there is a limited range of current for a diode - too much it is fried, too little and it
doesn't lase. This is something a datasheet for the diode would tell you.

Your constant current circuit isn't adjustable(*), so its not appropriate. Typically an adjustable
current source/sink would use an opamp and current-buffer and sense-resistor - the opamp
compares the voltage across the sense resistor to the control voltage and maintains it the same.

For instance the circuit on this page (ignore all the maths!): Nullor - Citizendium

(*) Except by varying the resistor, but that carries the entire load current, so its not practical.