0 - 10V input on PIC 16F876


Closed Thread
Results 1 to 19 of 19
  1. #1
    Join Date
    Feb 2008
    Posts
    6

    Smile 0 - 10V input on PIC 16F876

    I have 8 Digital Inputs, and 8 Analog Inputs... I figured out the digital ones, but I need to make those Analog inputs a 0 - 10 Volt input, instead of 0 - 5V...
    I read, if I exceed the internal Diode limit in the PIC of say what, 500 Microamps, the PIC will fail... but say I exceed it, is it possible to make a 10 volt input in the PIC on a different way...
    I read something about a zenerdiode, maybe that helps???
    thanks

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Use two resistors in series (in the 4K ohm - range) as a voltage divider. Connect the PICs A/D input to the junction. That way, your PIC will see an input of 0-5V.
    Charles Linquist

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Charles hit the nail on the head.

    Code:
    0-10v input  ----------+
                           |
                          _|_
                          | |
                          |R|
                          |_|
                           |
                           |
                           +--------- PIC ADC Input (0-5v)
                           |
                          _|_
                          | |
                          |R|
                          |_|
                           |
                           |
                           |
                         Ground
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

  5. #5
    Join Date
    Feb 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    thank you actually it seems quite obvious, why didn't I think of it, but thanks...
    but what if I want to use the 0 - 10 volts as an output...
    it only sends out 0 - 5 volts...
    is there some kind of transistor that when the base opens in the range of 0 - 5V, the transistor slowly opens, and sends out (from collector to emitter) a range of 0 - 10Volts... or is there another way??

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Angry Some have given their time ... but Whhhhhhyyyyy ???

    Hi,

    a little search on this forum could have raised Our Friend Darrel had designed a more than fair tool for such voltage dividers calculations.

    and overall some idiotproof items included ...
    ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by slayerizer View Post
    but what if I want to use the 0 - 10 volts as an output...
    it only sends out 0 - 5 volts...
    is there some kind of transistor that when the base opens in the range of 0 - 5V, the transistor slowly opens, and sends out (from collector to emitter) a range of 0 - 10Volts... or is there another way??
    What do you mean? Take as an input 0-5 and output 0-10Volts?

    Ioannis

  8. #8
    Join Date
    Feb 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    the PIC only sends out 0-5 volts, but the PC needs to receive 0 - 10 volts... just like its sends 0 - 10 volts...
    how can I send a signal of 0 - 10 Volts to the PC, when I use a PIC that only sends out 0-5 volts..

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by slayerizer View Post
    the PIC only sends out 0-5 volts, but the PC needs to receive 0 - 10 volts... just like its sends 0 - 10 volts...
    how can I send a signal of 0 - 10 Volts to the PC, when I use a PIC that only sends out 0-5 volts..
    So.......
    Are you trying to make a digital output (0 or 5v) from the PIC into an analog (0-10v) output to the PC? Why would a PC need to receive 0-10v? (I smell an RS232 question coming up in the next reply)
    For what reason? A PC doesn't usually have an A/D converter on it...at least not one that the average joe can use with any success...unless you've got a PCI/ISA D/A card of some sort.

  10. #10
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default 0 - 10 volt

    A lot of older theatrical dimming systems used 0-10V as a dimming reference. Is this what you want to do? You could use a DAC chip from MAXIM. How much current do you need to source?
    Last edited by krohtech; - 8th February 2008 at 17:11. Reason: oops
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  11. #11
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by slayerizer View Post
    the PIC only sends out 0-5 volts, but the PC needs to receive 0 - 10 volts... just like its sends 0 - 10 volts...
    how can I send a signal of 0 - 10 Volts to the PC, when I use a PIC that only sends out 0-5 volts..
    That is an easy thing to do with an op-amp and a gain of x2. Use on like LMC66x series that are rail to rail capable.

    Now as skimask stated, why a PC would need 0-10Volts?

    Ioannis

  12. #12
    Join Date
    Feb 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    thanks you all, I'll manage it from here...
    I was mistaken by saying I needed the 0 - 10 volts to send to pc, i am making an IO Board, that can be controlled by the PC, the analog output (0 - 10V) of the PIC will be used for controlling, what ever I want to make on that IO board...

    Found info about a IO-Warrior24, that is quite similar to what I am making.

    anyhow, I'll try the op-amp... that'll probably work

  13. #13


    Did you find this post helpful? Yes | No

    Thumbs up

    Quote Originally Posted by Kamikaze47 View Post
    Charles hit the nail on the head.

    Code:
    0-10v input  ----------+
                           |
                          _|_
                          | |
                          |R|
                          |_|
                           |
                           |
                           +--------- PIC ADC Input (0-5v)
                           |          |
                          _|_         |
                          | |        __
                          |R|         /  5V
                          |_|        /\
                           |         --
                           |          |
                           | ________ |
                         Ground
    You should make sure that more than five volts not to be loaded to microcontrollers pin otherwise it could become foul. For example if for any case you have more than 10V as an input you will get more than 5V on the resistor and on PIC as well, so it is not bed to think about some zener diode on PIC ADC input. Or maybe is better to use a scheme with comparator LM239 which will sharply cut any voltage bigger than Vcc ref+ loaded on pin 6 of LM239.

    Regards
    Last edited by Robinzon Kruso; - 11th February 2008 at 10:44.

  14. #14
    Join Date
    Feb 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    ah, yes, I see.... if the voltage over the pin exceeds 5 V, the zener will pull the pin to 0...
    it is yet a prototype, but when I make a final design, I should probably add it for safety...
    thanks...
    I think my prototype is ready for testing, Thanks all

  15. #15
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    slayerizer, The zener does not pull the pin to 0 volts but, starts to conduct at the breakover voltage it is designed for. It will then maintain that voltage as long as the power of the component is not exceeded. In other word it is acting as a limiter....

    Dave Purola,
    N8NTA

  16. #16
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Dave View Post
    ...

    In other word it is acting as a limiter....
    Yes but not like a switch! It is like a normal diode in characteristics slightly steeper. But has a knee. That means if voltage is increasing above about 4,3Volts the zener might start to conduct and spoil the readings of the ADC.

    I may have not stated correctly in engineering terms. If anyone with native english understood, please help here.

    Ioannis

  17. #17
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

  18. #18
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    OK. That's it. Thanks Melanie for the help.

    Ioannis

  19. #19
    Join Date
    Feb 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    well, I'f tested it, and it works pretty wel...
    the zener will be added, as I saw the disadvantage of it when not using. even though the problems facing when using the zener, the voltage never exeedes 10,7 volts because, so... it'll work
    thanks

Similar Threads

  1. Replies: 67
    Last Post: - 8th December 2009, 02:27
  2. input logic threshold level for pic 16F628
    By aratti in forum General
    Replies: 4
    Last Post: - 29th December 2008, 11:35
  3. Midi, Interrupts and Pic better than SX28?
    By Lajko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2008, 00:26
  4. Can a PIC PIC a PIC?
    By afbecker in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd January 2008, 19:55
  5. Little pic trainer for 16F876
    By chkdsk in forum Schematics
    Replies: 1
    Last Post: - 8th August 2004, 17:21

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