Yahoo Groups archive

AVR-Chat

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

Thread

Butterfly mod

Butterfly mod

2009-08-12 by u4ia2000

The Butterfly will read 0 to 5v. My question is can I get to to read 0 to 30v simply or would take a lot of hardware?

Re: Butterfly mod

2009-08-12 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "u4ia2000" <u4ia2000@...> wrote:
>
> The Butterfly will read 0 to 5v.
> My question is can I get to to
> read 0 to 30v simply or would
> take a lot of hardware?

It would take two resistors.  Just make up a voltage divider.  Begin by looking up the schematic of the AVR Butterfly to see what the input resistance of the analog input is.  Take that into account when you calculate the resistors of your voltage divider.  Use 1% tolerance resistors if you need that accuracy.

Graham.

Re: Butterfly mod

2009-08-12 by u4ia2000

--- In AVR-Chat@yahoogroups.com, "Graham Davies" <Yahoo37849@...> wrote:
>
> --- In AVR-Chat@yahoogroups.com, "u4ia2000" <u4ia2000@> wrote:
> >
> > The Butterfly will read 0 to 5v.
> > My question is can I get to to
> > read 0 to 30v simply or would
> > take a lot of hardware?
> 
> It would take two resistors.  Just make up a voltage divider.  Begin by looking up the schematic of the AVR Butterfly to see what the input resistance of the analog input is.  Take that into account when you calculate the resistors of your voltage divider.  Use 1% tolerance resistors if you need that accuracy.
> 
> Graham.
>
Great thanks, that's all I need-- I'll do that.

Re: Butterfly mod

2009-08-12 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "Dave McLaughlin" <dave_mclaughlin@...> wrote:
> I would put a 5.1V zener diode across the input to the AVR ADC 

If you do so, you must be careful to select a size for the upper resistor in the divider so that the current is limited to a safe level for the zener.

Most modern AVRs do have clamping diodes to Vcc and ground on all I/O pins but you can add an external clamping diode (instead of the zener).  The external diode should have a forward voltage lower than 0.5V since that appears to be the forward voltage of the internal clamping diodes.  Here, again, the upper resistor in the divider must be large enough to limit the current to a safe level for the clamping diodes.
 
Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Re: [AVR-Chat] Butterfly mod

2009-08-12 by David VanHorn

On Wed, Aug 12, 2009 at 11:20 AM, u4ia2000<u4ia2000@yahoo.com> wrote:
> The Butterfly will read 0 to 5v. My question is can I get to to read 0 to 30v simply or would take a lot of hardware?

Two resistors.

RE: [AVR-Chat] Re: Butterfly mod

2009-08-12 by Dave McLaughlin

I can't recall the circuit for the Butterfly, but if I was you I would put a
5.1V zener diode across the input to the AVR ADC input just in case your
input goes above 30V or you resistor fails for some unknown reason. This was
you will protect the AVR from damage. I find this good practice when there
is a risk of the input voltage ever going above the max of an input pin.

 

Dave.
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Graham Davies
Sent: 12 August 2009 22:29
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] Re: Butterfly mod

 

  

--- In AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com> ,
"u4ia2000" <u4ia2000@...> wrote:
>
> The Butterfly will read 0 to 5v.
> My question is can I get to to
> read 0 to 30v simply or would
> take a lot of hardware?

It would take two resistors. Just make up a voltage divider. Begin by
looking up the schematic of the AVR Butterfly to see what the input
resistance of the analog input is. Take that into account when you calculate
the resistors of your voltage divider. Use 1% tolerance resistors if you
need that accuracy.

Graham.



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

Re: [AVR-Chat] Re: Butterfly mod

2009-08-12 by David VanHorn

On Wed, Aug 12, 2009 at 12:37 PM, Don Kinzer<dkinzer@easystreet.net> wrote:
> --- In AVR-Chat@yahoogroups.com, "Dave McLaughlin" <dave_mclaughlin@...> wrote:
>> I would put a 5.1V zener diode across the input to the AVR ADC
>
> If you do so, you must be careful to select a size for the upper resistor in the divider so that the current is limited to a safe level for the zener.
>
> Most modern AVRs do have clamping diodes to Vcc and ground on all I/O pins but you can add an external clamping diode (instead of the zener).  The external diode should have a forward voltage lower than 0.5V since that appears to be the forward voltage of the internal clamping diodes.  Here, again, the upper resistor in the divider must be large enough to limit the current to a safe level for the clamping diodes.

If you want to be ultra safe, calculate the divider to top out at the
zener voltage, and then add a second divider to take the zener voltage
down to VCC.
That way you can't ever exceed VCC.

Re: [AVR-Chat] Re: Butterfly mod

2009-08-12 by Roland Jollivet

Clamping to the Vcc rail in this app might not be a good idea. If the
current draw of the entire cct is low, and the Ain voltage goes too high,
it'll just pull the rail voltage up too. So then you need a Zener on the Vcc
rail. So just use one on the a/d in, instead.

Regards
Roland


2009/8/12 Don Kinzer <dkinzer@easystreet.net>

>
>
> --- In AVR-Chat@yahoogroups.com <AVR-Chat%40yahoogroups.com>, "Dave
> McLaughlin" <dave_mclaughlin@...> wrote:
> > I would put a 5.1V zener diode across the input to the AVR ADC
>
> If you do so, you must be careful to select a size for the upper resistor
> in the divider so that the current is limited to a safe level for the zener.
>
> Most modern AVRs do have clamping diodes to Vcc and ground on all I/O pins
> but you can add an external clamping diode (instead of the zener). The
> external diode should have a forward voltage lower than 0.5V since that
> appears to be the forward voltage of the internal clamping diodes. Here,
> again, the upper resistor in the divider must be large enough to limit the
> current to a safe level for the clamping diodes.
>
> Don Kinzer
> ZBasic Microcontrollers
> http://www.zbasic.net
>
>  
>


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

Re: [AVR-Chat] Re: Butterfly mod

2009-08-12 by David VanHorn

On Wed, Aug 12, 2009 at 12:56 PM, Roland
Jollivet<Roland.Jollivet@gmail.com> wrote:
> Clamping to the Vcc rail in this app might not be a good idea. If the
> current draw of the entire cct is low, and the Ain voltage goes too high,
> it'll just pull the rail voltage up too. So then you need a Zener on the Vcc
> rail. So just use one on the a/d in, instead.

Linear regs can have interesting behaviour if VCC rises above the
regulator voltage, especially if VCC keeps bouncing around.

Definitely a can of worms that is better left under the sink.

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.