Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

ADC Vref

ADC Vref

2007-12-12 by Steven Hodge

I would like to measure voltages using the ADC on an AVR (ATmega644P
specifically), but voltages higher than AVcc.  I gather from the data sheet
that AVcc cannot be greater than Vcc by more than 0.3 V.  I intend to use
Vcc = 3.0 V, so that implies AVcc needs to be essentially Vcc. I'm OK with
that, but I need to measure voltages in typical "12 VDC system" range, ie,
11 - 15 V.  

In fact, nowhere in the main text of the ADC section of the data sheet does
it explicitly state, or even imply (as nearly as I can tell), that Vref
cannot be greater than AVcc.  However, the ADC specification section of the
data sheet lists min & max for Vref as 1.0 to AVcc, but the column heading
has a footnote that says these "values are guidelines only".  So this is all
very confusing to me. 

Can I, in fact, input to Vref a voltage reference value equal to the maximum
of what I need to measure, say 15 V, even though that is well above AVcc?

Or does the spec "maximum" truly imply that Vref cannot, under any
circumstance, be > AVcc?  If so, does that mean the only solution to my
problem is an external voltage divider? 

Thanks for any help.  Steve

Re: ADC Vref

2007-12-13 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "Steven Hodge" <stevehodge@...> 
wrote:

> Can I ... input to Vref a voltage
> reference value equal to the maximum
> of what I need to measure, say 15 V,
> even though that is well above AVcc?

No.

> Or does the spec "maximum" truly
> imply that Vref cannot, under any
> circumstance, be > AVcc?

Yes.

> If so, does that mean the only
> solution to my problem is an
> external voltage divider? 

Yes.  Is that so bad?

Graham.

Re: ADC Vref

2007-12-13 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "Steven Hodge" <stevehodge@...> 
wrote:
> In fact, nowhere in the main text of the ADC section of
> the data sheet does it explicitly state, or even imply
> that Vref cannot be greater than AVcc.  
Perhaps so.  But in the section titled "ADC Characteristics" (way in 
the back of the datasheet) it clearly specifies that Vref may not be 
larger than AVcc and, in the same table, it specifies that AVcc 
must be within 0.3V of Vcc.

Moreover, in the "Electrical Characteristics" section in the box 
entitled "Absolute Maximum Rating" it clearly says that no pin 
(other than RESET/) may have a voltage applied greater than Vcc + 
0.5.

You'll most likely have to use a voltage divider to ensure that your 
analog input voltages remain below the maximum level.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Re: [AVR-Chat] Re: ADC Vref

2007-12-13 by David VanHorn

> You'll most likely have to use a voltage divider to ensure that your
> analog input voltages remain below the maximum level.

You can also use an op-amp to subtract X volts from the input signal,
if you do that properly.  Op-Amps were originally intended as building
blocks for analog computers, afterall.   Another way, less precise, is
to put a zener in series with the voltage, useful for measuring the
automotive range, typically 9-14V. A 9.1V 1% zener shaves that down to
0-5V with small error, and preserves resolution across the range.

Re: ADC Vref

2007-12-13 by smhodge

--- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> wrote:
>
> > You'll most likely have to use a voltage divider to ensure that your
> > analog input voltages remain below the maximum level.
> 
> You can also use an op-amp to subtract X volts from the input signal,
> if you do that properly.  Op-Amps were originally intended as building
> blocks for analog computers, afterall.   Another way, less precise, is
> to put a zener in series with the voltage, useful for measuring the
> automotive range, typically 9-14V. A 9.1V 1% zener shaves that down to
> 0-5V with small error, and preserves resolution across the range.
>

Thanks for the op amp tip.  Steve

Re: ADC Vref

2007-12-13 by smhodge

--- In AVR-Chat@yahoogroups.com, "Graham Davies" <Yahoo37849@...> 
wrote:
>
> --- In AVR-Chat@yahoogroups.com, "Steven Hodge" <stevehodge@> 
> wrote:
> 
> > Can I ... input to Vref a voltage
> > reference value equal to the maximum
> > of what I need to measure, say 15 V,
> > even though that is well above AVcc?
> 
> No.
> 
> > Or does the spec "maximum" truly
> > imply that Vref cannot, under any
> > circumstance, be > AVcc?
> 
> Yes.
> 
> > If so, does that mean the only
> > solution to my problem is an
> > external voltage divider? 
> 
> Yes.  Is that so bad?

