Note that this LED can be driven with up to 3100 mA (3 amps!) This would be outrageously bright and entirely useless on the microscope.
I would like to be able to vary the brightness, probably driving the LED with from 0 to 200 mA. In general 50mA is fine, but sometimes at higher power more light is an advantege.
This also led me to a more complex design that perhaps I need. I expected to be needing to control from 0 to 1000 mA, wheras I only need to control 0-200, and perhaps 0-100 would do fine. For that low current I might be able to just use a series potentiometer, especially with a 5 volt supply voltage. The LED drops about 2.4 volts, so only 2.6 volts would get dropped across the pot.
But I worked up a design using an LM358 op amp and a IRF644 power MOSFET in a voltage controlled current sink circuit. My first design used a 2 ohm sense resistor, expecting a max current of 1000 mA. Then I discovered my error with the 56 ohm preliminary resistor and changed to a 15 ohm sense resistor. Now I am having trouble getting the simple current sink circuit to work.
I replicated the circuit I soldered up on my breadboard and see the same trouble there. Interestingly when I replace the IRF644 with a bipolar transistor (I use a TIP41 in the same TO220 package) the circuit works! The only problem I see is that when I set my knob to 0, I still get some current (about 47 mA), which would make my lowest brightness the same as the mid-level I am now getting with the 56 ohm resistor. I would really like to turn the knob to 0 and see the LED go out entirely. And I would like to know why the MOSFET doesn't work.
There is an old saying:
"If you build an amplifier it will oscillate and if you build an oscillator it will amplify."I power up my Rigol DS1054 and take a look at the circuit on the breadboard. I have a 4.87 volt command and I see 1.5 volts on the sense resistor. I measure 5.2 volts on the gate of the MOSFET. These are all DC measurements taken with my Fluke DVM.
I look at the gate signal with the scope and I see oscillation! We swing from 3 volts to 10 volts at 595 kHz. Looking at the sense resistor, we swing from 0 to 6 volts -- at the same frequency of course. So my multimeter is just sort of measuring average values.
It is all about gate capacitance in the power mosfet and an unstable op-amp.
Adding a 1K resistor between the op-amp output and the gate on the MOSFET tames the oscillation. I get nice control, but only for command voltages of 2 volts or greater. With a command voltage of 1 volt, I get 1.9 volts on the sense resistor and 5.8 volts on the gate. I am working on my breadboard, so it is easy to swap parts. I try a different LM358 and now everything works right down to 0.01 volts. With 0.04 volts, we would get 3 mA, so this seems good.
Curiously, now when I remove the 1K resistor (with the new LM358) on the breadboard, I don't get oscillation. Well, it turns out the 1458 is not a LM358 equivalent, it is a dual 741 and is not happy with the gate capacitance hanging on its output -- the LM358 does not mind.
As a note, I can get DIP package LM358 from Digikey for 30 cents each.
So it is all working now on the breadboard. The thing now is to solder a 1K resistor into the gate path on my circuit board and test it. First I put the scope on my circuit board, and see it oscillating at 1.09 Mhz, with swings (on the gate) from 3 to 8 volts. Once I install the 1K resistor, the oscillations go away. But ...
I see the same problem with the op-amp refusing to drive its output to zero. This part is marked UA1458TC. The other one that refused to work properly on the breadboard was a MC1458CP. The one that works is a National Semi LM358N.
The bottom line is that the 1458 is not the same as the LM358. It is not a single supply op-amp. It is a dual 741. So my mistake and wrong assumption. The LM358 is rail to rail, the 1458 is not.
I chop the 1458 off the board, cutting the legs as close as possible to the body of the chip. This leaves all the legs sticking up. Then I fit the LM358 in between those two rows of 4 legs and solder it into place. This is quick and easy and does not disrupt all the point to point wiring under the board.
Best of all, it works now. The 1K resistor may not be needed with the LM358, but it doesn't hurt anything and I don't intend to remove it.
Not testing on a breadboard may boil down to hubris. In the software world, I have learned many times that thinking, "this is so simple, it is just a small change, nothing can go wrong, there is no need to test this" never turns out well.
Tom's Mineralogy Info / tom@mmto.org