I built pretty much the simplest dummy load for testing batteries I found on youtube (EEVBlog #102) , but I modified it little bit. I used 0R1 resistor, because I needed bigger currents from battery (expecting little bit over 2A max). I also use rail-to-rail operational amplifier TS912. I use voltage on sense resistor for feedback to have more control over the current. Also, I use my ATMega32 to control this circuit. It works perfectly in these two "modes":

  1. Constant current: I set voltage on DAC and it sets the current
  2. Constant load: I check battery voltage to calculate DAC output, therefore current to maintain constant load

I need to add PWM switching, switching on/off with ATMega32 and I am desperate to make it work. I tried adding N-channel MOSFET and connecting PWM to it directly, but it did not work. Then I read that I need bigger Vgs voltage and there was this "switching circuit" to make it work- see image. But it can´t possibly work, since PWM is only 0/5V. With 12V supply, P-channel MOSFET is on all the time. Only workaround here would be to find some P-channel MOSFET with Vgs(th) like -8V, but I can´t find any. I could also lower supply voltage, but I am not sure if it works.

I already ordered parts to test it, but in the meantime I still think about it. There is probably different solution to that problem. Can you please help me? What do I use to just simply switch this circuit on/off with PWM?

Thank you,


Edit - So I have been thinking about it and what if I just did not include that "switching circuit" at all, I would just set voltage on DAC with the same frequency as I wanted with that N-MOS. I guess I will definitely try this and the other answer recomendation.

enter image description here

  • \$\begingroup\$ "* I used 0R1 resistor, ... (expecting little bit over 2A max).*" From V = IR we get that your battery voltage is 2 x 0.1 = 0.2 V? \$\endgroup\$
    – Transistor
    Commented Jul 28, 2018 at 14:08

2 Answers 2


If you wish, you can buy logic level mosfets that are intended to be controlled by 3.3v or 5v and use them directly in your circuit. You can also get mosfet drivers with a variety of functions.

Check out a MIC4426/7/8. You can use it to speed up switching and drive the gate of a 10V Vgs mosfet with a logic level (5v) circuit. You do need an additional source at gate drive voltage. You can also get boosting mosfet drivers that create a drive voltage way above the positive rail for you, so you can drive N mosfets on the positive side of the circuit.

  • \$\begingroup\$ With using logic level N-MOSFET only instead this switching circuit for swtiching, will I have to take care about "high-side switching" as well, thus applying higher voltage? When I sumulate it, it works. I guess I will have to wait for my parts to arrive. I will check out these drivers. Thank you. \$\endgroup\$
    – Jakub
    Commented Jul 28, 2018 at 9:27
  • \$\begingroup\$ It would still be a good idea to put a resistor in series with the µController in order to limit the drawn current from the output pins of the µC. \$\endgroup\$
    – Ben
    Commented May 16, 2019 at 16:24

Why not eliminate the whole PWM block in your circuit and just add a NPN transistor that can pull down NMOSFET2's gate to 0? You might need to increase the gate drive resistor a little bit to reduce the maximum current that will be supplied by the op amp.

You should tell us more about exactly what you are trying to achieve. Depending on the PWM frequency, the actual load current while ON may vary from the DAC setting due to the finite servoing speed of the opamp.


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.