Normal Close input for low power

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I am trying to configure a pin in ATxmega128A4U for an input to control a Normal Close switch by interrupt rising level.

If I configure pin as input and internal pull-up it works but the consumption increases from 5 uA to 120 uA during sleep.

There is no resistor in the actual hardware between the pin and the switch, connected directly to GND.

 

So, do you know if there is any solution to configure this pin and preserve the battery without doing changes in the hardware?

 

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could use an external pullup resistor with a much higher value.

A 10MOhm resistor would reduce the load to 3uA.

But this introduces the possibility of getting false switch readings because of noise.

The solution for the noise is to use a good PCB design, short wires, shielded cables etc.

 

Oops:

As long as your switch is closed, the input level will be quite rigidly connected to whatever the switch is connected (GND?)

Resistors above 10Mohm are a bit uncommon, you could put some in series to lower the current even more.

The limit would be the input leakage current of the Xmega pin.

Switching times would also increase because of the RC time with stray capacitance.

 

But why a normally closed switch? Open switches do not have a current through them.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Best solution is to use a NO switch with internal pull up enabled on input pin, then use pin change interrupt for low sleep current.

 

Jim

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

But why a normally closed switch?

That's a normal way of doing alarms, or at least it used to be. If the cable is cut then the alarm triggers.

 

The modern and better way is to use an end of line resistor and have the line sitting somewhere between GND and VCC so if the cable is cut or shorted out the alarm triggers anyway.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
That's a normal way of doing alarms,
 

We're looking through a very small hole at some incomplete specificiations here.

For a good low power design the whole system must be scrutinized.

A common problem for example is normal leakage of electrolytic capacitors, which can by tens of uA.

 

For the switch some sort of low duty cycle PWM can be implemented.

If it is some alarm system with long wires on the switches, then those will need special attention.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem you face is you want the switch to conduct current when not being pressed, but you also don't want "any" current to flow during that time

 

Take a pin and make it an output, you will drive it high or low...feed that pin through, say 20k, to your ground-connected switch.

A read (input) pin connects direct to the switch.

 

When you want to read the switch, set the output hi, and read your switch (if it is open, you will read high-1, if closed, you will read gnd--0).

When you don't want to read the switch set the output low & then no current will be drawn, regardless of the switch being open/closed.

 

You could set a timer to wake up 5 times a second for several microseconds to check the switch state.

 

 

When in the dark remember-the future looks brighter than ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
That's a normal way of doing alarms, or at least it used to be. If the cable is cut then the alarm triggers.

You must be clairvoyant John, I did not see any mention of an alarm system in the OP! 

But if that is the case and (s)he must use a NC switch, then its time to choose a bigger battery, for that circuit WILL draw power!

 

Jim

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

Take a pin and make it an output, you will drive it high or low...feed that pin through, say 20k, to your ground-connected switch.

A read (input) pin connects direct to the switch.

 

When you want to read the switch, set the output hi, and read your switch (if it is open, you will read high-1, if closed, you will read gnd--0).

When you don't want to read the switch set the output low & then no current will be drawn, regardless of the switch being open/closed.

 

and to comply with the requirement

 

exnorkel wrote:

So, do you know if there is any solution to configure this pin and preserve the battery without doing changes in the hardware?

 

    XMega has both pull-up and pull-down resistors. Instead to use a  separate pin and cut the voltage to the switch, you could activate the pull-down on the same pin so you could make it without any external hardware modification.

 

    The disadvantage to this is you lose the exact moment the switch switches state. Some switches can vibrate the contacts in case someone forces the door / window like when breaking glass but keeping the door still closed. This solution may fail to detect a such event.

 

    Being in the army we had targets that when the bullet would hit them an attached switch would vibrate and open contacts for few milliseconds or microseconds.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

XMega has both pull-up and pull-down resistors

Very nice...pull up when you want to check switch, pulldown when not checking.   Wake up, check, go back to sleep, repeat. As noted, unlike an IRQ, this might not catch a transitory pulse, between samples.

If you want to monitor the NC switch 100% of time, there will be current flowing through it!

 

Please describe the switching particulars

When in the dark remember-the future looks brighter than ever.