Just additional current drains of the order of what the uC consumes 
(especially as I will need to have 3, maybe 4, dividers).  However, I 
only need to sample very infrequently (like every second) so I could 
use mosfets and another output pin to turn on the dividers only when 
needed.

Thanks for clarifying things.  Steve

Re: [AVR-Chat] Re: ADC Vref

2007-12-13 by David Kelly

On Wed, Dec 12, 2007 at 11:47:55PM -0500, David VanHorn wrote:
> > You'll most likely have to use a voltage divider to ensure that your
> > analog input voltages remain below the maximum level.
> 
> You can also use an op-amp to subtract X volts from the input signal,
> if you do that properly.

Yes, "subtract", but remember never to use gain of less than 1. If gain
of less than 1 is desired use a gain of 1 to buffer, then drive a
voltage divider.

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

RE: [AVR-Chat] Re: ADC Vref

2007-12-13 by Cat C

Why never use gain of less than 1?  Stability?  Can't that be sorted out and still use gain of less than 1?

Thanks,

Cat
Show quoted textHide quoted text
> Yes, "subtract", but remember never to use gain of less than 1. If gain
> of less than 1 is desired use a gain of 1 to buffer, then drive a
> voltage divider.

Re: [AVR-Chat] Re: ADC Vref

2007-12-13 by David Kelly

On Thu, Dec 13, 2007 at 10:31:38AM -0700, Cat C wrote:
> 
> Why never use gain of less than 1?  Stability?  Can't that be sorted
> out and still use gain of less than 1?

With a gain of 1 your feedback current equals your input current. With
gain of less than 1 the current through the feedback resistor is greater
than your input resistor and the opamp is not stable. The opamp is
driving more of its own input than its getting from your source.

The stable solution is to use the opamp as a buffer to drive a divider.

Was also suggested one can use opamps to subtract an offset from the
input signal. If one is interested in monitoring a 12V battery with a 3V
AVR one might subtract 9V from the input then divide by 2 so that 12V
sits squarely in the middle of the 0 - 3V A/D range which becomes an
effective 9V to 15V "expanded scale" voltmeter.

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Re: [AVR-Chat] Re: ADC Vref

2007-12-13 by Roy E. Burrage

It can be done, Cat C, but must be done with an inverting amplifier in a 
differential amplifier configuration in order to get the less-than-1 
gain.  This would necessitate either a dual supply with another inverter 
with gain following the differential or a reference offset for the 
differential amp with another inverter with gain following.

It increases the circuit complexity in this instance.  However, 
sometimes it isn't avoidable.  We have a piece of equipment here that 
we've had to do exactly this, kinda, but it's a current converter 
circuit and these are most easily done with an inverter...and with a 
battery supply.  Sooo...

It also requires good operational amplifier design techniques as David 
Kelly states.  Otherwise you will have stability problems that'll come 
back to bite you when and where you don't want them to.


REB



Cat C wrote:
Show quoted textHide quoted text
>Why never use gain of less than 1?  Stability?  Can't that be sorted out and still use gain of less than 1?
>
>Thanks,
>
>Cat
>  
>
>  
>

RE: [AVR-Chat] Re: ADC Vref

2007-12-13 by Steven Hodge

Excellent idea on the "expanded scale" thing.  Thanks.  Steve
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of David Kelly
Sent: Thursday, December 13, 2007 11:15 AM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: ADC Vref

 

On Thu, Dec 13, 2007 at 10:31:38AM -0700, Cat C wrote:
> 
> Why never use gain of less than 1? Stability? Can't that be sorted
> out and still use gain of less than 1?

With a gain of 1 your feedback current equals your input current. With
gain of less than 1 the current through the feedback resistor is greater
than your input resistor and the opamp is not stable. The opamp is
driving more of its own input than its getting from your source.

The stable solution is to use the opamp as a buffer to drive a divider.

Was also suggested one can use opamps to subtract an offset from the
input signal. If one is interested in monitoring a 12V battery with a 3V
AVR one might subtract 9V from the input then divide by 2 so that 12V
sits squarely in the middle of the 0 - 3V A/D range which becomes an
effective 9V to 15V "expanded scale" voltmeter.

-- 
David Kelly N4HHE, dkelly@HiWAAY.net <mailto:dkelly%40HiWAAY.net> 
========================================================================
Whom computers would destroy, they must first drive mad.

 

__________ NOD32 2721 (20071213) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



[Non-text portions of this message have been removed]

Re: ADC Vref

2007-12-14 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "smhodge" <stevehodge@...> wrote:

> ... additional current drains of
> the order of what the uC consumes ...

Ah, so the question is really how can you monitor a 12 volt source with 
a low voltage microcontroller while drawing less than a dozen 
microamps.  I'm not sure how all the op-amp ideas address that, but 
maybe they do.

> only need to sample very infrequently (like every second) so I could 
> use mosfets and another output pin to turn on the dividers only when 
> needed.

If a little compexity is acceptable, this could work.  You'd have to 
figure out exactly where to put the MOSFETS and how to drive their 
gates without getting back into the problem you're trying to get out of.

Graham.

Re: ADC Vref

2007-12-14 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> wrote:

> For this business, you really need
> some software, and some hardware,
> specifically ANALOG!

Agreed.  So, shall we do it?  It seems like an interesting problem and 
it isn't someone's homework.

I would use a P-channel enhancement MOSFET with its source connected to 
the supply being monitored and its drain feeding the top of the voltage 
divider.  The gate would have a resistor to the source to keep the 
MOSFET normally off.  To turn it on, we need an N-channel MOSFET or an 
NPN transistor with source/emitter at ground and drain/collector 
connected to the P-channel MOSFET's gate.  To turn the whole thing on, 
we apply a high level to the drain of the N-channel MOSFET (or switch a 
current into the base of the NPN transistor).  If we pick the right 
parts for low leakage, nothing draws current when it is off.  
Unfortunately, the whole thing may have to be replicated for each 
supply to be measured, but if they are similar in voltage it may be 
possible to share the N-channel/NPN part.

I'd still like to hear from those advocating op-amp solutions how the 
current draw would be less than a resistive voltage divider with, say, 
a 10 Mohm resistor.  We are all assuming the OP doesn't need a heck of 
a lot of accuracy and I hope that's right.

Graham.

Re: [AVR-Chat] Re: ADC Vref

2007-12-14 by David VanHorn

> If a little compexity is acceptable, this could work.  You'd have to
> figure out exactly where to put the MOSFETS and how to drive their
> gates without getting back into the problem you're trying to get out of.


This is why people who do software only, have such a hard time with
microcontrollers.
For this business, you really need some software, and some hardware,
specifically ANALOG!

Re: ADC Vref

2007-12-14 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "Roy E. Burrage" <RBurrage@...> 
wrote:

> Why not just stick with MOSFETs, Graham?

Sure.  An NPN transistor is just an alternative.

> He might also want to use some sort
> of gate/source protection scheme ...

That would depend on the application, which we don't know.

> Why would he not be able to expect
> pretty fair accuracy from your scheme?

He would.  As you say, the on resistance of the MOSFET would be of no 
consequence, so it's just a matter of using the appropriate resistors 
in the divider and a good reference for the ADC.

Some of the other suggestions, though, did not strive for accuracy.  
Again, it may not be necessary in this application.  We don't know 
what the OP hasn't told us.  Recall that his original post didn't 
mention the need to draw almost no power, it was just about what the 
data sheet said about the ADC reference input.

Graham.

Re: [AVR-Chat] Re: ADC Vref

2007-12-14 by Roy E. Burrage

Why not just stick with MOSFETs, Graham?  Use something like a 35 cent 
TP0610 for the the P-channel FET and a 10 cent 2N7000 for the N-channel 
FET.  Leakage currents at that point would be more than likely a 
function of board cleanliness than component leakage.  Overall circuit 
current requirements would also be lower.  Both are in TO-92 packages so 
they wouldn't take a lot of real estate on the board and their ON 
resistances are such that they would have extremely negligible affect on 
the divider accuracy.

