# microprocessor -ADC - voltage measurment

#### majoritical

Joined Nov 20, 2007
12
Hi guys,

I'm quite new to practical electronics design and would be needing your help.

I need to measure voltage ratings of a device and send this information to a microprocessor.

I was thinking of linking up a meter with an interface, but I heard this is possible with the use of an Analog Digital Converter?

Secondly, my device is meant to be switched off when this voltage measurment is taken, so I need to supply a signal voltage of some sort to capture the voltage rating.

Any ideas on how this could be done?

#### beenthere

Joined Apr 20, 2004
15,819
You will need to expand on you r post before we can follow along.

What are the ranges of voltages? That has a lot to do with your question about supplying a test voltage.

What accuracy is needed in the A to D conversion? If ,say, you are measuring 45 volts, what additional fraction of a volt is significant?

The project may be quite easy, or somewhat complex, depending on the requirement.

#### majoritical

Joined Nov 20, 2007
12
The voltages to be measured will range from 2 to 37 V, and as a result, voltage

accuracy should be about +/- 0.5v.

#### beenthere

Joined Apr 20, 2004
15,819
That's a fairly coarse measurement, so a 8 bit A to D would do. You will have to tailor the test voltage to fir the A to D's input - usually 5 volts or 10 volts full scale. That's assuming the full applied voltage has to be converted - recall that we have no idea of what you are testing or how.

What about the microprocessor? What animal is it? Do you want it to control the test as well as take in the data?

#### majoritical

Joined Nov 20, 2007
12
That's a fairly coarse measurement, so a 8 bit A to D would do. You will have to tailor the test voltage to fir the A to D's input - usually 5 volts or 10 volts full scale. That's assuming the full applied voltage has to be converted - recall that we have no idea of what you are testing or how.

What about the microprocessor? What animal is it? Do you want it to control the test as well as take in the data?
I'm trying to measure voltage requirements of general electronic devices e.g. PDA, laptop etc.

The microprocessor is likely to be an 8051 as I've been able to gather more resources on it, but that could still be changed.

All the microprocessor does is receive the measured voltage and then triggers an output resistance that is connected to another circuit it is part of.

Could you possibly help with materials on doing the A to D conversion and actual schematics and/or codes?? Also is it possible to

apply the signal voltage to get the voltage requirements of these devices (for those without batteries)..

Cheers

#### GS3

Joined Sep 21, 2007
408
I need to measure voltage ratings of a device and send this information to a microprocessor.
I have no idea what you mean by "measure voltage ratings". You can measure voltage but "voltage ratings"?

At any rate. One of the simplest ways to do ADC is to use a timer or oscillator with period or frequency proportional to voltage and then have the processor measure period or frequency. A simple 555 timer and a few other components can do the trick.

#### majoritical

Joined Nov 20, 2007
12
I have no idea what you mean by "measure voltage ratings". You can measure voltage but "voltage ratings"?

At any rate. One of the simplest ways to do ADC is to use a timer or oscillator with period or frequency proportional to voltage and then have the processor measure period or frequency. A simple 555 timer and a few other components can do the trick.
Sorry about that. Meant measure Voltage.

As its possible, could I possibly get already existing schematics, or materials to

Cheers

#### beenthere

Joined Apr 20, 2004
15,819
It would be good to have a better idea of the concept "voltage ratings", as you employ it. You mention commercial devices - all of which have published voltage and current ratings.

There are lots of variations on the venerable 8051 around. You will need to incorporate a PIA or VIA with it in order to do the A to D conversion and the other control, as they don't interface directly to the outside world.

#### mrmeval

Joined Jun 30, 2006
833
I was thinking that you could use an arduino http://www.arduino.cc/ but don't know how to convert something like 0 - 40v to 0 to 5v

#### majoritical

Joined Nov 20, 2007
12
It would be good to have a better idea of the concept "voltage ratings", as you employ it. You mention commercial devices - all of which have published voltage and current ratings.

There are lots of variations on the venerable 8051 around. You will need to incorporate a PIA or VIA with it in order to do the A to D conversion and the other control, as they don't interface directly to the outside world.
Yes. The commercial devices have published voltage and current ratings.

However, I need to tell the device I'm designing the voltage requirements of this

devices without manually inputing any value. Hence my need for the ADC, and

microprocessor. Hope I'm clearer?

#### ashokcp

Joined Mar 8, 2007
50
I was thinking that you could use an arduino http://www.arduino.cc/ but don't know how to convert something like 0 - 40v to 0 to 5v
A simple voltage divider can do this (1/8th). By properly setting the division ratio, calculations to get the readings can be simplified. For example, if a 12bit ADC is being used with 5V for full scale reading (4096), you could provide a divider to give 5V at 40.96V, and, the ADC reading in counts can be divided by 100 (shifting decimal points) and called measured voltage!

#### beenthere

Joined Apr 20, 2004
15,819
Sadly, I am even less able to see what you are doing.

#### mrmeval

Joined Jun 30, 2006
833
Would you have a schematic for that?

A simple voltage divider can do this (1/8th). By properly setting the division ratio, calculations to get the readings can be simplified. For example, if a 12bit ADC is being used with 5V for full scale reading (4096), you could provide a divider to give 5V at 40.96V, and, the ADC reading in counts can be divided by 100 (shifting decimal points) and called measured voltage!

#### thingmaker3

Joined May 16, 2005
5,083
<-----/\/\/\/\/----o-----/\/\/\/\/----E

Ratio of R1 to R1+R2 = 5:41

R1 would be on the right in this diagram.