Voltage monitor and PWM control


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default Voltage monitor and PWM control

    I'm going to try build a voltage monitor with the goal of changing PWM depending on the input voltage. I'll need the on board A/D and PWM and the end circuit will have to fit in a pretty small place, so I'm figuring on using the PIC12F683. I can fiddle around with the DIP version before I go surface mount. Is this a good IC for my application? I haven't ordered anything yet.

    Here are my input voltages and calculated duty cycles.

    Vin Duty
    30 0.43
    29 0.45
    28 0.46
    27 0.48
    26 0.50
    25 0.52
    24 0.54
    23 0.57
    22 0.59
    21 0.62
    20 0.65
    19 0.68
    18 0.72
    17 0.76
    16 0.81
    15 0.87
    14 0.93
    13 0.99


    Am I on the right track?

    Next, to tackle the PWM adjusting. Are there any similar projects that I can study? I searched and didn't find anything like what I'm doing or at least, simple enough for me to grasp.

    ~ Dave

  2. #2
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    OK, we might need a bit more info here.

    Is the voltage you want to measure AC or DC ? What's the application - if its in a vehicle you will need to add some voltage spike protection to the sense inputs and power supply lines.

    The 12F683 has a Hardware PWM output from memory so it is really easy to set the duty cycle to the required value and it will stay at that level until it is next changed - have a look in the manual for the HPWM command.

    You will need a voltage divider circuit to allow you to get the full scale voltage into the A/D. Try doing a search on the forums, its been discussed before.

    Bill.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bcd View Post
    OK, we might need a bit more info here.

    Is the voltage you want to measure AC or DC ? What's the application - if its in a vehicle you will need to add some voltage spike protection to the sense inputs and power supply lines.

    The 12F683 has a Hardware PWM output from memory so it is really easy to set the duty cycle to the required value and it will stay at that level until it is next changed - have a look in the manual for the HPWM command.

    You will need a voltage divider circuit to allow you to get the full scale voltage into the A/D. Try doing a search on the forums, its been discussed before.

    Bill.
    It's DC voltage and I'm OK with spike protection, a voltage divider and all of the rest the of the circuitry.

    Through searches on the Internet and this forum and the data sheet, I did find out that the PIC12F683 will do the job, but I need help understanding the programming. I'd like to see a couple of similar projects that monitor voltage and then perform functions based on that voltage. In other words, I'd like to study the code, which has always been my shortcoming, especially with IF, greater than, less than, equal to, THEN, ENDIF and so forth.

    Thanks.

    ~ Dave

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts