Hi.
I'm planning to build a project and i need your guidance on how can be achieved.
The idea:
A battery operated weather station that will report sensor readings once per day through SMS.
At the same time i want ot monitor one switch and one accelerometer to be sure that no one is trying to open or move the systems box.
So far i managed to send sensors reports through SMS msgs .
The main problem seems to be the power consumption of the "system".
What i belive that will be the best approach to the power problem is to power down as much parts as posible during the period that the system stands and waiting .
GSM SIM900 module can be turned OFF through the LM2596 ( i haven't test it yet) and turn it ON only when the report is ready to be send OR when an alarm is triggered by switch or accelerometer.
Arduino can be put in sleep mode during waiting period to save even more battery power.
I'm planning to use watchdog for that functions ( i don't know exactly how so far .. but i assume that can be done).
The problem that i don't know how to deal with is the "time schedule" . especially while the arduino is in sleep mode.
in my mind things goes like ..
Read real time from Network using SIM900.
Calculate how much time is till the predefined time (when report must be send)
turn systems OFF to save power
wait for alarm inputs (switch , accel )
time to send report so wake up the system
send report
go to sleep again until the next report
Question.
There is a way to calculate and keep the remaining time till the next report using arduino or do i have to use an external clock ?
Oups.. i forgot to mention that the battery i'm planning to use is 7Ah and the desired period of operation is at least two months
Many SIM900 shields can be turned on and off by software, no need for any other components. Once it's awake wait until you have a signal before transmitting. Then shut it down again.
dannable:
Many SIM900 shields can be turned on and off by software, no need for any other components. Once it's awake wait until you have a signal before transmitting. Then shut it down again.
Yes..i know..
i ll test both to define which solution is more effective
but the main problem is to keep counting while arduino is in sleep mode.
Can be done ONLY by arduino
OR
do i have to use external Clock ?
If you use something like a 3231, it has an alarm which you can use (connected to an interrupt pin) to wake up the Arduino.
Nick Gammon has a good piece on sleeping and low power consumption on his site.
Can you connect your anti-tamper devices in such a way that they wake the Arduino up too, perhaps using the other interrupt pin (assuming an Uno)? So one interrupt says "Wake and send a weather report", the other says "Wake up, send for help"?
dannable:
Can you connect your anti-tamper devices in such a way that they wake the Arduino up too, perhaps using the other interrupt pin (assuming an Uno)? So one interrupt says "Wake and send a weather report", the other says "Wake up, send for help"?
Yes...
Yes....
and Yes...
I ll have to study about RTCs and how to connect them .
Thank you dannable...
i m sure i'll come back with more questions..soon !!
An Arduino can sleep for 4 seconds, wake by the watchdog timer, and go right back to sleep. By incrementing a variable each time you sleep/wake, you can sleep for 21600 4-second periods, which is about a day. This clock is not very accurate, so over the weeks your SMS reports will come in earlier and earlier (or later and later) in the day unless you compensate (below).
Another option, is to use a 32kHz crystal and set up an interrupt to wake the Arduino once per second as measured by the crystal (which should be more accurate than the watchdog timer, but still not "perfect"). Again, count the seconds and go right back to sleep unless it's the right time of day for a weather report.
To correct for time drift, you can add a photodiode, phototransistor, or LDR (light dependent resistor) and sample it every few minutes to get a rough idea of when sunrise and sunset occur, then use that information for clock correction purposes.
Another alternative to correct for time drift is temperature compensation. That's what the DS3231 does in a neat package, but you have a weather station that I assume reads the temperature, so you can do your own compensation in software (clocks run faster when hot, slower when cold).
If you do go to an RTC, use a DS3231, not a DS1307. A DS1307 has terrible acuracy.
Also... most Arduinos waste a lot of power with the onboard USB-serial converter chip, so they still suck a lot of power even when the CPU is "asleep". Use an Arduino that has no discrete USB-serial converter, or build your own board with a bare ATMega chip.