He might also want to use some sort of gate/source protection scheme to 
be sure he doesn't let all of the smoke out of his P-channel FETs in the 
event of a transient that might occur on the supply lines.  The OP's 
description sounded like it might be an automotive environment, so 
transients can be a very likely.

Why would he not be able to expect pretty fair accuracy from your 
scheme?  Precision resistors aren't expensive these days and their 
tempcos aren't all that bad either.  But I guess we'd also have to 
define accuracy, percent or PPM.  A small capacitor could be hung across 
the low side resistor to compensate for A/D input sampling current, 
perhaps with a calibrated fudge factor in software/firmware if needed.


REB



Graham Davies wrote:

>--- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> wrote:
>
>  
>
>>For this business, you really need
>>some software, and some hardware,
>>specifically ANALOG!
>>    
>>
>
>Agreed.  So, shall we do it?  It seems like an interesting problem and 
>it isn't someone's homework.
>
>I would use a P-channel enhancement MOSFET with its source connected to 
>the supply being monitored and its drain feeding the top of the voltage 
>divider.  The gate would have a resistor to the source to keep the 
>MOSFET normally off.  To turn it on, we need an N-channel MOSFET or an 
>NPN transistor with source/emitter at ground and drain/collector 
>connected to the P-channel MOSFET's gate.  To turn the whole thing on, 
>we apply a high level to the drain of the N-channel MOSFET (or switch a 
>current into the base of the NPN transistor).  If we pick the right 
>parts for low leakage, nothing draws current when it is off.  
>Unfortunately, the whole thing may have to be replicated for each 
>supply to be measured, but if they are similar in voltage it may be 
>possible to share the N-channel/NPN part.
>
>I'd still like to hear from those advocating op-amp solutions how the 
>current draw would be less than a resistive voltage divider with, say, 
>a 10 Mohm resistor.  We are all assuming the OP doesn't need a heck of 
>a lot of accuracy and I hope that's right.
>
>Graham.
>  
>


[Non-text portions of this message have been removed]

RE: [AVR-Chat] Re: ADC Vref

2007-12-14 by Steven Hodge

Ok, OP back again.  I was away for most of yesterday.

 

Yes, my application is (sort of) automotive.  Specifically it is a boat
environment, which is 12 VDC.  My guess is that in some respects it's not
quite as harsh as automotive, but in others, eg, high power RF transmissions
and need to shield magnetic compasses from EM fields, it is far worse.     I
have many uses for uC's but the specific one that the post was about is that
I have put in a "bow thruster", which is a huge 5.0 KW, 12 VDC motor that
draws about 400 A (which is another story).   This needs to be run from its
own local 12 V battery (an Optima AGM starting type) because to run it from
the main boat's bank in the aft part of the boat, the voltage drops even in
large 4/0 cable would kill a lot of the motor's thrust.   Even so, the local
battery, if the thruster is run too long (like 5-7 minutes), can get drawn
down to the point where its voltage - I'll call it Vb here -- gets so low
the solenoids in its circuitry start to chatter and within a few seconds
fuse together and bingo, motor stuck on and battery completely drained (ie,
major problem).

 

So my intent is to use a uC to monitor the thruster battery voltage, Vb,
when under load and when it gets too low, shut everything down.   One
feature of this is that the uC power supply voltage (Vcc) will come from the
boat's main bank but the voltage to be monitored is the separate local
battery (in other words I'm not powering the uC from the voltage to be
monitored).

 

True I could do this simple task totally in hardware, with a voltage
comparator, but there are other reasons which require using a uC so the
easiest solution is to just have the uC do the voltage measurement.
Obviously not a whole lot of accuracy is required.

 

Regarding voltage divider current drains, my assumption is that from the
data sheets the analog ADC input likes to see 10 Kohms maximum impedance.
For a maximum input to the ADC of Vcc = 3V this implies a current drain
through the divider, regardless of amount of dividing, of 0.3 mA.   Yeah,
heck, compared to 400 A it is quite negligible, but overall I have so many
of these mA to 10 mA to 50 mA drains that they all add up to a significant
24/7 drain on the batteries, and so I have a general philosophy of trying to
minimize these "background" drains if at all possible.

 

