# A question about a circuit simulation using LM331 in LTspice

I'm trying to convert 0..10V analog voltage to frequency by using an LM331. Since LM331 works at 5V supply, I can scale 0..10V to 0..5V and feed it as the voltage input to the LM331.

I came across this circuit and this forum. I followed the instructions to use LM331 in LTspice and simulated the circuit below:

But I'm getting 5V constant output when I use 5V supply. LM331 should work with 5V supply. But in simulation with 5V it doesn't work. It works when I use 10V supply.

Can someone explain me how this circuit works? I mean C1 and R1 sets the frequency but thats all I know. What else sets what here? How can I set the duty cycle to around 50%? How can I modify this circuit so I can run the simulation for 5V supply?

• The function of the chip is described in detail in section 8.1.1 of the data sheet. – WhatRoughBeast May 17 '17 at 19:05
• Side note: if ncl and nct are just the chip's pins, not the node's labels, then those .ic conditions are useless. If the actual labels are 1 and 5, then you may wish to change the directive to .ic v(1)=0 v(5)=0. – a concerned citizen May 18 '17 at 6:45

## 1 Answer

From page 4, 7.1 Absolute Maximum Ratings table in the datasheet, the range of input voltage is -0.2V to +Vs.

• Yes so I can use it with 12V supply as well then since Vs is max 40V. But on the on the other hand, on the first page it says "Operates on Single 5-V Supply" But it doesnt work at 5V supply in simulation. – user16307 May 17 '17 at 18:42
• While Vs at 5V, did u ensure that your input does not cross 5V? – user3219492 May 17 '17 at 18:46
• Yes sure, I tried 1V 0.1V 2V and 4V for inputs and in all cases output was 5V. Do you think this circuit is correct? I also want more 50% like duty cycles. – user16307 May 17 '17 at 18:48
• The LM331 works by putting out fixed-width pulses and there is nothing you can do to change this. You can, however, follow the 331 with a divide by 2 circuit, using something like a 74HC74. This will give you a square wave at half the frequency. – WhatRoughBeast May 17 '17 at 19:01
• @WhatRoughBeast Do you think the circuit in my simulation is correct? What is that poti for? And are the values of components dependent on supply voltage? – user16307 May 17 '17 at 19:07