Electrical – use a 3.3v tolerant microcontroller to drive IR leds that require 5v with a darlington array

circuit-designcircuit-protectionmicrocontrollervoltage

I have a microcontroller that is not 5v tolerant and I need to drive IR leds just like in the attached circuit.

enter image description here


What I thought of doing is using the 5v line from my raspberry pi as the load voltage across the leds and grounding the ULN2003 back to my raspberry pi instead of the other 3.3v tolerant microcontroller.

But I'm wondering if:

  1. If it even matters if I ground the uln2003 to the raspberry pi or the other 3.3v microcontroller? I obviously know that you should not apply a voltage greater than 3.3v to a 3.3v tolerant microcontroller, however, doesn't the voltage drop to 0 at this point, so in theory it should be safe?

  2. like I said before, "I obviously know that you should not apply a voltage greater than 3.3v to a 3.3v tolerant microcontroller." but can you apply a larger voltage to a component thats in a circuit with that microcontroller?


To note: I cannot use the raspberry pi to drive the leds instead of the microcontroller.

Best Answer

You can drive the ULN2003a with 3.3V outputs- they don’t put any voltage onto the driving circuit.

Of course if you mess up the circuit or the grounding your chances of ruining the Pi are much higher than if you use 3.3V only.

You need series resistors for the LEDs and you should make sure that the maximum total current can be supplied by the 5V supply. Since they don’t tend to be grossly overrated it’s unlikely an extra 800mA will be acceptable. Also, in your comment you mention 7 ohms, which would yield several hundred mA and quickly destroy the LEDs and the ULN2003.

If you use an auxiliary supply the ground must be common. Connect the supply ground to the ULN2003 ground directly and that junction to the Pi ground.

If you’re making a PCB there are nifty SOT-23 MOSFETs that have very low voltage drop at 100mA and can be driven directly from the Pi.