We have moved at community.getvera.com

Author Topic: Arduino Sensor Plugin - Build your own wireless sensors!  (Read 262198 times)

Offline buzzdavidson

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #30 on: September 16, 2013, 04:44:49 am »
Was just poking around the forums and ran into your post - it's an interesting idea.

You might be interested in checking out the PanStamp project (https://code.google.com/p/panstamp/).  I have a handful of these and am in the process of integrating them with my Vera.  They have done a really good job of minimizing power usage - if nothing else, you may be able to glean some information from their implementation.

You might also be interested in the RF24Network library (http://maniacbug.github.io/RF24Network/); it implements a mesh network using NRF24L01 radios. (Edit: I just noticed that maniacbug himself already responded to this thread.  Hi Mike!)

I'll be interested in playing with your implementation - ZWave devices are ridiculously expensive.  I'll be happy to do a quick code walk-through and provide some suggestions (which you can feel free to ignore <g>).  Reading through this thread, I would suggest that you not transmit the full URN from each sensor node - it's unnecessarily verbose.  You'll be eating a lot of battery sending the same data over and over.  You already have a gateway node talking to Vera, just assemble it there.  The PanStamp project has done a good job of encapsulating device capabilities and information in a minimal footprint, it may be worth a look.


Offline korttoma

  • Hero Member
  • *****
  • Posts: 729
  • Karma: +26/-5
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #31 on: September 16, 2013, 07:01:56 am »
Really interesting topic.
I ?we been looking for an affordable solution to control my 2 motorized garage doors.
Seems like one of these would have enough I/O to serve my purpose and more.
All that is needed is basically 1 or 2 binary inputs to show the door position and 1 binary output to control the door.

Regards,
Tomas
- Tomas

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #32 on: September 16, 2013, 07:55:12 am »
@buzzdavidson
Thanks, I'll be glad for any feedback! Please do check the code! Especially if I can make the sensors less power hungry.
Currently doing some refactoring to cope with information going from vera to actuators (like relays). 

@korttoma
Absolutely. This would really work as a affordable solution for your garage doors.

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #33 on: September 17, 2013, 01:32:36 pm »
Ok! First basic support for actuators (relays etc) added. Also cleaned up the plugin code a bit.

http://code.mios.com/trac/mios_arduino-sensor/wiki/RelayActuator

This release have no resend functionality if message never reaches relay module. But the relay itself sends an update back to vera if it was changed. So its quite obvious that relay hasn't changed. 

When the the relay module starts up from off it requests the current state of the relays from Vera.

 

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #34 on: September 18, 2013, 02:45:30 pm »
Stabilized relay code and added example sketch for light sensor.

http://code.mios.com/trac/mios_arduino-sensor/wiki/LightSensor

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #35 on: September 18, 2013, 02:48:32 pm »
Is anyone using (or plan to use) the things I produce here?

There aren't much activity in this thread...

Would really like some more beta testers.

Offline Quinten

  • Sr. Member
  • ****
  • Posts: 273
  • Karma: +2/-0
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #36 on: September 18, 2013, 02:57:18 pm »
You know what, I'd love to get this started...  I've been hum-ing and ah-ing over the RFxtrx and some Oregon sensors, but this offers a much nicer solution.  The problem is that I have 10s of 'projects' on the go and none of them get finished ;)

Battery life for a (completely) wireless sensor should be a year minimum imho...  do you think that is achievable?
VeraLite - UI7 1.7.947 | 8x Fibaro FGD211 | 2x Fibaro FGS221 | 1x Fibaro FGBS321 | 3x Fibaro FGRGBW | 1x Everspring SP814 | 2x Everspring AN157-3 | 2x Heatmiser PRT-TS WiFi | 1x Logitech Harmony Hub | 1x Philips LivingColour

Offline twistedsanity

  • Sr. Newbie
  • *
  • Posts: 47
  • Karma: +0/-0
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #37 on: September 18, 2013, 05:20:53 pm »
Well I'm planning to give it a go, I've ordered some NRF24L01+ but still waiting for them to arrive (already have plenty of spare arduinos).

Offline gregl

  • Full Member
  • ***
  • Posts: 188
  • Karma: +9/-3
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #38 on: September 19, 2013, 08:32:28 am »
Hi Hek - Firstly - AWESOME job!!!!

I asked about someone ( much smarter than me ) doing this a while back - here: http://forum.micasaverde.com/index.php/topic,11736.0.html

Ill be all over this!! Please keep feeding us!


Offline gregl

  • Full Member
  • ***
  • Posts: 188
  • Karma: +9/-3
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #39 on: September 19, 2013, 08:39:58 am »
Hi Hek - ive not read entire thread yet  ( a bit too excited just yet - but with respect to running very low power - have you seen the work done by the Jeenode developer - http://jeelabs.org/intro/

He has apparently done some amazing work on getting the arduino's to run extremely low power. Ive seen others use his library/code in their projects - so perhaps this would fit the bill.


Anyway - thanks again... now off to do some more reading..... ;-)

Offline pat38

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #40 on: September 19, 2013, 03:50:21 pm »
Hi Hek,

Thank you so much for sharing this plugin!
I have a Vera since last Saturday, and I have immediately looked for a way to interface the Vera with my IR remote control (logitech harmony) to control the lights, and was disappointed not to find no solution at less than 100?.
I know pretty well Arduino, and the great IRremote library from Ken Shirriff's (http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html), so finding your plugin was a bless to put me at start on a cheap IR interface solution (approx 10?) :D
Thanks to your example, I had the plugin working on Sunday: for now it simply executes scenes with predefined names when I press buttons on the remote.
I am now trying to have the plugin generate events instead of directly running scenes, so that I do not have to use any particular names for the scenes... I am struggling with this for now: the documentation for luup is one of the worst I have ever seen :(

Anyway, thank you so much for this plugin! It is a great idea. I am sure I will be using your plugin in full very soon!

(for the IR plugin, once finished, I will post my plugin in a different thread. I do not want to pollute your thread, but just to say thank you :) )

Cheers,

Patrick


Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #41 on: September 19, 2013, 04:00:50 pm »
@pat38
Great to hear!

@greglions
Need to do some current measurements when my nanos arrive. They've been in the post void between China and Sweden for a month now! I don't really no how many uAmp they consume. Maybe it would be good to have this figure on the wiki per senors... Any help is appreciated.

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #42 on: September 20, 2013, 03:19:23 pm »
Rewrote most of the code today. Gave up on the idea of splitting up/putting together large messages. Moved more of the definitions to the vera plugin and only very short messages needs to be sent from/to sensors now. Max payload is now 29 bytes.
Stability is much better now and device creation simplified.

Also implemented a very basic "weather station" forecast using using the pressure sensor BMP085.
http://code.mios.com/trac/mios_arduino-sensor/wiki/PressureSensor

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #43 on: September 22, 2013, 11:26:26 am »
Added humidity sensor.
Improved stability when sending in values after powerdown/sleep.

http://code.mios.com/trac/mios_arduino-sensor/wiki/HumiditySensor


Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #44 on: September 23, 2013, 02:20:01 am »
Hi, Hek!
THX for relay suport )

4 questions:
1. Why did relay react to vera requests so looong? Just for test i push button and it requres 2-3 times to push on|off to work.
2. In PressureSensor.ino there is a string:
#define ALTITUDE 9.0  // Your altitude (in meters). This can later be configured in Vera.
How did it works? I mean data transfer from vera to arduino.
3. Could u make a support of variableContainer pluggin? Simply i need to store some arduino data in it.
4. Could u make a support of EEPROM. I mean a possibility to GET and SET variables/data on arduino.

thx for your work!!