I designed a programmable constant current power supply to control two solenoids(electromagnetic).For the solenoid to open and close proportionally(it can move between fully open to fully closed and in between) i need to change the current from 0 Amps to 0.5 Amps under 24V. My problem is after few runs the opamp tend to heat up and it malfunctions(sometimes one valve stop working) and once the op-amp burnt up(literally smoke came out and was split in the middle)

What am I doing wrong and how to fix it ?

FYI: the Arduino and 24V power supply grounds are connected even though its not clear in this diagram.

MOSFET data sheet : https://www.jaycar.com.au/medias/sys_master/images/9346270003230/ZT2468-dataSheetMain.pdf

Opamp data sheet : http://www.ti.com/lit/ds/symlink/lm358.pdf

Solenoids control circuit

  • \$\begingroup\$ It seems like you have shown a resistor for an inductive load and the C1 into 10 Ohms with high gain may have been unstable so a power Darlington would be better suited with 12W heatsink. \$\endgroup\$ Feb 21, 2020 at 0:09
  • 1
    \$\begingroup\$ Plus the 100nF on the output could be degrading the phase margin and causing oscillation. \$\endgroup\$
    – John D
    Feb 21, 2020 at 0:10
  • \$\begingroup\$ @TonyStewartSunnyskyguyEE75 . Yes in the place of load it is an inductive load i left it blank there. The 10 Ohm resistor is the sensor resistor. Since the voltage supplied from Arduino varies from 0-5V at the non inverting end i used the voltage on sensor resistor to control the circuit from 0-0.5 Amps . Isnt that the right way to go ? \$\endgroup\$ Feb 21, 2020 at 0:29
  • \$\begingroup\$ @JohnD I thought the 100nF capacitor stabilise the output since the Opamp is driving a capacitive load(MOSFET gate) \$\endgroup\$ Feb 21, 2020 at 0:32
  • \$\begingroup\$ If it oscillates at 24V into 0.1uF +10R load at high frequency worst case it sees a the cap as a short CCT and a 10 Ohm load @ average 12V drop @ 60mA Isc =720 mW which is the worst case AC series loss at max current if the osc. was symmetrical sine, decouple gate with R to work. \$\endgroup\$ Feb 21, 2020 at 0:43

1 Answer 1


To stabilize the circuit change as follows (X marks the break):

enter image description here

Across the top X add a 100 ohm resistor (to isolate the output from the gate loading)

Across the bottom X add a 1K ohm resistor

  • \$\begingroup\$ Ok thanks for that . Does that mean i have to get rid of the 100nf cap. Im new to electronics so apologies for dumb question but would the 1K resistor at the bottom X change the Sense voltage ? \$\endgroup\$ Feb 21, 2020 at 0:42
  • \$\begingroup\$ No you need the capacitor, the resistors are what make it work, but it could be quite a bit smaller, maybe 10nF or less even. The 1K resistor will not noticeably change the DC feedback voltage because the op-amp input only requires nA and the cap does not allow DC current to pass. \$\endgroup\$ Feb 21, 2020 at 1:01
  • \$\begingroup\$ Awesome !! I'll do that, cheers. Do you think that was the reason the opamp burnt up ? What should I search for(articles or keywords to search for) to understand how the resistors and cap make this setup work better \$\endgroup\$ Feb 21, 2020 at 1:13
  • \$\begingroup\$ Maybe due to oscillation. It's unusual to have those burn up at all, unless supply voltage is too high or reversed. I would also add some capacitors across the LM358 power supply, like 470uF electrolytic in parallel with 100nF ceramic. \$\endgroup\$ Feb 21, 2020 at 10:38
  • \$\begingroup\$ As far as my earlier suggested changes, have a look at this application note for "in-loop compensation". Rx represents the 100 ohm and Rf represents the 1K ohm resistor in my suggested changes. CL is the gate capacitance of the MOSFET. \$\endgroup\$ Feb 21, 2020 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.