5
\$\begingroup\$

How can a microcontroller-based device prevent battery drain while the product is on the store shelf? We are creating a waterproof, sealed in product without any buttons. This means the battery is attached to the PCB in production and can't be accessed after production.

What I'm looking for is a way to prevent battery drain while the product is still in the box and on the shelf.

Here's what we've doing so far and why I don't like it:

We're using a normally closed magnetic (reed) proximity sensor on the board and a permanent magnet in the box. The magnet breaks the circuit and no power is applied from the battery to the circuit. Take the product out of the box and it should automatically go live.

What I don't like: Normally closed reed switches are scarce and expensive. They are also often too big for our small product. On top of that, the ones we've been using have very fragile SMD "legs" that break from their solder pads at the slightest impact.

Edit: We have two GPIO pins accessible on the outside of the product and would be replacing the reed switch inside the product.

\$\endgroup\$
  • 8
    \$\begingroup\$ There are microcontrollers which sink as little as hundreds of nanoapms in deep sleep mode. That would be on par with battery self-discharge currents. \$\endgroup\$ – Dmitry Grigoryev Aug 31 '16 at 14:31
  • \$\begingroup\$ We are using a BGM111 that indeed uses very little power in deep sleep. (I believe it runs of a arm cortex)While this is possible I would not know how to "wake" the sealed device. \$\endgroup\$ – Jason Schot Aug 31 '16 at 15:51
  • 1
    \$\begingroup\$ Most other people usually put plastic tab that breaks conduction, I know it doesn't fit your app but its the easiest solution \$\endgroup\$ – laptop2d Aug 31 '16 at 17:34
  • 6
    \$\begingroup\$ Your problem reminds me ..., one of the county councils in my country, Ireland, had problems with roadworks light (yellow flashing type) batteries going flat in storage. It was only when someone climbed into the cupboard and closed the door that they realised all the lights were flashing in the dark and stopped every time the door was opened! \$\endgroup\$ – Transistor Aug 31 '16 at 18:59
  • 1
    \$\begingroup\$ @JasonSchot: How could it only occur to you after five hours to mention that there were electrical connections available on the outside of the box? I think you wasted a lot of people's time! You might want to edit again if there are ground and power available externally as well. \$\endgroup\$ – Transistor Aug 31 '16 at 21:35
5
\$\begingroup\$

If your product has a microcontroller which consumes tolerable amounts of current in sleep mode, you could simply wake up every minute (or whatever interval is appropriate) and check if the box is open using whatever sensors you like (Hall for magnetic field, photoresistor for light, etc). The check can take very little time, and if it's negative you'd go back to sleep for another minute.

For example, drawing 6 mA for 1 ms every minute produces the average current of 100 nA. Assuming a current consumption of 500 nA in sleep mode, you'll have a total average discharge current of 600 nA. You'll have to find a compromise between battery shelf life, wake-up delay and the appetite for current of the sensors which tell you to wake up.

\$\endgroup\$
  • 1
    \$\begingroup\$ While there have been many ingenious answers (thanks all!) I feel this was the best fit. The MCU manufacturer informed me they have a deep sleep mode of 0.1uA that can be woken on a GPIO change. \$\endgroup\$ – Jason Schot Aug 31 '16 at 19:38
  • \$\begingroup\$ @JasonSchot -- yes, this sounds like the best bet, especially if you have a LED-as-photovoltaic-diode (or perhaps two in series?) for the photosensor. \$\endgroup\$ – ThreePhaseEel Aug 31 '16 at 22:31
1
\$\begingroup\$

I've seen several on-the-shelf products lately that have a pliable plastic strip that is between one pole of the battery and its contact. The plastic strip is exposed to the outside, usually with "PULL ME" printed on it. Pull the plastic piece out, the battery contacts close and it's on.

However, this would break your waterproofing unless you had a clever design for it. Maybe have a plastic tab on the outside that you push that pushes the insulator out of the way - that could be sealed.

\$\endgroup\$
  • 3
    \$\begingroup\$ Hmm, I think that would be a major challenge. Anywhere the plastic could pass the water could pass right? \$\endgroup\$ – Jason Schot Aug 31 '16 at 15:56
  • \$\begingroup\$ Not necessarily. You could have a waterproof barrier in there. I'm a EE by education and trade, and this is definitely getting into ME territory. \$\endgroup\$ – Smith Sep 1 '16 at 21:06
1
\$\begingroup\$

How about a mechanically latched button under the waterproof seal (possibly a soft rubber over an opening on the product?) that is pressed by the package and has to be depressed (or vice versa) to get the product out of the box? Once the button is latched the micro comes out of deep sleep. No need for magnets or relays. Just need to design clever packaging.

