Shop OBEX P1 Docs P2 Docs Learn Events
read dv voltage — Parallax Forums

read dv voltage

nader9nader9 Posts: 9
edited 2010-01-29 22:45 in BASIC Stamp
I'm using BS2 (board of education) and need to read DC voltage between 0-40 for my solar power project and nee a guide line.
cheers

Comments

  • JDJD Posts: 570
    edited 2010-01-28 00:39
    Nader9,

    How much resolution or precision do you need? For example, do you need high resolution like 2.5 V or something more lenient such as integer voltage only.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • nader9nader9 Posts: 9
    edited 2010-01-28 11:31
    One decimal in enough
  • nader9nader9 Posts: 9
    edited 2010-01-28 21:14
    Sorry, I mean Yes and high resolution is required
  • JDJD Posts: 570
    edited 2010-01-28 21:24
    Nader9,

    It would be possible to use a voltage divider to get the voltage to a useable range,·then put that output into a ADC, and then take the reading output of the ADC and multiple it by the same quantity to get the 0-40 range back.

    For example, if you divided the voltage by 10 (9k/1k voltage divider), that·output to the ADC input,·then multiple the output of the ADC by 10 to get the appropriate 0-40 voltage. That should give you a 0-40 with 1V per division. Would·that be enough resolution? What is this project for?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • nader9nader9 Posts: 9
    edited 2010-01-29 08:50
    Yes that would be adequate. The BS2 would be the heart of a solarcell system; read light intensity and position cell board accordingly.

    I know it can be done with a simple circuit without involving BS2, but I also need to monitor voltage output of the cell among other data (like temp. and wind speed) and log the data into a computer via vb.net application.

    I guess I can find a voltage divider diagram within the forum.

    Thank you Joshua.
  • nader9nader9 Posts: 9
    edited 2010-01-29 09:43
    Pls. forgive my ingnorance as I'm not so good in electronics.

    I have a maximum of 40Vdc to measure and need a diagram for connecting an ADC (which type) to BS2.

    rgrds
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-29 14:45
    Read the Wikipedia article on voltage divider for a diagram, formulas, and a detailed explanation (do a web search for "Wikipedia voltage divider").
  • JDJD Posts: 570
    edited 2010-01-29 17:00
    Nader9,

    Since you only need integer numbers then you should be able to use an 8-bit ADC (ADC0831) and you could use the BS2 you already have the Board of Education. As for a diagram, Mikes suggestion will help greatly to figure out the output of the voltage·divider.·Once you know the wiring of a voltage divider, you would take the output and put that into the input of the ADC; reference the datasheet for the correct physical pins to connect. For example for the ADC0831, pins 2 and 3 is the input from the voltage divider. I hope this helps

    ADC0831 [noparse][[/noparse] datasheet ]:
    http://www.parallax.com/Portals/0/Downloads/docs/prod/datast/dsadc0831.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • nader9nader9 Posts: 9
    edited 2010-01-29 22:17
    So a voltage divider is needed because the ADC0831 cannot READ more that 5Vdc on pins 2 and 3. If this is true, then I'm off to order the part and try it.

    If R1=1K and R2=140 then Vout=4.912 .... So all what I need now is a code to get data from ADC and then play with a formula to get the orijinal reading.
  • JDJD Posts: 570
    edited 2010-01-29 22:31
    Nader9,

    Excellent, when you are done you can post in the completed projects forum; it's always nice to see members projects completed.

    Parallax Forums [noparse][[/noparse] completed projects ]:
    http://forums.parallax.com/forums/default.aspx?f=21

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • nader9nader9 Posts: 9
    edited 2010-01-29 22:45
    Thank you all
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-29 22:45
    Not only that the ADC0831 cannot READ more than 5V, but it can be damaged if you apply more than 5V to it. The ADC0831 datasheet shows how much you can apply to the various pins (under Absolute Maximum Ratings). It's probably slightly more than 5V. Most IC inputs have protective diodes to the 5V bus and ground bus on the chip. These diodes can handle a limited amount of current before they're (and the rest of the chip is) damaged. See Note 4 on page 6 of the datasheet.

    The 1K resistor would not be high enough to limit this "fault" current if something happens to the 140 Ohm resistor or the connection to it. You can use multiples of the values of the resistors in the voltage divider. I would suggest at least 10K and 1.3K. With a 40V input, this would limit the "fault current" to about 4mA which the ADC0831 can withstand according to the datasheet note.
Sign In or Register to comment.