Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

LPF Donation via Stripe | LPF Donation - Other Methods

Links below open in new window

ArcticMyst Security by Avery

Driving Laser with Arduino

Joined
Aug 17, 2014
Messages
9
Points
0
Hello all! I'm working on a project to make a laser pulse in Morse code after typing in a message. My problem is that after 3+ weeks of reading forums and (attempting) self teaching, I cannot get the laser diode to even turn on.

What I've got...
Green laser diode with module (3V, 250mA, 200mw)
2N2222 NPN transistor
Arduino Uno
18650 battery (3.7V, 3600mAh)
A bunch of resistors

I've been reading through this thread (link shown below) but still haven't gotten it to work. My guess is that I'm overlooking some obvious factor but for the life of me I cannot find out what it is.
http://laserpointerforums.com/f67/how-drive-green-laser-using-arduino-70770.html
 
Last edited:





ARG

0
Joined
Feb 27, 2011
Messages
6,772
Points
113
Can you draw as a schematic of how it is all hooked up? That would help troubleshoot.
 
Joined
Aug 17, 2014
Messages
9
Points
0
Ok, here it is. I probably should have led with the picture. The LED is the laser module.

f38dpj.png
 
Last edited:
Joined
Jan 14, 2009
Messages
1,452
Points
83
The NPN should really be wired to switch the load to ground , well that's what I think , not supply to load .

Also the arduino has a led on pin 13 on board in most cases so it will not work very well to switch the transistor , use another digital pin instead of 13 .
 
Last edited:
Joined
Aug 17, 2014
Messages
9
Points
0
Ok, thanks. I think I found what the problem is. I replaced the laser module with a simple LED, rewired the whole object, and took some measurements. The voltage passing through the LED was about 3.7V, which is what I'd want. The current, however, was about 200mA; I'm wanting 250mA. Is switching power supplies (the 18650) to a higher current source the only way to get that higher current?
 
Joined
Dec 11, 2011
Messages
4,364
Points
83
It's likely not the 18650 that isn't allowing enough current to the module. The Arduino can only source 40mA of current on an output pin, and pin 13 is already eating a few mA on the built in LED. The NPN isn't seeing full output current from the arduino because it doesn't have a continuous ground as it is supposed to. Right now all the base current has to flow through the LED and through the internal resistance of the battery. Nchannel and NPN transistors should ALWAYS have their Emitters/Sources connected to common ground of the circuit that the Base/Gate is being driven by.

Change it so the NPN is switching the load to ground, first and foremost.

Use a different digital I/O pin.
 
Joined
Aug 17, 2014
Messages
9
Points
0
OK, I'm still pretty new at this terminology; what do you mean by 'continuous' ground, and doesn't the battery and the laser module share the same ground?

OK, so I should move the laser module so that it's + is attached to the right lead of the npn (collector?)?
 
Joined
Dec 11, 2011
Messages
4,364
Points
83
Think of a transistor (any transistor, FET, etc) as two circuits that work together.

1) You have the Base or Gate circuit that consists of the Base and Emitter, or a Gate and Source. Current has to flow into the Base and out of the Source, or voltage has to charge up the Gate/Source junction that acts like a capacitor. To do so you have to have both those points connected continuous in the same support circuit. You can't use the + from one battery on the Gate and the - from a completely separate battery on the Source, there's no connection between the battery circuits, understand?

2) You have the Collector and Emitter or Drain and Source circuits. These are the "switch" circuits. Current goes into the Drain/Collector, and out of the Source/Emitter.

In your diagram above the current going into the Base has to go out the Emitter and then return to the Ground connection in order to control the NPN correctly. Unfortunately, all the Base current has to go through the Diode in order to get to Ground as there is no other connection between Emitter and Ground. This is where your problem lies, and why NPN/N-ch transistors should always have their Emitters/Sources connected to ground (through a resistance is ok, but not through a load!) and the load put between the power rail and the Collector/Drain.

So:

1) connect the arduino output pin to the Base
2) connect the Emitter to the arduino Ground
3) connect the battery - to the arduino ground
4) connect the battery + to the laser +
5) connect the laser - to the Collector

6) profit!: Photons!
 
Joined
Aug 17, 2014
Messages
9
Points
0
Awesome! I'll try this out after I get back from work. One more question, though; the transistor amplifies current proportional to the battery output current, right? The battery's current rating is 3600mAh, so how would I predict the new current?
 
Last edited:
Joined
Jan 14, 2009
Messages
1,452
Points
83
Awesome! I'll try this out after I get back from work. One more question, though; the transistor amplifies current proportional to the battery output current, right? The battery's current rating is 3600mAh, so how would I predict the new current?

3600mAh is just the cells capacity rating , it can supply 3.6Amps for 1 Hour , 7.2A for 30 minuets ect .

The transistor amplifies current based on its base current . Varying the base current will vary the collector - emitter current .

Assuming the transistor hits saturation ( Fully on ) the current will be mainly determined by what the green laser module needs , I think
 
Last edited:
Joined
Dec 11, 2011
Messages
4,364
Points
83
As 555 said the transistor should be in saturation and out of the amplifier mode so it should act like a switch passing whatever current the module needs.
 
Joined
Aug 17, 2014
Messages
9
Points
0
Alright, I set it up as Sigurthr suggested and tested it that way. Result, nothing. So I switched out the laser for an LED diode and it lit up fine. I think the problem is the assembly of the laser module; the soldering was so sketch it broke up pretty easily. Tomorrow I'll be able to solder it together myself and try again. Hopefully that's the only problem remaining.
 
Joined
Dec 11, 2011
Messages
4,364
Points
83
Keep in mind there is a voltage drop of about 1.4V across a NPN transistor between the power line and the load. If your 18650 is only at 3.7V (fully charged is 4.2V) that only leaves 2.3V for the module, which may not be enough for it (some of them require >3V).

If I were you I would proceed next by swapping out the 18650 for three AA 1.5V cells in series for 4.5V. After the voltage drop by the transistor that leaves 3.2V which should be enough for the laser.
 

ARG

0
Joined
Feb 27, 2011
Messages
6,772
Points
113
Keep in mind there is a voltage drop of about 1.4V across a NPN transistor between the power line and the load.

We're talking about from the Collector-Emitter potential, right? Shouldn't that only be ~0.1V in saturation?
 




Top