Jason,
I'm not trying to discourage you, but perhaps you might want to start with a more basic problem to learn first? My understanding from your post is that you don't have a good grasp of basic electronics - this isn't a problem, because everyone must start somewhere, but laser diodes are notoriously unforgiving for mistakes.
Ok, so here's a few pointers to help you get started. You didn't indicate what your ultimate goal is, so I can't comment on whether what your doing will accomplish it.
When working with diode lasers, be very careful as ESD (electro-static discharge) can permanently damage them. Always ground yourself (use a grounding strap, or keep in contact with a metal desk or something like that). Secondly, you might consider placing a LED in place of the laser diode in order to test your circuit first. The LEDs are much more forgiving and that will allow you test things first.
From the Sparkfun laser you linked to, it appears that is a prepackaged unit that you give a "2.5V to 4.5V input voltage" in order to power it. The potentiometer on the laser will control how much current it draws, but any pin on your Arduino will not be able to source that much power. It also appears that that unit does not make it easy for you to cut it on and off via a I/O pin on the Arduino. If you want to be able to control the light via a I/O pin, you'll need something more like this: http://www.sparkfun.com/products/8654
A few comments about your circuit questions:
- The 5 mW listed on that particular laser diode is the optical power output at 532 nm. This particular diode converts 1064 nm light (infrared) to 532 nm. This conversion process, is very inefficient. That's why the electrical power you came up with (>1W) is very different from the optical power (5 mW).
- The position of the transistor in the circuit does definitely matter. But, if you were doing a simple circuit with a battery, resistor, and the LED, it wouldn't matter which order they were in. Transistors complicate things.
- It is not possible to measure the current between 5V and GND without a load. Without a load, there's no current and no way to measure it. If the 5V is coming from the USB port, it usually can draw a few hundred mA. I haven't looked at the UNO schematic, but drawing this much current from the 5V supply might cause the Arduino to be starved for current and "brown out."
If you hooked the laser directly to the 5V pin, when the laser is only rated up to 4.5v, that's a likely cause for why it burned up. Perhaps if you described exactly what you want to do, and drew a picture of what you tried, you'd get better help?
Yes, it's possible. If you want to build a 7 to 128 demux with 3-to-8 and 4-to-16 demuxes, then put the 3 high bits of your output address into the 3-to-8, and use the outputs of that as the input enable to the individual 4-to-16 demuxes (assuming that it has an enable pin), so the output #0 on the 3-to-8 would go to the input enable of the first 4-to-16 demux, the output #1 would go to the second, etc.
Then you send the lower 4 bits of the address to all of the 4-to-16 demuxes. Ultimately you should get one wire high as a result out of 128.
Best Answer
The transistors are needed if the current required to drive the LEDs is higher than the microcontroller can handle. This means either a single pin current rating, or the maximum rating for all the pins together (will be given in the datasheet)
Most typical 5mm and 3mm LEDS have a maximum current rating of around 20mA and can be driven directly from a microcontroller pin (10mA is fine for most applications)
However, if your microcontrollers maximum rated current is 200mA and you want to drive 20 LEDs at 15mA, then even though the individual pins can supply the current you are out of spec for the maximum current rating.
The LEDs should always have a current limiting component (e.g. resistor) in place when driven from a voltage source, so you are right to suspect the first link. It appears that it is simply relying on the pins drive not being high enough to cause damage to the micro or the LED, which is definitely not a good idea.
Here are the the Absolute Maximum Ratings for the ATmega328. Notice there is a per pin current rating and also a maximum total Vcc current rating:
Also see notes 3 and 4 on pg.314:
Also, you can get high power LEDs with current ratings of >500mA, so a transistor is obviously the only option in this case.