I have used VP3203 enhancement mode P-channel mosfets (actually DMOS FET's,
I just loosely call them mosfets) on PCB's in the past and I see no reason
why one of these, with its gate driven directly by a uC output pin, could
not be used to turn on/off the voltage to the divider.  Their threshold
voltage is only 1 V so a 3 V signal from the uC will do the trick.
Leakage current when off should be less than 10 uA.  Connect the gate with a
pull-up to Vb, source to Vb and drain to the top of the divider.   I always
but TVS's and big input capacitors on the power input to any PCB I build and
(so far, knock on wood) haven't had any problem with transients.

 

In some other potential applications, not this particular one, I will have
need to measure 2 or 3 voltages, all well above Vcc.  In this case I would
simply add one of these mosfets to each divider but drive them all  with the
same gate signal from the uC.

 

Am I missing something here?

 

Steve
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Graham Davies
Sent: Friday, December 14, 2007 5:43 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] Re: ADC Vref

 

--- In AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com> , "Roy
E. Burrage" <RBurrage@...> 
wrote:

> Why not just stick with MOSFETs, Graham?

Sure. An NPN transistor is just an alternative.

> He might also want to use some sort
> of gate/source protection scheme ...

That would depend on the application, which we don't know.

> Why would he not be able to expect
> pretty fair accuracy from your scheme?

He would. As you say, the on resistance of the MOSFET would be of no 
consequence, so it's just a matter of using the appropriate resistors 
in the divider and a good reference for the ADC.

Some of the other suggestions, though, did not strive for accuracy. 
Again, it may not be necessary in this application. We don't know 
what the OP hasn't told us. Recall that his original post didn't 
mention the need to draw almost no power, it was just about what the 
data sheet said about the ADC reference input.

Graham.

 

__________ NOD32 2723 (20071214) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: ADC Vref

2007-12-14 by Tim Gilbert

Steve,
We've done a lot of voltage measurement in the aviation world, which is similar to your situation.
Several points:
a.  I wouldn't worry about the 10K input Z for the ADC for such a low frequency signal (DC).  We use 57.6K and 6.11K resistors (1% or better) and have been able to hold +/- 0.1 volt reading without problems.  Yes, that's less than 10K but we've also done boards using Meg ohm resistors and it worked fine. Note that we use an external voltage reference since you can't count on Atmel's internal one being consistant from chip to chip.  We've built a board that used a Atmel 169 picopower and a bare glass LCD.  With the display on, it used an average of 25 uA (if my memory is correct) and displayed time and voltage.

b.  Isn't there some sort of a master switch that turns off all the power to this tiny little motor?  (I could resist the dig, since we deal with jet engines.)  Couldn't you put your voltage divider on the other side so it's shut off when the boat is shut off?  BTW, even 50 mA is probably much less than the self discharge rate of the battery.  

c.  I haven't seen any mention of surge protection etc.  I'd assume that you'll get a nasty voltage spike with the motor is turned on/off.  We always include a TVS, fuse and diode on the input.  We've actually had the power pulses from avionics knock out the power supply on our boards.  Watch your grounds.


Regards,

