Yahoo Groups archive

AVR-Chat

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

Thread

RE: [AVR-Chat] Re: ADC Vref

RE: [AVR-Chat] Re: ADC Vref

2007-12-14 by Tim Mitchell

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.           
> 


Why couldn't you use a N-channel fet at the bottom end of the voltage
divider, with fairly high resistors for the divider? This would save on
mosfets and resistors, and I don't think would draw any power when off
(the AVR's analog inputs are high resistance - 100M according to the
data sheet). Plus you can use a single fet to switch any number of
dividers.

I have got a circuit which uses exactly this technique and seems to work
fine.


-- 
Tim Mitchell
tim@sabretechnology.co.uk http://www.sabretechnology.co.uk
Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ
Registered in England and Wales no.3131504
t:01482 801003 f:01482 801078

Re: ADC Vref

2007-12-14 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "Tim Mitchell" <tim@...> wrote:
 
> Why couldn't you use a N-channel
> fet at the bottom end of the
> voltage divider, with fairly
> high resistors for the divider?

The microcontroller analog inputs are now permanently connected to the 
supplies to be measured via the upper resistors in the divider.  When 
your N-channel FET is off, that's their only connection.  If the inputs 
have protection diodes, current will flow, so we don't achieve our 
objective.  If the inputs don't have protection diodes, then they will 
rise to the supply voltage, which is above their maximum rating.

Graham.

Re: [AVR-Chat] Re: ADC Vref

2007-12-14 by David VanHorn

> Why couldn't you use a N-channel fet at the bottom end of the voltage
> divider, with fairly high resistors for the divider? This would save on
> mosfets and resistors, and I don't think would draw any power when off
> (the AVR's analog inputs are high resistance - 100M according to the
> data sheet). Plus you can use a single fet to switch any number of
> dividers.


Look at the spec for input offset current on the ADC inputs.
They like low impedance sources.  Sampling the input with a low Z
divider looks very practical to me, if the resulting resolution is ok.
Something like 3-4 mV/count?

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.