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
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.
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.
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.
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.