Tim Gilbert
JEM Innovation Inc.
303-926-9053 (office)
303-437-4342 (cell)
720-890-8582 (fax)
www.jeminnovation.com
www.pdksolutions.com
Show quoted textHide quoted text
  ----- Original Message ----- 
  From: Steven Hodge 
  To: AVR-Chat@yahoogroups.com 
  Sent: Friday, December 14, 2007 9:23 AM
  Subject: RE: [AVR-Chat] Re: ADC Vref


  Ok, OP back again. I was away for most of yesterday.

  Yes, my application is (sort of) automotive. Specifically it is a boat
  environment, which is 12 VDC. My guess is that in some respects it's not
  quite as harsh as automotive, but in others, eg, high power RF transmissions
  and need to shield magnetic compasses from EM fields, it is far worse. I
  have many uses for uC's but the specific one that the post was about is that
  I have put in a "bow thruster", which is a huge 5.0 KW, 12 VDC motor that
  draws about 400 A (which is another story). This needs to be run from its
  own local 12 V battery (an Optima AGM starting type) because to run it from
  the main boat's bank in the aft part of the boat, the voltage drops even in
  large 4/0 cable would kill a lot of the motor's thrust. Even so, the local
  battery, if the thruster is run too long (like 5-7 minutes), can get drawn
  down to the point where its voltage - I'll call it Vb here -- gets so low
  the solenoids in its circuitry start to chatter and within a few seconds
  fuse together and bingo, motor stuck on and battery completely drained (ie,
  major problem).

  So my intent is to use a uC to monitor the thruster battery voltage, Vb,
  when under load and when it gets too low, shut everything down. One
  feature of this is that the uC power supply voltage (Vcc) will come from the
  boat's main bank but the voltage to be monitored is the separate local
  battery (in other words I'm not powering the uC from the voltage to be
  monitored).

  True I could do this simple task totally in hardware, with a voltage
  comparator, but there are other reasons which require using a uC so the
  easiest solution is to just have the uC do the voltage measurement.
  Obviously not a whole lot of accuracy is required.

  Regarding voltage divider current drains, my assumption is that from the
  data sheets the analog ADC input likes to see 10 Kohms maximum impedance.
  For a maximum input to the ADC of Vcc = 3V this implies a current drain
  through the divider, regardless of amount of dividing, of 0.3 mA. Yeah,
  heck, compared to 400 A it is quite negligible, but overall I have so many
  of these mA to 10 mA to 50 mA drains that they all add up to a significant
  24/7 drain on the batteries, and so I have a general philosophy of trying to
  minimize these "background" drains if at all possible.

  I have used VP3203 enhancement mode P-channel mosfets (actually DMOS FET's,
  I just loosely call them mosfets) on PCB's in the past and I see no reason
  why one of these, with its gate driven directly by a uC output pin, could
  not be used to turn on/off the voltage to the divider. Their threshold
  voltage is only 1 V so a 3 V signal from the uC will do the trick.
  Leakage current when off should be less than 10 uA. Connect the gate with a
  pull-up to Vb, source to Vb and drain to the top of the divider. I always
  but TVS's and big input capacitors on the power input to any PCB I build and
  (so far, knock on wood) haven't had any problem with transients.

  In some other potential applications, not this particular one, I will have
  need to measure 2 or 3 voltages, all well above Vcc. In this case I would
  simply add one of these mosfets to each divider but drive them all with the
  same gate signal from the uC.

  Am I missing something here?

  Steve

  From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
  Of Graham Davies
  Sent: Friday, December 14, 2007 5:43 AM
  To: AVR-Chat@yahoogroups.com
  Subject: [AVR-Chat] Re: ADC Vref

  --- In AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com> , "Roy
  E. Burrage" <RBurrage@...> 
  wrote:

  > Why not just stick with MOSFETs, Graham?

  Sure. An NPN transistor is just an alternative.

  > He might also want to use some sort
  > of gate/source protection scheme ...

  That would depend on the application, which we don't know.

  > Why would he not be able to expect
  > pretty fair accuracy from your scheme?

  He would. As you say, the on resistance of the MOSFET would be of no 
  consequence, so it's just a matter of using the appropriate resistors 
  in the divider and a good reference for the ADC.

  Some of the other suggestions, though, did not strive for accuracy. 
  Again, it may not be necessary in this application. We don't know 
  what the OP hasn't told us. Recall that his original post didn't 
  mention the need to draw almost no power, it was just about what the 
  data sheet said about the ADC reference input.

  Graham.

  __________ NOD32 2723 (20071214) Information __________

  This message was checked by NOD32 antivirus system.
  http://www.eset.com

  [Non-text portions of this message have been removed]



   

[Non-text portions of this message have been removed]

RE: [AVR-Chat] Re: ADC Vref

2007-12-14 by Philippe Habib

That should be etched in stone and given to each person when they go to pick
up their embedded developer's union card.  I'm mostly a software person and
I'm trying hard to learn as much as I can about hardware in order to be able
to be an effective embedded guy.  I am finding the analog a lot harder to
learn than the digital.

If anyone can recommend any books I'd be grateful.
Show quoted textHide quoted text
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of David VanHorn
Sent: Thursday, December 13, 2007 7:06 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: ADC Vref

