1

Scenario: I would like to monitor my closet's door as I highly suspect a family member is opening and using my items without permission. To respect privacy and also because my closet is nowhere near a power mains, I don't need video nor audio recording. I also do not need indicator lights etc because I intend to turn it on when I go to work and check the logs on the SD card when I return home. A typical day would require the device to run for 12 hours minimally.

Aim: Is it possible for Arduino to achieve the following,

  1. Run on batteries for at least 1 month

  2. Detect motion

  3. Logging the detection motion onto a text file in a SD card

Or do I have to look elsewhere for this functionality?

Current understanding: I am aware Arduino can run on batteries though I've never been able to get it to last more than 3 hours. Probably has to do with me not using the low power mode or something and that my batteries were being stepped up. I also know that Arduino has some PIR motion sensors though I don't quite remember how power hungry these sensors are. I have NEVER tried logging onto an SD card using Arduino. This sums up my experience with Arduino.

Any advice would be much appreciated. Thank you.

1

It is possible to modify an Arduino Pro Mini (clone or original) to less than 1 mA and give at least a month on standard batteries (1000 mAh). Basically you need to remove the Power indicator LED and use low power mode in the sketch.

You could start simple by just lighting a LED when motion is detected and add the SD log later.

There are several techniques to detect motion. Advanced accelerometers such as ADXL345 but also simple wire sensing. The standby power requirements for these have a large variation.

  • Hmmms thanks for the prompt suggestion. WIll have to read up more on what a clone Aaarduino is. Preferably i would like my device to function somewhat like a motion sensor that is installed in a lot of toilets and offices where lights turn on upon detecting motion. in that sense, a simple PIR sensor would do well. I will look into wire sensing though but an accelerometer seems overkill =) – lone Dec 7 '15 at 12:19
  • PIR will work great. Advantage is that you can connect it to an interrupt pin on the arduino, to make it wake from sleep, when motion is detected. But since the arduino is sleeping, it will have no sense of how much time has passes. So you probably would want to add a RTC module, so you can log the exact time and date of the motion event to the SD card. Another option for motion sensor, is a vibration sensor – Gerben Dec 7 '15 at 15:35
  • yup im looking around for a reliable PIR sensor but it doesn't seem there are much choices on Sparkfun... i don't need exact time though. just the mere fact that someone opened my cupboard during the time that i am away is sufficieint. so a RTC might not be necessary =) – lone Dec 7 '15 at 23:24
1

For low-power, just some tips (link references)

https://github.com/petervojtek/diy/wiki/Arduino-with-Very-Low-Power-Consumption

claim the below results,

LED off, without the JeeLib library: 6.7 mA
LED on, without the JeeLib library: 8.8 mA
LED off, with the JeeLib library: 43 uA (!)
LED on, with the JeeLib library: 2.2mA

https://github.com/petervojtek/diy/wiki/Arduino-with-Very-Low-Power-Consumption

Detailed step by step tutorial.

For sensing PIR will depend on exact components; using SMD low-leakage components will do the trick but cost would increase. There are very-low-power RTC on the market and maybe SD logging will be more difficult as can consume up to 200 mA per reading/writing operations.

  • Hmm...I see...thanks for the reference and the info on SD logging. didn't know it was so power hungry. do you have other suggestions for logging? the data only needs to be present for 1 day as i will do daily checks. – lone Dec 7 '15 at 23:27
  • well, if you encode your time-stamp in two bytes you can store 128 events on 256 bytes. – eccker Dec 9 '15 at 0:22
  • You have 32,256 of total program space in Arduino UNO and supposing using a 95% of that space for your program it will leave approx. 1,612 bytes, but who will open the door more than 806 times per day??? – eccker Dec 9 '15 at 0:31
  • hahahahaha good point! i just need the occurrence of the event being logged. time is not important so i guess i can probably do with the existing program space then. – lone Dec 9 '15 at 11:37
1

You would be better off with a bare ATmega chip than an Arduino - you want to eliminate extraneous circuitry like a USB converter, regulators with quiescent current draw, and any resistors pulling signals against their usual state. Fortunately the ATmega chip has a fairly wide voltage range, especially at 8 MHz or below, so you can use something like 3 cells, alkaline or rechargeable, over most of their range.

An SDcard is neither necessary, nor a good idea. If your circuit won't be discovered you can probably hold the data in static ram while the ATmega sleeps; if not, the quantity of data would probably not exceed the on-chip EEprom and would certainly not exceed that of a 4 megabyte SPI flash. Either of these will be far more robust (and low power) in a battery powered situation than an SD card. They will also be simpler to support in software. Either an SPI flash or an SDcard will probably have a narrower supply range the the ATmega and require a regulator - you may be able to enable that only when you need to access the memory.

Your main power consumption win however will be sensors. If you can use a contact sensor - either a direct switch, or a magnetic reed one, that will result in the lowest power consumption. Your next option might well be an accelerometer chip, specifically if you choose one which can run in a micropower mode and fire a wakeup interrupt to the MCU when it detects that a door it is mounted on is being opened. Anything with light is likely to have much higher power consumption and could well be impractical, unless you figure out how to operate it in short bursts with a lengthy inactive time in between.

  • ok so i could do without a SD card but how do i go about retrieving the data if i store it on the on-chip EEPROM or static RAM? RAM is fine actually since i don't need persistent data, just the mere fact that someone opened the door i.e. i want to track the number of times the door is opened in the period that i am gone so that i can go hammering around to find out who actually opened my door. a contact sensor....i might consider that...just need to factor debouncing as my door isn't exactly tight so a kick or a nudge may set off the program to count as an event occurrence. – lone Dec 9 '15 at 11:40
  • Probably have it upload the data over the serial port. That does mean that for ram you would need to either disable auto reset or stop the utilized part of ram from being intitialized on reset. – Chris Stratton Dec 9 '15 at 13:53
  • hmmms...it is going to be a standalone though so having a serial port doesn't sound feasible. trying to find a way to stop ram from being initialized on reset..is that even doable? – lone Dec 11 '15 at 12:19
  • RAM is cleared by software. Removing the module for serial download should be possible if removing an sdcard is. Having a button and LED to flash the open count might be easiest, and can mean no issues with trying to stop a USB serial from consuming power... – Chris Stratton Dec 11 '15 at 16:05
  • hmmms so a button and LED huhs. that sounds like a good idea...if i go for purely the chip alone, the USB serial is only needed when i flash in the program right? after that I can take it out which should hopefully help with reducing power consumption – lone Dec 12 '15 at 6:07
0

The PIR sensors are actually pretty cheap: http://www.ebay.com/itm/like/171338717482?ul_noapp=true&chn=ps&lpid=82

  • thanks ^^ still thinking of what sensors to use since power is a major concern. i didn't think about light based sensors being power hungry but after Chris Stratton mentioned it, i might drop the idea of using PIR even though it is freaking convenient! – lone Dec 9 '15 at 11:42

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.