Electronic – Behavioral current sink in ltspice

loadltspicesensor

In order to simulate a wireless sensor in ltspice, i need to model a load which draws 25mA current for 1sec every 10 min. Rest of the time it draw 40uA. Is there any way to do that?. I tried behavioral modelling but there are only behavioral sources. Instead of drawing 25mA its generating 25mA

Best Answer

For the purpose of simulation, just add a current source with PULSE 40u 25m 600 1m 1m 1 600. The delay ensures it starts with no load, can be set to any value. The pulse width is not exactly 1 s, the precise value would be 999 ms. And if you are concerned about drawing current when there's no output, just add the flag load after the expression. From the manual:

If the source is flagged as a load, the source is forced to be dissipative, that is, the current goes to zero if the voltage between nodes n+ and n- goes to zero. The purpose of this option is to model a current load on a power supply that doesn't draw current if the output voltage is zero. When flagged as a load, the current source starts to deviate from a constant current when the voltage across it drops to 0.5V. The impedance eventually drops to a resistance equal to .25Ω/amp times the value of the current source.

Or you can add a behavioural source with whatever expression you want. Versatility is their game. For example, if V(out) is the output voltage, add a reference voltage source with the same settings as the PULSE() current above, label the node ref, and use I=u(V(out))*v(ref) as the expression. This will only draw the required current while V(out)>=0.

Or concoct your own behavioural load, as the comments mentioned.