Switching transistor and current - Page 1
Forum section: electronics / beginners

author: Aethelstan
author_rank: Contributor
timestamp: February 01, 2015, 10:51:54 am
content: Hello, I wish to switch a laser on or off using an arduino pin. I have built a constant current supply using an lm317 and this works, the next step is controlling it. I have sourced a 2n2222 transistor to switch it on and off, but I am unsure if the current supplied to the base is added to the current flowing across the junction. If the supply is set to 375ma and the base has, say 25ma, will my laser diode receive 400ma? I have searched and everything just says the saturated base allows the junction to conduct with no mention where the base current goes. Sorry if this is too basic a question, but I am trying to learn!Thanks

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2015, 12:56:55 pm
content: Quotedepending on how the diode is wired and where you source that 25ma base current.

author: Aethelstan
author_rank: Contributor
timestamp: February 01, 2015, 01:29:55 pm
content: Thanks, I was going to switch the transistor using a pin from an arduino at 5v. I would use a current limiting resistor in between the pin and the base, depending on how much current is added. The current limiting circuit I am using is this onehttp://www.langeder.org/homemade-laser-driver-with-lm317/#comment-1221and I was planning on putting the transistor on the supply before the capacitor and 1n4001.

author: bugs
author_rank: Contributor
timestamp: February 01, 2015, 01:50:37 pm
content: http://arduino.cc/en/Tutorial/DigitalPinsThe pins seem to be able to drive up to 40mA, so 25mA should be OK. Can you draw a schematic of the circuit you intend to make? Perhaps it is better not to replace the switch in the linked page with a transistor. You could try to put it on the `-` side of the laser diode.

author: mij59
author_rank: Frequent Contributor
timestamp: February 01, 2015, 02:30:52 pm
content: Its much easier to use a digital logic n-channel mosfet, its voltage driven and has a low on-resistance.

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2015, 03:24:47 pm
content: QuoteWhat's the forward voltage of your laser diodes?If it is substantially larger than 1.25v, you can use the mcu's gpio pin to control the lm317's adj pin to turn it from a CC driver to a CV driver (with Vout so low that it would not turn on the laser diode meaningfully).

author: Aethelstan
author_rank: Contributor
timestamp: February 01, 2015, 03:39:38 pm
content: The forward voltage is 2.2v, however there is no data sheet so I am having to guess at current. It is a 300mw laser diode and I shall grab a schematic to attach when I get to my computer. I was planning on placing the transistor on the regulated output, but before the 1n4001 and capacitor. I think placing after the capacitor will result in a surge when I switch it on?

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2015, 03:44:46 pm
content: 2.2v will work.Take a lm317, from its output pin wire a resistor to your laser diode -> the resistor here will set the current levels when the laser diode is turned on.From the adj pin, wire a small resistor (110ohm for example - determined by the maximum current you want the mcu's pin to sink) to the laser diode as well.Connect the mcu's control pin to the adj pin directly.Initialize the mcu's pin to output a low.To turn on the laser diode, turn that pin to input; to turn off the laser diode, turn that pin to output.Done.