> If a little compexity is acceptable, this could work.  You'd have to
> figure out exactly where to put the MOSFETS and how to drive their
> gates without getting back into the problem you're trying to get out of.


This is why people who do software only, have such a hard time with
microcontrollers.
For this business, you really need some software, and some hardware,
specifically ANALOG!

Re: [AVR-Chat] Re: ADC Vref

2007-12-14 by David VanHorn

On Dec 14, 2007 12:56 PM, Philippe Habib <phabib@well.com> wrote:
> That should be etched in stone and given to each person when they go to pick
> up their embedded developer's union card.  I'm mostly a software person and
> I'm trying hard to learn as much as I can about hardware in order to be able
> to be an effective embedded guy.  I am finding the analog a lot harder to
> learn than the digital.

Digital is just a special case of analog.  :)

> If anyone can recommend any books I'd be grateful.

Art of Electronics, Horowitz and Hill.

Re: [AVR-Chat] Re: ADC Vref

2007-12-15 by Roy E. Burrage

While you're waiting for your copy of Art of Electronics to come in, 
Philippe, you might check this web tutorial out.

             http://ibiblio.org/obp/electricCircuits/

You might also keep in mind that many manufacturers provide a wide 
variety of very good, some better than others, application notes for 
their components.  Never under estimate the value of an application note 
or the value of building some of the circuits to help understand some of 
their concepts.


REB



David VanHorn wrote:

>On Dec 14, 2007 12:56 PM, Philippe Habib <phabib@well.com> wrote:
>  
>
>>That should be etched in stone and given to each person when they go to pick
>>up their embedded developer's union card.  I'm mostly a software person and
>>I'm trying hard to learn as much as I can about hardware in order to be able
>>to be an effective embedded guy.  I am finding the analog a lot harder to
>>learn than the digital.
>>    
>>
>
>Digital is just a special case of analog.  :)
>
>  
>
>>If anyone can recommend any books I'd be grateful.
>>    
>>
>
>Art of Electronics, Horowitz and Hill.
>  
>


[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: ADC Vref

2007-12-15 by Philippe Habib

I am one of those people who learn more hands on than from reading.   
The ideal book would have some explanation, then some suggestions for  
circuits I could build and modify to gain understanding and maybe  
some excercises with answers provided so I could check my understanding.

I also like app notes because they're so hands on and result oriented.

Thanks.
Show quoted textHide quoted text
On Dec 14, 2007, at 7:06 PM, Roy E. Burrage wrote:

> While you're waiting for your copy of Art of Electronics to come in,
> Philippe, you might check this web tutorial out.
>
>              http://ibiblio.org/obp/electricCircuits/
>
> You might also keep in mind that many manufacturers provide a wide
> variety of very good, some better than others, application notes for
> their components.  Never under estimate the value of an application  
> note
> or the value of building some of the circuits to help understand  
> some of
> their concepts.
>
>
> REB
>
>
>
> David VanHorn wrote:
>
>> On Dec 14, 2007 12:56 PM, Philippe Habib <phabib@well.com> wrote:
>>
>>
>>> That should be etched in stone and given to each person when they  
>>> go to pick
>>> up their embedded developer's union card.  I'm mostly a software  
>>> person and
>>> I'm trying hard to learn as much as I can about hardware in order  
>>> to be able
>>> to be an effective embedded guy.  I am finding the analog a lot  
>>> harder to
>>> learn than the digital.
>>>
>>>
>>
>> Digital is just a special case of analog.  :)
>>
>>
>>
>>> If anyone can recommend any books I'd be grateful.
>>>
>>>
>>
>> Art of Electronics, Horowitz and Hill.
>>
>>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>

Re: [AVR-Chat] Re: ADC Vref

2007-12-15 by David VanHorn

On Dec 14, 2007 10:11 PM, Philippe Habib <phabib@well.com> wrote:
> I am one of those people who learn more hands on than from reading.
> The ideal book would have some explanation, then some suggestions for
> circuits I could build and modify to gain understanding and maybe
> some excercises with answers provided so I could check my understanding.
>
> I also like app notes because they're so hands on and result oriented.

