I am currently using two cat4101 led drivers to power one led array. I need to flash the LEDS at two different currents so have the drivers set at different currents using different resistors. I have to do this because the PWN interferes with the sensor detecting the light (this is for chlorophyll fluorescence). My question is there a way to digitally do this using one driver? The flash signals are being delivered using TTL and the driver getting to its constant current quickly is very important. Thank you for your help.
If you don't need to switch quicky between the two different currents, a relay should work. Just put a 2nd resistor in parallel with the low-current resistor and switch it in with a relay. I think you need a mechanical relay, because you need a near-zero resistance (and near-zero voltage drop) due to the low reference voltage. You might be able to use a semiconductor (transistor or FET) to ground the 2nd resistor, but you'd have to experiment with resistor values to compensate for the drop across the semiconductor.
You can have several resistors on RSET terminal and switch them separately to ground with MOSFETs or relays, to provide programmable current. And pulse the enable input to do the flashes. Since the RSET voltage is low (about 1.2V, an internal reference), bipolar switching transistors won't be particularly accurate, hence the suggestion of MOSFETs or relays (little reed relays would do). The datasheet seems to hint that the RSET resistance(s) should be close to the package - tight layout might be needed for stability?
Thank you for the replies, I happen to have some mosfets on the way as we speak. I like the idea of using a relay as well. I will have a read and a play around with the set up and see what I can come up with. If I run into any problems I will be back
It looks like your driver uses a resistor to sense current, so I'm not sure why relays/MOSFETs are being suggested? Such are usually a last resort when switching very large currents. The LED driver datasheet says the resistor sees 1/400th the LED current, which is 1A max, so, 2.5mA sense current if my math is correct. I believe the Arduino handle that directly (<40mA), no?
So, why not go back to your original idea of using PWM, but use a suitably large capacitor on the analog pin to smooth 99.9% of the ripple out?
Alternatively, why not just use two sense resistors in parallel, and switch one or both on and off directly with one or two Arduino digital pins?
Admittedly, I am an Arduino and electronics noob, so if this is stupid please explain why so I can learn.