Electronic – arduino – Detect Twist-Opened Bottle Cap on Arduino

arduinodesign

I'm building a smart bottle cap. Every time it's twist-open it records a long timestamp to local storage. When user opens a smartphone app it syncs data from storage to phone via bluetooth LE. It is powered by button cell.

What would be the best low-power cost-effective way to detect when cap is twist-open? I have the following sensors: http://amzn.com/B00CBDUD60

I was considering:

  • Potentiometer
  • Rotate Encode
  • Hall Sensor
  • Tilt/Mercury Sensor

EDIT: Thanks for the inputs! I've actually had the same discussion on arduino.cc forum, and people had reached the same consensus: a simple tactile/pushbutton attached to the inner "roof" of the cap, and covered with a waterproof lid. Here's a sketch: http://goo.gl/MdxIGZ

Best Answer

Assuming 1, this is a proof of concept with a standard soda bottle and bottle cap, 2, no liquid will be used for this (waterproofing and safety is not being accounted for), and 3, your handling the bluetooth and sensor input on your own.

A mercury or tilt switch is not practical. Any movement of the bottle will trigger it, let along twisting it off. Also, mercury in possibly a drink bottle? No thanks.

A hall sensor would require a magnet placed on the bottle (a fixed point). This might increase production costs from new material and changes in manufacturing.

A rotary encoder is expensive compared to a potentiometer. And so much more complex in terms of input. A pot is also more complex than you need.

A simple push button or momentary lever switch is really the most practical thing. Just mount it so it is closed when on the bottle, and it is opened when off the bottle (or vice-versa). That's all you need. Just two states (On/Off). The rest is your coding.

A slightly better option is a photoresistor. No moving parts, as long as the bottle is black/dark or there is a label around the neck up to the cap, and the bottle is used in a lit room, it will work. Then again, it might not work in a dark room like say someone watching a movie with the lights off. Nah, a simple switch is best.