PWM to const current

Thread Starter

nazmul0087

Joined Mar 29, 2024
15
My controller outputs square waveforms in 5 volts PWM SIGNAL.
I want to change the waveforms into current waveforms with some circuits.
The final output could be 10 milliampere square current waveforms, and the amplitudes will not be changed with different loads. Can any one suggest me a circuit for this?
 

Papabravo

Joined Feb 24, 2006
22,058
You said:"... and the amplitudes [plural] will not be changed with different loads. "


I don't think what you want is feasible. If the current must be constant, and the load can change then the voltage across the load must change if the load does.
 

dendad

Joined Feb 20, 2016
4,635
You really need to supply us with more info. What is the actual load and its expected resistance range?
Is the load floating or connected to 0V?
What power other than the 5V available?
Any more detail will be a help, like links to data for the controller and load......
 

Thread Starter

nazmul0087

Joined Mar 29, 2024
15
Load resistance may vary from 1k to 1000k ; load is floating and i have only 5V available. I am yet to think about the controller. but can produce easily square wave with 50% duty cycle. Kindly suggest if you have any solution.
 

Papabravo

Joined Feb 24, 2006
22,058
Load resistance may vary from 1k to 1000k ; load is floating and i have only 5V available. I am yet to think about the controller. but can produce easily square wave with 50% duty cycle. Kindly suggest if you have any solution.
There is no solution to the problem as stated. If one of the three quantities (voltage, current, and load impedance) is fixed the other two must vary in a predefined way such that Ohm's Law is valid. It cannot be otherwise.
 

dendad

Joined Feb 20, 2016
4,635
Just for an exercise, work out the voltage needed to run 10mA into a 1K load resistor, and then do the same for a 1M resistor.
If you need help, maybe look at...
https://www.allaboutcircuits.com/textbook/direct-current/chpt-2/voltage-current-resistance-relate/

The controller will need to produce a varying duty cycle, not be fixed at 50%.
The supply voltage available will need to be way higher than 5V, although that may be produced from the 5V.

You still have not told us what the load actually is, and why you think it will vary over 1000:1 ratio.
Just a hint, if the load does vary over the 1000:1 range, then the supply voltage to produce the current , however that is generated, will have to vary the same ratio. This is not a trivial design.

And this thing has the potential to be lethal!
 

BobTPH

Joined Jun 5, 2013
11,463
Hmm. 10 mA into 1MΩ.

V = I R = 0.01 x 1,000,000 10,000V
P = V I = 10,000 x 0.01 = 100W

And you only have 5V available. Hope you have a bit more than 20A available.

I’d say not impossible, but certainly not a simple task.
 

Papabravo

Joined Feb 24, 2006
22,058
PWM has a varying duty-cycle.
Is that what you have?
If so then you could use that waveform to control a constant-current transistor circuit.
That is not the way I read the original post, so the TS may have to clarify more precisely what he has in mind. The way I read it was that current would be constant regardless of load and the "amplitude" of the voltage could not change if the load changed. That is why I'm skeptical of the chances for success.
 

MrAl

Joined Jun 17, 2014
13,667
That is not the way I read the original post, so the TS may have to clarify more precisely what he has in mind. The way I read it was that current would be constant regardless of load and the "amplitude" of the voltage could not change if the load changed. That is why I'm skeptical of the chances for success.
To me it reads that the "amplitude" refers to the current amplitude not the voltage amplitude. We'd have to ask about that if it's not.

That means to me, I would say the same thing, simply turn a constant current circuit on and off, more or less.
The compliance will of course come into question and will depend on the design precision.
 

Thread Starter

nazmul0087

Joined Mar 29, 2024
15
Yes I can vary the duty cycle as well if required, I think that may resolve the issue. Can you kindly suggest me how can i design for this ckt if duty cycle is varied.
 

Thread Starter

nazmul0087

Joined Mar 29, 2024
15
To me it reads that the "amplitude" refers to the current amplitude not the voltage amplitude. We'd have to ask about that if it's not.

That means to me, I would say the same thing, simply turn a constant current circuit on and off, more or less.
The compliance will of course come into question and will depend on the design precision.
Yes I can vary the duty cycle as well if required, I think that may resolve the issue. Can you kindly suggest me how can i design for this ckt if duty cycle is varied.
 

BobTPH

Joined Jun 5, 2013
11,463
How can a constant current have a duty cycle? If it is switching on and off, it is not constant by definituon.

You need to explain exactly what is the input and what is the output and what is the mathematical relation between the two.

How does the duty cycle of the PWM input signal affect the output?

If the output is PWM with a constant current during the on part if the period, how does the input duty cycle affect both the output duty cycle and the current. At this point, I can only guess at what you mean.

Is the period significant as well as the duty cycle? To me, the only information of in a “PWM signal” is the duty cycle. The period and amplitude are not part of the signal, and are usually fixed.
 

crutschow

Joined Mar 14, 2008
38,317
As noted, you can't get get 10mA through a load greater then about 400Ω with a 5V supply.
So what's the maximum load resistance you really need to have, while still maintaining 10mA?
 

dendad

Joined Feb 20, 2016
4,635
In your circuit, make R1 10K. And RS is way to low I reckon.
Why do you continue to have....
The controller output is PWM 50% duty cycle
???
To be able to alter the target current, the controller will have to change the duty cycle!
I do not understand you keep wanting 50% duty cycle. That will only give you one current setting so toss the controller and just feed a fixed DC level in.
 
Top