Electronic – Microcontroller Adjustable 2A 24V Constant Current Source


I need to come up with a method to provide a microcontroller-adjustable, regulated current ranging from 0-2A at ~24V to a load in a closed-loop fashion. I have been researching this issue for awhile and have found a few ways that it could be achieved, each has its issues. I was hoping to lay out my thought process and different approaches and get feedback as to whether I may have overlooked something obvious or if I am going about this entirely the wrong way. Thank you.

Method 1 – Purchase a constant current LED driver IC

This seemed like the most obvious solution. It would have the benefit that I would not need to setup external current-sensing to implement closed-loop control as would be needed with the other two choices. However, I had trouble finding LED drivers that could handle 2A at 24V on a single channel as I browsed DigiKey. If any exist I would be very happy to have a part number.

Method 2 – Convert a voltage regulator into a current source

Unable to find a suitable LED driver I did some more research and came across this instructables which looked like it would achieve what I needed. The problem I ran into here was that this design and others like it use a small resistance (on the order of 10's og ohms) potentiometer for current adjustment. My system, in order to be closed loop, would need to use a digi-pot which do not exist at such low resistances due to limitations of their construction.

Method 3 – Construct using an Op-Amp and Transistor(s)

Finally, after the previous two failed attempts I went back to the drawing board. I came across other StackExchange questions like this one, the accepted answer for which used an op-amp and some type of transistor (the comments on the answer go through a variety of different choices from MOSFETs to Darlington pairs). This seems like it would work for my purposes but I have limited experience in this area, is there a particular transistor type that would be far superior in this application? Also, will I need to take into account the gain of the transistor or is that handled with the feedback from the sense resistor?

To conclude, my question is two fold:

  1. Is there a way to achieve my stated goal using one of first two methods I mentioned which I may have overlooked?
  2. Is there a particular transistor type that I should be using for method 3 if my goal is to be able to set the current for the load anywhere in the 0-2A range, not simply an on-off switch?

Thank you very much for taking the time to read my question and provide answers. Do not hesitate to request clarification on anything I said!