The 3rd suitcase

Yep, we’re leaving the country for a couple of weeks soon. Time to gather all the stuff i ‘need’ over there. Two suitcases are almost packed and we’re ready to go; now what’s in that 3rd suitcase we will have to carry with us?

Too heavy?

Cameras, MP3 players, a laptop, clock radio, iPod, portable HDD, card reader and all the things you need to keep those things operational for 2 weeks, like cables, adapters and battery chargers. And there are still some things missing from this picture, like 2 game consoles (and their adapters) for our kids, the adapter for my cell phone, a few computer magazines, a power distribution box (cause we’re always short on wall sockets)… yes, that will be enough to fill that 3rd suitcase, which we call the ‘gadget suitcase’. It’s getting heavier every year…

Trying to get a date with Plugwise

Having Plugwise in my house since December 2008, playing around with Digi Series 2 XBee modules for some time, knowing both are Ember EM250 based; nice ingredients for some fooling around with those two. I’ve already been asked a few times if I could ‘see’ any Plugwise traffic or other signs of the Plugwise network. No, i did not. Cause that would be wrong, if those would interfere that easily. And to tell you the truth, i wasn’t really interested enough to spend much time on this.

But why not try it some time? It has been on the to-do list for some time, but never made it to the top-5. But when there was another question recently from someone for whom i gladly spend lots of time without any personal gain or interest, i decided to try some things to see if a first small step could be made. I put 1 of my spare XBee modules into a XBee adapter, loaded the firmware version 2864 (XB24-ZB End Device AT), set the preconfigured PAN id to 0 (which means the XBee will join any PAN it can find) and uploaded the new configuration.

Now there’s this small green LED on the adapter labeled as ‘ASC’, which tells you the associated state of the XBee. When it starts blinking rapidly, you know you’re going in the right direction … reading back the Operating PAN ID from the XBee showed me a value like D6F0000134567. Hey, where have i seen that value before? It looks like a Ember MAC address.. YES, it’s the MAC address of my Circle+ ! How odd… 🙂

OK, i know. This is just a very small step; i know the PAN ID of the Plugwise network now; duh. Next thing to figure out is the encryption key; it’s time to join forces on this project that is in the top-5 now and is there to stay!

Plugwise still sucks in some perspectives, but this is nice. And i have no idea if this will ever come to something useful. But that doesn’t matter, just as long as I’m having fun with what I’m doing 🙂

Adding Light and Temperature

Since i removed a bunch of MS13 sensors recently, i am missing some input on what is going on at several places in our home. So while i was making a list of things i need in the near future, i realized i should extend the motion sensors a bit more, or otherwise i would lose the dark/light sensor the MS13 provided. And why not add temperature as well; cause that would mean i could do without the Oregon sensors also. I mean, why use 2 sensor devices (one only for temperature and another one for motion and light) when you can combine it all into one? Let’s have a look at temperature…

I still have 10 DS1820 1-Wire sensors somewhere from the days when i started with Domotica, but i never used them; maybe now i finally found a purpose for them? Let’s connect a few to an Arduino and see if  i can get a temperature reading:

Arduino with 3 x DS1820

Arduino with 3 x DS1820

And of course, there’s a library to use 1-Wire devices with an Arduino.. so before i knew it, i was polling the temperature of 3 DS1820s 🙂

Addr:10 6C 5 CA 0 8 0 C3  Temp=25.50 grC
Addr:10 33 EC 3 1 8 0 E1  Temp=25.50 grC
Addr:10 FB 90 C9 0 8 0 1A  Temp=25.50 grC

Addr:10 6C 5 CA 0 8 0 C3  Temp=25.50 grC
Addr:10 33 EC 3 1 8 0 E1  Temp=25.50 grC
Addr:10 FB 90 C9 0 8 0 1A  Temp=25.50 grC

Addr:10 6C 5 CA 0 8 0 C3  Temp=25.50 grC
Addr:10 33 EC 3 1 8 0 E1  Temp=25.50 grC
Addr:10 FB 90 C9 0 8 0 1A  Temp=25.50 grC

Add an additional LDR and I’m done; ready to replace a large part of all my sensors: all remaining MS13s and most of my Oregon Scientific Temperature & Humidity sensors with my own 🙂

Battery life estimation

Exciting… what will be the outcome of the calculations based on monitoring 2 motion sensors during a period of 24 hours and extrapolating this calculated power usage? OK, let’s start with writing down some ‘facts’, taking the worst case of the 2 sensors for each individual measurement:

  • The JeeNodes active time during a period of 24h is 102.4 seconds, with a current of 6.5 mA;
  • Power down current is 20 µA;
  • The XBee sends an average of 120 packets per hour, requiring the XBee to be on for a duration of 34 ms for each packet, using 40 mA current (from the datasheet);
  • XBee power down current is 1 µA (datasheet);
  • The PIR uses 170 µA (datasheet) while in standby mode and 270 µA (datasheet) during motion detection; motion detection duration is estimated at 400 seconds.

With these numbers it should be possible to calculate the average power consumption of each component:

  • JeeNode: 27,68 µA;
  • XBee: 2,88 µA;
  • PIR: 170,46 µA.

This adds up to a total of 201,02 µA. That’s the average current the motion sensor is using, based on a period of 24 hours.  With 2000 mAh batteries this results in 9950 hours = 414 days = 59 weeks… cool! That will do, for now, lol

However… how about the battery self-discharge?? How much will this influence the time this motion sensor will last on 1 set of batteries? I really don’t know; so, still, time will tell how well this sensor performs in terms of long lasting batteries.

Fortunately, I still have enough options to reduce power usage even more, like

  1. Using the energy saving version of the PIR;
  2. Disabling stuff on the ATmega like brown out detection (how do i change fuses? As i mentioned before, where will this end? 🙂 );
  3. Running the ATmega on a lower frequency.

And now that i have it all in a spreadsheet, i can manually adjust some values and see how it effects battery life. The smartest thing would be to go for the 1st option, cause that would reduce the standby current of the PIR down to 46 µA instead of 170… meaning 3 years !!

I’m going to order some extra PIR’s now…