How to drive 0-nV from Arduino's 0-5 PWM

Discussion in 'General Electronics Chat' started by Themusicman, Apr 21, 2017.

  1. Themusicman

    Thread Starter Member

    Apr 2, 2017
    48
    2
    Hey all

    Thinking about how I would be able to drive and control a voltage of 0 to nV (say max 12) from the 0 to 5v of the PWM output from an Arduino. I would want the device to be powered by an external source, and the Arduino provides the source signal, not power.

    Is this best achieved by using say a motor drive module? Or is it easy to build a circuit that talks the Arduino output as its input and subsequently outputs an externally powered proportional voltage.

    I've no specific power rating in mind, just more interested in finding out the best way to accomplish it.

    Any suggestions?
     
  2. AlbertHall

    Distinguished Member

    Jun 4, 2014
    3,627
    823
    Themusicman likes this.
  3. MrChips

    Moderator

    Oct 2, 2009
    13,943
    4,033
    It really depends on your requirements, in particular your max operating frequency and max power.

    There are off the shelf power opamps that can operate at 12V or even higher. For example, LM675 will run on ±30V.
    LM6090 will run on ±70V.

    You can also take any generic opamp and add a driver transistor on the output for higher current and voltage.

    opamp buffer.jpg


    Actually, 12V is not particularly high and most opamps such as the common LM324 can work at 32V.
     
    Themusicman likes this.
  4. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,684
    1,306
    Are you seeking to generate a steady DC voltage proportional to the PWM value, or are you after a way to boost the amplitude of the PWM signal? If the latter, you might consider using a MOSFET driver chip such as the MCP1406/7. These are handy chips, useful for far more than driving MOSFETs.
     
    Themusicman likes this.
  5. panic mode

    Senior Member

    Oct 10, 2011
    1,383
    325
    lookup pickit2 schematic
     
  6. Themusicman

    Thread Starter Member

    Apr 2, 2017
    48
    2
    Fantastic info here folks, thanks.

    I have a few requirements, for different output voltages too, but the first one I am wanting to build and test is a voltage controller for a 4W 5V silicone heating pad.

    So, in that case the max current to be drawn is 800ma.
     
  7. MrChips

    Moderator

    Oct 2, 2009
    13,943
    4,033
    Simple enough. What you want to do is take a 0-5V PWM signal and drive a low-side logic-level N-channel MOSFET.

    IRL540 is a popular MOSFET for this type of application.

    Here is a typical circuit diagram:

    [​IMG]


    Your heating pad would replace the solenoid.
     
    Themusicman likes this.
  8. Themusicman

    Thread Starter Member

    Apr 2, 2017
    48
    2
    Thanks MrChips

    I have a couple of IRF3205's too, would they work?

    Reason for wanting to find out before buying what a logic level MOSFET as you suggest is of impatience!!! You know what us geeks are like, eh. I want to have a bash at this tomorrow :)
     
  9. MrChips

    Moderator

    Oct 2, 2009
    13,943
    4,033
    Give it a go. No harm in trying.
     
  10. Themusicman

    Thread Starter Member

    Apr 2, 2017
    48
    2
    Yep, it works fine!

    Couldnt be botherd to draw up a schematic, but for anyone else who may want info on the IRF3205 MOSFET, here's what I did.

    Circuit: Used MrChips circuit in the post above above.
    Gate - Gnd resistor: Used a 1KΩ resistor on gate-gnd.
    Diode: IN4007 diode across fan
    Fan: 12V, 0.2A

    Manual test1: Vdd 12V, connected the gate to 12V, and the 12V 200ma fan started on full speed.
    Manual test2: Vdd 12V, connected the gate to a separate 5V, and the 12V 200ma fan started on full speed.

    So, I can deduce that 5V output from the Arduino will switch the IRF3205 ON. (though not sure of how much current)

    Arduino test:
    PWM output on PIN9 - fan needed setting of around 25-35 to overcome hysteresis before it started turning - but this could vary from fan to fan.

    So, although the IRF3205 is not a logic level MOSFET, it is sufficient to be used if you don't have any logic level MOSFEt's around.

    I didn't measure the current yet! Might do at some point though.

    There ya go...!
     
  11. MrChips

    Moderator

    Oct 2, 2009
    13,943
    4,033
    IRF3205 works in your case because the Arduino puts out a 5V signal. The key figure you need to look at in the datasheet is the gate-to-source threshold voltage VGS(th) which is quoted as min 2V, max 4V. What this means is that all devices will turn on as long as the VGS voltage is greater than 4V.

    A logic level MOSFET such as IRL540 has lower VGS(th) specs, min 1V, max 2V.
    If your MCU is running off 3.3V supply, the IRF3205 will not turn on fully where as IRL540 will.

    There is no need to measure the gate current. It is going to be very low, less than 100nA.
     
  12. Themusicman

    Thread Starter Member

    Apr 2, 2017
    48
    2
    Awesome, thanks for the pointers. I do have another question for you though if you have some more time to help please.

    I have another fan with 3 wires, +ve, -ve and tachometer. I measured the output voltage at max and then min speed, and the voltage on this wire is 12V with fan off and 1V with fan at full speed. I'd like to measure the RPM of the fan but there's no way I want to put 12V on an input pin of my Arduino.

    So, how do I easily reduce this 12v-1v voltage to one that I can safely input into the analog pin of my Arduino?

    Ta
     
  13. AlbertHall

    Distinguished Member

    Jun 4, 2014
    3,627
    823
Loading...