Team,
the watchdog is part of the atmega168 CPU, so you can use it without additional electronics.
@Andy:
As you don’t need to wake on serial input, you can really put the whole bee to sleep, let it wait for the watchdog every 2 secs and if the 5 or 10 mins haven’t passed, immediately jump to sleep again.
Then after 5-10 mins you start darkness detection, if that fails (i.e. its still light enough) start the whole round again.
Depending on required response time you can play with the wake-on-radio timers of the CCx. However if you stretch this, it could mean you loose packets.
So if you have a central command radio (on grid power), it could output a continous stream of commands.
e.g:
00
00
00
88
88
etc
which means that when a packet is missed the next reception might pick it up.
However, as Rich mentioned the Leds will most likely be killing your power budget way more than the rfbee.
(rfbee with CCx in powerdown and atmega in Idle consumed about 1.1 mA and with atmega in deep sleep it will consume even less )
So you might want to focus on that:
a) If you can get away with different light intensities during the night (e.g. more brightness during twilight) that be a power saver.
b) If say most visitors view the installation before 2AM then you could put the installation to sleep (e.g. by radio command) so the leds don’t need to light until daylight.
With regards to the milky white. Try to get the piece above the solar cell as thin as possible (maybe even foil ?) Or try to get it in such a way that its an optical illusion. Eg. if you have milky white dots , it already looks more whitey, but still lets in much more sun than behind 3mm white acrylic.
Last but not least you could try to put the cell on the harbour facing side, so visitors can’t see it
Looking at the code you posted it looks like the modifications you have made are still minor. If that is the case I advise you to upgrade to the most recent version and apply your code there, as its more robust against timing issues. If you don’t have subversion you can pick it up here:
http://code.google.com/p/rfbee/source/browse/#svn/branches/v1.1/RFBee
@Rich, I have been thinking about having sleep as ATMD5, however as the CCx is not able to send nor receive immediately after sleep, I decided to make it ATSL. As soon as the rfbee wakes it will continue in the mode it was before being put to sleep (e.g. Transmit, Receive etc). That’s also why I made it return to serial data mode.
If you all think that’s a mistake we can always make it ATMD5 again.
Using ATOF to switch between decimal and binary for reporting sensor readings like a sensible move to me. If you use the same semantics then 0-2 will still be binary and 3 will be decimal output.
I was thinking about a WOR mode as ATMD5, which is basically a variant of RECEIVE_MODE, but now with the atmega in deep sleep and the CCX in wor.
What do you think ?
Cheers,
Hans