AofE has all that, and "Bad idea" circuits for you to look at.
Just don't BUILD them, some would fail rather spectacularly.
If you don't see why it's a "bad idea" then some review would be a "good idea" !
:)

Re: [AVR-Chat] Re: ADC Vref

2007-12-15 by Roy E. Burrage

But Dave...sometimes it's fun to build those circuits, if for no other 
reason than to get a rise out of others.  There's nothing like the 
surprised look on faces as a huge electrolytic capacitor lets loose with 
a bang, a cloud of smoke, and shoots a spiral coil of aluminum foil 
across a room.  But grandpaw also used to say he sometimes worried about 
me...


REB


David VanHorn wrote:

>On Dec 14, 2007 10:11 PM, Philippe Habib <phabib@well.com> wrote:
>  
>
>>I am one of those people who learn more hands on than from reading.
>>The ideal book would have some explanation, then some suggestions for
>>circuits I could build and modify to gain understanding and maybe
>>some excercises with answers provided so I could check my understanding.
>>
>>I also like app notes because they're so hands on and result oriented.
>>    
>>
>
>AofE has all that, and "Bad idea" circuits for you to look at.
>Just don't BUILD them, some would fail rather spectacularly.
>If you don't see why it's a "bad idea" then some review would be a "good idea" !
>:)
>
>  
>


[Non-text portions of this message have been removed]

RE: [AVR-Chat] Re: ADC Vref

2007-12-21 by Steven Hodge

From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Tim Gilbert
Show quoted textHide quoted text
Sent: Friday, December 14, 2007 9:15 AM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: ADC Vref

 

Steve,
We've done a lot of voltage measurement in the aviation world, which is
similar to your situation.
Several points:
a. I wouldn't worry about the 10K input Z for the ADC for such a low
frequency signal (DC). We use 57.6K and 6.11K resistors (1% or better) and
have been able to hold +/- 0.1 volt reading without problems. Yes, that's
less than 10K but we've also done boards using Meg ohm resistors and it
worked fine. Note that we use an external voltage reference since you can't
count on Atmel's internal one being consistant from chip to chip. We've
built a board that used a Atmel 169 picopower and a bare glass LCD. With the
display on, it used an average of 25 uA (if my memory is correct) and
displayed time and voltage.



-- Thanks for the tip.


b. Isn't there some sort of a master switch that turns off all the power to
this tiny little motor? (I could resist the dig, since we deal with jet
engines.) Couldn't you put your voltage divider on the other side so it's
shut off when the boat is shut off? BTW, even 50 mA is probably much less
than the self discharge rate of the battery.

-- good dig [g].  The voltage I need to monitor is the voltage across the
battery.  I need to do this both when the "small" motor is operating and
when it is not.  The battery can be on charge whether or not the motor is on
or even has the power enabled to it.  Thus I can't tie the divider to the
motor on/off.   The "master switch" you refer to will be the SW200 contactor
that Robert directed me to in earlier posts. 

-- and yes  that's true about self-discharge of a 750 amp-hr battery
bank.it's a good reality check.   Mine is equivalent to about a 150-200 mA
continuous drain.   It's surprising, however, how fast all the little bits
can add up, so that's why I pay attention to them.   But, yes, when push
comes to shove I'll probably just use a permanent divider with a total
resistance of 100 K or so and just forget about its 0.1 mA drain.

c. I haven't seen any mention of surge protection etc. I'd assume that
you'll get a nasty voltage spike with the motor is turned on/off. We always
include a TVS, fuse and diode on the input. We've actually had the power
pulses from avionics knock out the power supply on our boards. Watch your
grounds

>  Are you referring to protection on the power input or signal inputs (or
both)?   I always include exactly the 3 things you refer to on power input
and always put protection diodes on any output driving an inductive load
(typically a solenoid/relay/contactor coil).   

Do you have recommendations for signal input, especially ones coming along
"long" wires (like 10 to 30 ft)?

Regards,

Tim Gilbert
JEM Innovation Inc.
303-926-9053 (office)
303-437-4342 (cell)
720-890-8582 (fax)
www.jeminnovation.com
www.pdksolutions.com






[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.