photoresistor + sd card + battery + arduino

hey,

i want to make a quick experiment and i need a view tipps to start. the idea is to place a photoresistor on the outside of a package and send it to someone by mail. in the inside of the box there is a arduino board with an sd card, which logs the values from the photoresistor every 5 seconds or so. and want to log the data on the sd card, just to see how much light my package gets during the trip. i want to use following tutorials to do so:

http://www.arduino.cc/playground/Learning/PhotoResistor http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/8 http://www.arduino.cc/playground/Learning/9VBatteryAdapter

how long could i log data? can someone make a guess when the battery is empty? i dont know how to save data with an arduino without a sd card, and otherwise is the data save on the arduino board or will it be deleted when the battery is empty? i guess the package is sent in 2 days will the battery last so long? i also have an li-ion battery from my iphone but it just has 3.7 v and i read it is not save to use same because discharged. does the arduino board need much current? how to save much energie with good code? more batterys result in more power, but not in a longer overall battery life?

greetings peter

Okay, i'm learning as well, but I believe I may be able to decipher your questions.

Depends on the battery - different battery types have different ampere-hours, which would therefore affect your ability to record data over a period of time.

Nine volt batteries will last for a decent amount of time, but maybe not that long - it might be a good idea to link a ampmeter between your batteries and supply to see how many amperes an Arduino draws during your normal operation, with writing to the SD card.

The arduino requires at least 5 volts. 3.7 volts is nowhere near enough.

If power supply is a problem, as a last resort, linking a few batteries together in parallel and using a switch-mode power supply would help to lengthen the amount of time available, though it might not come to that.

You may be able to use the EEPROM memory inside the arduino, assuming you only log 511 times. Or even PROGMEM - though i'm not sure if that's volatile.

Or even PROGMEM

No you can't write to that while the program is running without rewriting the bootloader. If you could it would be non volatile.

linking a few batteries together in parallel

Lots of talk about this recently, unless you use diodes to prevent back charging then my advise is to not do it.

You don’t necessarily need 5V to run Arduino - I have a remote control 5V 16 MHz Pro-mini that is running on 3 AA batteries. They are currently down to 4.25V total and it is still running. The batteries connect to VCC AFTER the regulator so its not wasting energy knocking 9V down to 5V.
I am waiting for a 3.3V 8 MHz Pro-mini to arrive, I plan to try that with a 3.7V Li Ion battery. May cutdown on my transmit range - but I only need 50-60 feet, so am not too worried.
If you read section 28 of the AtMega328 datasheet, they show it running at lower frequencies on as little as 2V.
The arduino can be programmed to go into powerdown sleep mode in between captures, that would extend battery life as well.
If you had 1500mAH of useful battery life, with the Arduino drawing 9mA in idle mode, that’s 7 days right there. Drawing <1mA in sleep mode extends it way out. There’s lots of posts on self-waking from internal timers, I haven’t tried those yet, was only able just recently to wake from external interupts (missing <interrupt.h> in my sketch).
12 captures/minute x 60 min/hr x 24 hr/day = 17,280 captures/day.
SD cards hold gigabytes these days, so space shouldn’t be an issue.
My Canon powershot camera runs on 2 AA batteries and shoots hundreds of multimegapixel shots on 1 pair with zoom lens and display, so this certainly seems like a feasible experiment.
Not sure how happy the post office would be about active elecrtonics being shipped around. You would have to make sure things are packaged pretty securely so the batteries could not short out & create a fire hazard.

thank you for your answers brought me to the right path.
found this http://interface.khm.de/index.php/lab/experiments/sleep_watchdog_battery/
the problem with the battery and the burning delivery car isnt’t a problem.
first of all it should be a test object.

thanks again.

My Canon powershot camera runs on 2 AA batteries and shoots hundreds of multimegapixel shots on 1 pair

I wish my A540 did :( I barely get a decent single tank dive out of a set of batteries.

iam_peter, Glad the discussion helped lead to something useful. I have often found discussions like this lead to helpful things when sometimes all that is needed is the right term to search for. In my case, I was recently looking for a way to put a 2.1mm jack on the sidewall of a box to bring in power, I was describing this to someone and they mentioned "panel mount" and voila, that's the search term I needed!

Re: the example you found & its discussion of not stealing the chip from an Arduino board to make it: I bought a couple of programmed 28-pin dip ATMega328Ps after I damaged my first one with overloaded outputs, and before I came across the method to program blank ones via "bit banging" that I found in the forum as well. So I bought a couple of blank ones too.

But instead of using them in a project, I have been using MiniPros for my fencing related projects, kinda convenient having everything ready to go without having to re-build the wheel everytime, lets me concentrate on my hardware design and coding. Have been buying from gravitech.us, and Tony there has been helpful in finding wirewrap socket strips & interconnects for mounting them in a removable method and some other parts they carry but are not on website yet.

AWOL, "tank dive", are you referring to SCUBA? I've never tried more than snorkeling with disposable underwater cameras. Never looked into SCUBA, have enough expensive hobbies already.

The other nice thing with regular alkaline batteries is that they recover some when not being used. I wonder if that happens with low level drain also.

Robert

AWOL, "tank dive", are you referring to SCUBA

Yes - I bought the A540 (and a 40m waterproof casing, which I think cost more than the camera) specifically for diving, but the battery life is atrocious, particularly when you have to use the display because the optical viewfinder is invisible with a mask on.