+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 5
    Points: 85, Level: 1

    Join Date
    Sep 2014
    Posts
    8
    Helped
    0 / 0
    Points
    85
    Level
    1

    Variable voltage source generation using pic18f4520(5v and 30ma)

    Hi,

    I need to provide 1V to 5V variable voltage to a device to control its operation. and we also want 30 mA.
    I have triaed it using PWM and generated variable voltage but i didnt get the desired current.


    I need to provide a up and down push button which should vary the output voltage from 1 volt to 5 volts.

    What is the the practical method with common components? PWM possible? Click image for larger version. 

Name:	p.PNG 
Views:	8 
Size:	26.4 KB 
ID:	108958

    I can handle a PIC well. But hardware? If We use PWM how to smooth it using op-amp or something?
    Last edited by FvM; 3rd September 2014 at 12:50. Reason: Private email deleted

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 24,015, Level: 37
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,606
    Helped
    1019 / 1019
    Points
    24,015
    Level
    37

    Re: Variable voltage source generation using pic18f4520(5v and 30ma)

    If you use PWM you'll need to use an RC filter. It depends on how much ripple you can tolerate. Some PICs have Digital-to-analog converters-you could use one of those. Or use an external DAC.

    I just noticed, you actually ARE using a DAC. So, why are you talking about PWM?



    •   AltAdvertisement

        
       

  3. #3
    Advanced Member level 1
    Points: 2,880, Level: 12

    Join Date
    Feb 2013
    Location
    Chennai,India
    Posts
    421
    Helped
    38 / 38
    Points
    2,880
    Level
    12

    Re: Variable voltage source generation using pic18f4520(5v and 30ma)

    You can simply do with using DAC. MCP4716 I2C based DAC 5 V output, 25 mA output..



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 5
    Points: 12,735, Level: 27
    Achievements:
    7 years registered

    Join Date
    Nov 2008
    Location
    Norwich, UK
    Posts
    2,123
    Helped
    598 / 598
    Points
    12,735
    Level
    27

    Re: Variable voltage source generation using pic18f4520(5v and 30ma)

    A better alternative to push buttons for incrementing and decrementing the voltage is a rotary encoder, e.g.
    http://uk.rs-online.com/web/p/produc...FSKWtAodCF8AoA

    you feed the A and B signals to a QEI decoder (can be hardware or software) which gives you pulse count and direction



--[[ ]]--