PDA

View Full Version : read dv voltage



nader9
01-28-2010, 06:31 AM
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

JD
01-28-2010, 07:39 AM
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 (http://www.parallax.com)

nader9
01-28-2010, 06:31 PM
One decimal in enough

nader9
01-29-2010, 04:14 AM
Sorry, I mean Yes and high resolution is required

JD
01-29-2010, 04:24 AM
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 (http://www.parallax.com)

nader9
01-29-2010, 03:50 PM
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.

nader9
01-29-2010, 04:43 PM
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 Green
01-29-2010, 09:45 PM
Read the Wikipedia article on voltage divider for a diagram, formulas, and a detailed explanation (do a web search for "Wikipedia voltage divider").

JD
01-30-2010, 12:00 AM
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 [ datasheet ]:
http://www.parallax.com/Portals/0/Downloads/docs/prod/datast/dsadc0831.pdf

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


Joshua Donelson
www.parallax.com (http://www.parallax.com)

nader9
01-30-2010, 05:17 AM
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.

JD
01-30-2010, 05:31 AM
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 [ completed projects ]:
http://forums.parallax.com/forums/default.aspx?f=21

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


Joshua Donelson
www.parallax.com (http://www.parallax.com)

nader9
01-30-2010, 05:45 AM
Thank you all

Mike Green
01-30-2010, 05:45 AM
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.