Author Topic: Low Power reed switch circuit  (Read 3467 times)

cosax

  • Newbie
  • *
  • Posts: 10
Low Power reed switch circuit
« on: September 14, 2015, 01:06:55 PM »
Is it possible to have a read switch circuit (eg. Vcc - 56K - Reed - GND) connected to moteino (say D5 between resistor and switch) that would consume power only when reading its on/off state? I was thinking something simillar to the battery level measuring circuit where the GND is conncted instead to a Digital IO pin and its turned off by setting the pin to input.

TomWS

  • Hero Member
  • *****
  • Posts: 1888
Re: Low Power reed switch circuit
« Reply #1 on: September 14, 2015, 02:24:24 PM »
Is it possible to have a read switch circuit (eg. Vcc - 56K - Reed - GND) connected to moteino (say D5 between resistor and switch) that would consume power only when reading its on/off state? I was thinking something simillar to the battery level measuring circuit where the GND is conncted instead to a Digital IO pin and its turned off by setting the pin to input.
If you want to consume NO power until actually reading the switch, the simplest way IMO is to set one input (pinIn) to pinMode(pinIn, INPUT_PULLUP); and a second pin, call it pinOut, also set to pinMode(pinOut, INPUT_PULLUP); with the reed switch wired between the two pins (no connection to ground or VCC).

Then to read, you would:
Code: [Select]
  digitalWrite(pinOut, LOW);  // this 'ready's the pinOut to drive one side of the reed switch
  pinMode(pinOut, OUTPUT); // this drives the reed switch
  switchOpen = digitalRead(pinIn);  // this will read HIGH if the switch is open
  pinMode(pinOut, INPUT_PULLUP);  // back to no power state

Note that pinOut can drive as many reed switches as you need....

Tom

cosax

  • Newbie
  • *
  • Posts: 10
Re: Low Power reed switch circuit
« Reply #2 on: September 15, 2015, 01:06:13 AM »
Ok! Thank you for the detailed answer. I will try it.

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Low Power reed switch circuit
« Reply #3 on: September 15, 2015, 03:56:44 AM »
@TomWS,

There can be long term reliability issues with that approach. Even though the better reed relays have gold flashed contact points and are hermetically sealed, they can still have an issue with 'wetting current'.  In brief, a minimum current needs to flow to break down the surface contaminants, else paradoxically a "closed" switch can look like an open circuit. Driving an input pin takes only a tiny current.

This can be resolved by a modest pull-down R on pinIn, forcing a wetting current during sampling (and also resolving the 'floating' state of pinIn which may well have a substantial length of wire attached if the reed switch is remote).

True, that breaks the constraint of 'No Power', but only for the sampling period.

TomWS

  • Hero Member
  • *****
  • Posts: 1888
Re: Low Power reed switch circuit
« Reply #4 on: September 15, 2015, 11:55:15 AM »
@TomWS,

There can be long term reliability issues with that approach. Even though the better reed relays have gold flashed contact points and are hermetically sealed, they can still have an issue with 'wetting current'.  In brief, a minimum current needs to flow to break down the surface contaminants, else paradoxically a "closed" switch can look like an open circuit. Driving an input pin takes only a tiny current.

This can be resolved by a modest pull-down R on pinIn, forcing a wetting current during sampling (and also resolving the 'floating' state of pinIn which may well have a substantial length of wire attached if the reed switch is remote).

True, that breaks the constraint of 'No Power', but only for the sampling period.
Good point!  You are exactly right, forgot about that. But, in this example, rather than a modest resistor as a 'pulldown', it should be a pullup as pinOut pulls low during read.  I think something in the order of 5mA would be sufficient to keep a hermetically sealed reed switch contact clean.  Alternative is a capacitor which could supply higher current during 'bounce' and wouldn't appreciatively cause a heavy battery load during read (pinOut sees the surge, but it's localized to the pin).

In either case, however, the fan out of pinOut would be significantly lowered.
  Scratch this.  What you need is a current supplied at the instant of closure, not the instant of read.  Neither of these ideas provide that and I'm not visualizing a NO current solution that does this.  I can visualize a very low current (depending on switch trip rate) solution, but not a NO current solution.  Suggestions emjay?

By copy to cosax, if you need some more detailed guidance on this, let us know.  I'm sure one of us can provide the detail.

Tom
« Last Edit: September 15, 2015, 12:22:47 PM by TomWS »

cosax

  • Newbie
  • *
  • Posts: 10
Re: Low Power reed switch circuit
« Reply #5 on: September 16, 2015, 06:25:55 AM »
Things have become more complicated now! And I have a lot of questions:
1. Why do you need current supplied at the instant of closure and not just before the instant of read?
2. Why the current through the internal pullup through pinIn is not enough to serve as 'wetting current'?
3. What is the low current alternative solution? I do not have the experience that would allow me to derive it from the above info.

Your help is greatly appreciated.

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Low Power reed switch circuit
« Reply #6 on: September 16, 2015, 08:48:38 AM »
Well it looks as though the answer will end up vendor specific - the better reed relays have improved since I was last wiring them up  - National Instruments for one claims no wetting current requirements  http://digital.ni.com/public.nsf/allkb/FE70EF537A6F2CB28625793700672CA3

I'd still be cautious with a 'no-name' China special.  ;)


TomWS

  • Hero Member
  • *****
  • Posts: 1888
Re: Low Power reed switch circuit
« Reply #7 on: September 16, 2015, 09:24:20 AM »
Emjay's reference provides a good explanation as to why the 'wetting' current is needed with some relays:
Quote
No, reed relays do not have minimum switching requirements or wetting currents. Other switches may specify these minimum requirements because low voltage or current switching signals do not have the ability to vaporize pollutants that can accumulate on the mechanical components of the relay, preventing them from operating. This is not an issue with reed relays because they are contained in a glass container which is filled with an inert gas.  This removes the need for any wetting current, as there are no pollutants that can build up on the relay to prevent the mechanical action from occurring.
By the way, the term 'wetting' comes from the 'old days' when contacts were literally wetted with mercury.  The surface tension of the mercury made the connection 'stick' once physical contact was made, therefore no switch 'bounce' and no corrosion.

Answering your questions, then:
Things have become more complicated now! And I have a lot of questions:
1. Why do you need current supplied at the instant of closure and not just before the instant of read?
it is at the instant of closure, when the contacts are first touching, you have the best chance of burning off the oxide that may have built up on the contact surface.  Once the full pressure of the contact is made, it is more difficult to vaporize the surface contaminants.
Quote
2. Why the current through the internal pullup through pinIn is not enough to serve as 'wetting current'?
the internal pullup resistor on the ATMega328P is >30K ohms which will not supply enough current to vaporize the contaminants.
Quote
3. What is the low current alternative solution? I do not have the experience that would allow me to derive it from the above info.
According to the information Emjay found, reasonable quality reed switches, if filled with an inert gas, no longer require the higher current, so my original suggestion should work for you.

Tom

cosax

  • Newbie
  • *
  • Posts: 10
Re: Low Power reed switch circuit
« Reply #8 on: September 17, 2015, 03:48:19 AM »
Thank you both for your responses. You have been most helpful.