We have moved at community.getvera.com

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

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #45 on: September 23, 2013, 02:45:31 am »
1. Probably bad reception. You can configure it to resend (requires you to re-compile the Arduino Gateway) at the top of Vera.h
2. Forget about that. Should be removed.
3. Sure.
4. Had some ideas about that too.. Using EEPROM we could probably let vera dynamically issue a radio-id for new sensors... which would ease the configuration a bit.

Offline FireBird

  • Jr. Member
  • **
  • Posts: 94
  • Karma: +2/-0
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #46 on: September 23, 2013, 01:43:21 pm »
Just wanted to say thanks for the great plugin and the how to documents you have created for this project. I'm thinking about buying the hardware soon, I would like to trend some temperatures in different parts of my house and this seems like a good solution for that.

Can the temperatures be converted to Fahrenheit easily?

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #47 on: September 23, 2013, 01:50:55 pm »
@Firebird
Yes it can be converted in Arduino sensor pretty easy. There is no support for vera side conversion just yet.

Offline FireBird

  • Jr. Member
  • **
  • Posts: 94
  • Karma: +2/-0
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #48 on: September 23, 2013, 02:10:45 pm »
Can I use the Mini USB Nano V3.0 ATmega328P as the Gateway and for the Sensor boards? I would like to buy everything from the United States not China (don't want to wait weeks for shipping).

The price difference is only $3 or so, plus I won't need to buy the FT232RL USB to Serial adapter. I'm new to Arduino so thanks for the help. How are you powering the sensors? I'm sure it's batteries but could you give some more detail, what type of battery etc.

Thanks again.

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #49 on: September 23, 2013, 02:39:58 pm »
Can I use the Mini USB Nano V3.0 ATmega328P as the Gateway and for the Sensor boards? I would like to buy everything from the United States not China (don't want to wait weeks for shipping).

Yes that is what I've used for my gateway. For the sensors you can use any Arduino board.

How are you powering the sensors? I'm sure it's batteries but could you give some more detail, what type of battery etc.

Currently powering them using a step down module.
http://www.aliexpress.com/item/10pcslot-LM2596s-DC-DC-step-down-power-supply-module-3A-adjustable-step-down-module-LM2596-voltage/912126670.html

I have not done any battery and/or power consumption tests yet (it will come...). And I recon it depend a lot on how you configure the sleeptime (how often it should report) of the boards.

Offline jackpot

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #50 on: September 23, 2013, 04:02:35 pm »
@hek,

Been following this thread for awhile and it's something I would like to try out. I have been working with a WiFly module and Arduino, it took me forever to get it working, but that's another story.

Went to code.mios.com to get the files for your Arduino project but it appears that I can only download one file at a time. I don't have an account there. Unless I'm doing something wrong in trying to get all the files needed, could you possibly ZIP them up into one project file ? Sure would help .

Great work by the way and please keep it up. It was just what I have been looking for !
Thanks again...
 
Vera 3....1.5.622

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #51 on: September 23, 2013, 04:16:17 pm »
Bed occupancy sensor? Or use it in the garage to show when the car has reached the right location. Why not measure your own length every day using your Vera?

Today's addition is a Distance sensor for vera. Distance in centimeters. Us-people. Please switch to use the metric system ;)

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

@jackpot
At the bottom of the following page you can download zip-archive...
http://code.mios.com/trac/mios_arduino-sensor/browser/trunk
« Last Edit: September 23, 2013, 04:23:57 pm by hek »

Offline jackpot

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #52 on: September 23, 2013, 04:19:51 pm »
Thankyou !

I just got it. ;D
I must be getting old, didn't see it before.
Vera 3....1.5.622

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #53 on: September 24, 2013, 08:40:05 am »
Added support for Variable Container

Code: [Select]
  // Create container

  setup() {
     ...
     vera.sendSensorPresentation(0, S_VCONTAINER);
  }

  loop() {
         vera.sendVariable(0, V_VAR1, "4711");
         vera.sendVariable(0, V_VAR2, "4712");
         vera.sendVariable(0, V_VAR3, "4713");
         vera.sendVariable(0, V_VAR4, "4714");
         vera.sendVariable(0, V_VAR5, "4715");
      ....
   }

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #54 on: September 24, 2013, 09:45:02 am »
When testing the variable container a little more there seem to be some problems...  It makes the communication "crash" in the main device. I don't know if it does not like to be a child device or if it outputs stuff to the serial post that makes the main device behave like this... The only difference I can see is that it got its own implementation file.

Arduino Gateway Plugin[272] : Failed to open IO Port

09/24/13 15:37:42.224   luup_log:272: Arduino plugin: Port already in use <0x2ea03680>

Any help regarding this would be appreciated!
« Last Edit: September 24, 2013, 09:54:10 am by hek »

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #55 on: September 25, 2013, 04:35:23 am »
1. Probably bad reception. You can configure it to resend (requires you to re-compile the Arduino Gateway) at the top of Vera.h
Fixed!! yes u were right) "bad reception". thx

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #56 on: September 25, 2013, 07:01:26 am »
another feature requests:
- battery level. http://maniacbug.wordpress.com/2012/03/30/rf24network/ - it's very important to now if a battery driven dvcs in poor state
- NRF24 device status on Arduino gateway. Battery level could be a part of status of "NRF24sensor", last time connection, error(s), Known devices and addresses. What's more?

Hek, thx!!


Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #57 on: September 25, 2013, 07:35:29 am »
You can actually send battery status from your sensor already using V_BATTERY_LEVEL and V_BATTERY_DATE. The trick is to build a sensor where you can read out the battery status.

The arduino gateway is stateless right now. I would like a really good reason why it shouldn't :)
Last update could be stored directly in a variable directly in the vera device. Any particular reason for this?

Offline axill

  • Full Member
  • ***
  • Posts: 183
  • Karma: +3/-0
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #58 on: September 25, 2013, 03:59:28 pm »
hek thank a lot for your good work!
will follow the project as I'm also looking for the similar solution.
I've tried to build tcp/ip based gateway but your way is much smarter.

I have an idea to share about assigning ID to radio device.
It looks like how zwave devices are paired.
- let us put a button to any arduino device
- as soon as a button pressed a special message (a request) is issued to arduino gateway
- gateway should send back a special message with ID
- the only arduino device who had button recently pressed should react to the message with ID and ID should be stored in EEPROM for the use

to keep arduino gateway stateless we should ask vera to provide an ID, it can be even copy of the id of the parent device created in vera for our arduino device

alternativelly we have no button - each new device who see at startup that EEPROM is empty (0xff) at addrees of ID should request it from arduino gateway but we should manage to have only one NEW device powering up at a time

Offline axill

  • Full Member
  • ***
  • Posts: 183
  • Karma: +3/-0
Re: Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #59 on: September 25, 2013, 04:50:26 pm »
I would like also to make a future request.
Is it possible for devices to recieve a clock/date data from vera?

It would be nice to build simple home clocks without any need for their mannual management - clock will be always in sync with vera while vera is in sync with the rest of the world