Rough idea

\$\endgroup\$
  • 3
    \$\begingroup\$ "We are creating a waterproof, sealed in product without any buttons." You haven't met the user requirements. \$\endgroup\$ – Transistor Aug 31 '16 at 17:53
  • \$\begingroup\$ @Transistor Ah yes. I glossed over that part. I'll edit my answer to see if it might be more appropriate \$\endgroup\$ – Daniel V Aug 31 '16 at 18:03
  • \$\begingroup\$ I know the feeling. I now go back and re-read the question before posting to make sure I've addressed the point! \$\endgroup\$ – Transistor Aug 31 '16 at 18:04
1
\$\begingroup\$

I would try using a photo sensor to wake up your microcontroller. You will need to make sure your packaging can be opaque and your device will need a window. When the user opens the package and exposes it to light, the device wakes up and starts operating.

The simplest option would be to get a low-leakage phototransistor. I see some parts on digikey with 20 nA or even 1 nA dark current. Just wire up the emitter to an interrupt pin with the biggest pull-down resistor you can get away with. If you go this route, make sure to check the temperature dependence of the leakage current -- it is likely that it goes up quite a bit at high temperature, this may cause a problem with higher current drain or even unintentional triggering. Also, for this option you need to really make sure your packaging is light tight.

If for some reason the phototransistor doesn't work for you, you could even use a photodiode in photovoltaic mode. It provides its own power, so you don't need to worry about battery drain. However, silicon photodiodes can only generate a few hundred mV, which is probably not enough to trip an interrupt so you will instead need to wake periodically and measure the diode with an ADC. Alternately, you may be able to use an LED, which will have higher output voltage depending on color, but quite low output current. The nice thing here is that you will have a bit more leeway in terms of stray light since it won't be drawing leakage current from the battery.

\$\endgroup\$
1
\$\begingroup\$

Use the method you are using now, except substitute a cheap and widely available normally-open reed that holds your circuit in reset. You'd need a large value pullup resistor to keep the current much less than the battery self-discharge rate. This would also provide a way to hard-reset your circuit in case it 'hangs' in some unpleasant manner, as you have now.

There are existing products that use a similar method to read an external reed switch- bicycle accessories.

\$\endgroup\$
1
\$\begingroup\$

Keep the magnet in your box, but use a small SMD hall sensor IC to activate your product.

There are hall sensor ICs on the market that consume just a few micro-amps of average current.

Put the output of the hall sensor into the gate of a small SMD MOSFET that sits between your battery and the rest of your circuits.

When the hall sensor deactivates your FET will turn on, and so will the rest of the board.

If you want the product to stay on forever once removed, then use a latch circuit so that once the product turns on it remains on. There are a few obvious options here.

1) Run the output of the hall sensor and the MOSFET into the inputs or an OR gate and then drive the FET gate from the OR gate. The gate itself is powered directly from the battery.

2) Run the output of the hall sensor and a spare I/O pin from your micro-controller into an OR gate and then drive the FET gate from the OR gate. This is the same as above, except that you can add some software configurability.

For example, you may want the system turn off the first time you put it in the box, but remain on thereafter if a magnet is present. The microcontroller can make those kinds of decisions in software as long as it can set a flag in EEPROM or flash.

The AUP series of logic gates from Texas Instruments only draw nano-amps of supply current, and could be a good choice here.

\$\endgroup\$
  • \$\begingroup\$ This is a cool idea but my main issue with it (as well as other magnet-based solutions) is that if anyone ever puts a magnet close to your product it would shut down \$\endgroup\$ – Daniel V Aug 31 '16 at 20:54
  • 2
    \$\begingroup\$ You can make the circuit latch so that once the product has been removed it will stay on forever. If you have one free I/O pin on your micro-controller then that pin can be set once the product is removed. \$\endgroup\$ – user4574 Aug 31 '16 at 21:17
  • \$\begingroup\$ The 'latched' magnetic sensor is going to make test and packaging awkward. From the moment the battery is populated, there will need to be a magnet nearby. How to test the device and then de-activate it? \$\endgroup\$ – JS. Sep 1 '16 at 0:29
  • 1
    \$\begingroup\$ @JS If you use the micro-controller to do the latching, then the micro-controller can use an internal non-volatile flag to control the latch. First put in your battery. At that point the device will turn on. Test it. Then put it in the box that has the magnet. At that point the micro-controller sets a flag in EEPROM. After the flag is stored, the micro, drops its IO line, and the device turns off. Next the user removes the product, and it turns on. If a magnet is placed near it again, the micro doesn't drop its IO line because the NV flag is already set, and the device remains on. \$\endgroup\$ – user4574 Sep 1 '16 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.