Programmable Current Source

crutschow

Joined Mar 14, 2008
34,469
Yes you can, but the results will wander. A varying non-pulsing (filtered PWM) voltage on the gate will produce a varying current through the LED. The transfer curve will vary with time, ambient temperature, and phase of the moon, and the control voltage range will be relatively small, but still ...
Of course.
I just didn't elaborate on my statement.
I meant that he can't get the constant current results he wanted with that circuit.
So, from the op's point of view, he can't use that circuit. :rolleyes:
 
Last edited:

crutschow

Joined Mar 14, 2008
34,469
Here's an LTspice simulation to illustrate how the PWM circuit works.
The top trace is the PWM LED current pulses with the duty-cycle varying from 0% to 100%.
The bottom trace is the averaged voltage across the current limit resistor divided by 20, giving the average LED current (1mV = 1mA).
The average current thus goes linearly from 0 to ≈100mA as the duty-cycle goes from 0% to 100%.

upload_2017-2-18_11-39-24.png
 

Attachments

Last edited:

Thread Starter

Alexandru Chiser

Joined Feb 16, 2017
44
So... i`m coming back with some changes. I will change the N channel with a P channel (see the picture) (my project manager told me to use a HIGH-SIDE configuration, that meant to change the N channel to a P channel).

Simulare_PWM_LED_highside.png

Now... my question is: what p-mosfet transistor on the market (that can be found on farnell or tme) would you recommend me? (don`t mind the transistor i used in the simulation)
 

crutschow

Joined Mar 14, 2008
34,469
If the amplitude of the PWM signal and the power supply are both 5V as shown, then you need a logic-level type P-MOSFET.
Look for ones with the voltage and current rating you need and where the Rds(on) Test Voltage Vgs is 5V or less.
 

Thread Starter

Alexandru Chiser

Joined Feb 16, 2017
44
Earlier today i had a conversation with a friend (that`s working on the same project, but has a different task) and he gave me this idea, that he said it could help me

It uses 2 MCP6002 (i found only the MCP6001`s ltspice model), a 3V3 pwm output that is filtered by the 2nd order low pass filter. As you can see, i`m unable to simulate if this circuit works, i tried even adding tstart / tstop / tstep for transient (tstep from 0 to 20ms, none of these values worked) but it was in vain...

Any ideas?
 

Attachments

Last edited:

Thread Starter

Alexandru Chiser

Joined Feb 16, 2017
44
LE: it seems that the problem is the MCP6001 op amp. Probably the spice model that i used is not good (don`t know why). I`ve changed it with a LT1007 (just for simulation), and the simulation opened right away. I tried to find an equivalent for MCP6001, but google wasn`t by my side :LOL:
 

crutschow

Joined Mar 14, 2008
34,469
Why do you want to add the complexity of an op amp and filter to your circuit?
Just use an extra transistor to convert the 3.3V PWM signal a 5V PMW signal as below:

upload_2017-2-28_9-47-29.png
 

Attachments

Thread Starter

Alexandru Chiser

Joined Feb 16, 2017
44
Is anyone concerned that his project manager wants to control 50-60 LEDs in an automotive application, using an Arduino?

I must've said something wrong... this part (the 10 LEDs) will be controlled by an arduino (in my case it will be a Teensy 3.5)... at the end of the project we will be using a powerful microcontroller (but it'a a long way to the end)
 

Thread Starter

Alexandru Chiser

Joined Feb 16, 2017
44
For the pmosfet, according to the simulation, the IRF7204 is the one i need. But when i want to buy it i find it only in SO8 capsule...

Is there any equivalent of this transistor, that comes in SOT23 capsule?
 
Top