I'm doing a pretty simple DIY constant load sink for testing batteries. I'm controlling the gate of a MOSFET by two-pole filtering a PWM output from an Arduino MCU to produce a voltage. A couple of extra resistors and a biasing Vbias allow me to level-shift my control voltage to better match the MOSFET's requirements. The MOSFET gate threshold is at about 2V and is fully on around 6V. (Its an IRF3205, but the LTSpice simulation is based on another device.)
It worked on the LTSpice simulation, and worked on the bench where I'd powered it from a load-controlled power supply. But then I moved up to a real battery, and it was great. Until the PC reset the microcontroller. On reset, output PWM pins go high-impedance. But I'd only considered the cases of when they were either HIGH or LOW. Then my bias pulled the MOSFET fully on, and there was some early-morning fun and smoke. (Yes, of course foresight trumps hindsight. Perhaps I should have fused the load circuit after all.)
So I'm looking for some simple ideas. First I need to simulate things better. How do I best create a Voltage Source in LTSpice that can supply a PWM square wave for a while, and then go into tristate / high-impedance mode where it refuses to sink or source current? Then at least I can simulate my situation without having to repeatedly cut wires in LTSpice. I did look at the switch component :-(
And then, what is a nice way (in the real circuit) to either ensure that my biasing Vbias doesn't appear until the microprocessor has booted and gives it the all-clear? Or to clamp the gate until everything is ready. I have spare GPIO control lines in the microprocessor.
The gate-control circuit (PWM to voltage) are all very low-current demands (probably less than 1ma), so I'm reluctant to throw a relay in there to turn my Vbias on or off. Maybe I can switch Vbias on or off with a small signal MOSFET (I have some 2N7000), or a small transistor that is ON by default to lock down the Gate until the software "allows the Gate to follow the MCU output".
Any simple or "cookbook" suggestions?
Thanks
Peter
It worked on the LTSpice simulation, and worked on the bench where I'd powered it from a load-controlled power supply. But then I moved up to a real battery, and it was great. Until the PC reset the microcontroller. On reset, output PWM pins go high-impedance. But I'd only considered the cases of when they were either HIGH or LOW. Then my bias pulled the MOSFET fully on, and there was some early-morning fun and smoke. (Yes, of course foresight trumps hindsight. Perhaps I should have fused the load circuit after all.)
So I'm looking for some simple ideas. First I need to simulate things better. How do I best create a Voltage Source in LTSpice that can supply a PWM square wave for a while, and then go into tristate / high-impedance mode where it refuses to sink or source current? Then at least I can simulate my situation without having to repeatedly cut wires in LTSpice. I did look at the switch component :-(
And then, what is a nice way (in the real circuit) to either ensure that my biasing Vbias doesn't appear until the microprocessor has booted and gives it the all-clear? Or to clamp the gate until everything is ready. I have spare GPIO control lines in the microprocessor.
The gate-control circuit (PWM to voltage) are all very low-current demands (probably less than 1ma), so I'm reluctant to throw a relay in there to turn my Vbias on or off. Maybe I can switch Vbias on or off with a small signal MOSFET (I have some 2N7000), or a small transistor that is ON by default to lock down the Gate until the software "allows the Gate to follow the MCU output".
Any simple or "cookbook" suggestions?
Thanks
Peter