Author Topic: Arduino without radio (wired sensors directly on arduino) ?  (Read 601 times)

Offline Mai Pensato

  • Full Member
  • ***
  • Posts: 225
  • Karma: +4/-1
Arduino without radio (wired sensors directly on arduino) ?
« on: March 20, 2018, 06:16:53 pm »
Question: is it possible to use this plugin by connecting wired sensors directly to the Arduino gateway so without using radio?
« Last Edit: March 20, 2018, 06:49:28 pm by Mai Pensato »

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1079
  • Karma: +5/-4
  • Black Cat Control Systems
Re: Arduino without radio (wired sensors directly on arduino) ?
« Reply #1 on: March 20, 2018, 09:18:45 pm »
I think that question would best be answered on the mysensor forum, there could be a protocol that needs to be included?
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 252
  • Karma: +15/-5
Re: Arduino without radio (wired sensors directly on arduino) ?
« Reply #2 on: March 20, 2018, 11:34:38 pm »
MySensors can use RS485 (wired) transport if you want to go down that path.

Offline Mai Pensato

  • Full Member
  • ***
  • Posts: 225
  • Karma: +4/-1
Re: Arduino without radio (wired sensors directly on arduino) ?
« Reply #3 on: March 21, 2018, 05:27:57 pm »
To be clear: my plan is to connect the Arduino gateway via wired ethernet. So I will buy an Arduino with ethernet shield. The analog sensors I want to connect via Arduino to my Vera are already wired and powered. And on this place I also have an ethernet connection. So I don't have a need for buying two radio's and an extra arduino. I did already quite some research on the mysensors forum and also this topic here. I found some advice and hints how to do it but it's still not clear to me how to adapt the sketches so it will work. But I also have read that some Vera users have it working. So I hope some of them are still active here and willing to help me and share their solution. I have no experience yet with Arduino and programming in C.
I will also ask support at the mysensors forum.
Thanks in advance!

Offline JohnRob

  • Full Member
  • ***
  • Posts: 245
  • Karma: +12/-4
Re: Arduino without radio (wired sensors directly on arduino) ?
« Reply #4 on: March 26, 2018, 12:15:17 am »
My understanding is that it can be accomplished, with one caveat.  That is I don't know if MySensors code will compile if there is no radion in the sysem.

In addition to programming a sensor in the gateway processor, one needs to get it recognize by the network.  The tools at the following link will help to complete the recognition. https://www.mysensors.org/controller/myscontroller.

***Update***

I found to run without the radio (in my case for testing)
Replace
#define MY_RADIO_RFM69  (or whatever radio you have)
with
#define MY_GATEWAY_SERIAL //(for test only)
« Last Edit: May 07, 2018, 03:22:45 pm by JohnRob »

Offline Mai Pensato

  • Full Member
  • ***
  • Posts: 225
  • Karma: +4/-1
Re: Arduino without radio (wired sensors directly on arduino) ?
« Reply #5 on: March 26, 2018, 06:13:21 pm »
Hi JohnRob,  thanks for your reaction!
I also understood that it is possible. I only don't know how to adapt the sketch to get it working wihout a radio.
I have also read that you can use myscontroller to get the sensors recognized and included in Vera. I believe user Korttoma mentioned this somewhere.  But how to do this exactly I have not found yet.

But I am not yet at that point to integrate it into my Vera by means of the plugin.
I bought a Arduino Mega last week. I connected my analag sensors and have a sketch working that I can see all the readings from the analog sensors in the serial monitor...... but ..... the values fluctuate a lot!

To explain my set up in short:
I want to connect a sensor that is used in professional horticulture and measures the moisture content (%), fertilizer level (EC) and temperature of plants that are grown in pots or substrates. This sensor has three analog outputs (0-5 Volt) for WC, EC and T. The sensor measures every few seconds but only every 3 minutes the Volt signals on the analog outputs are changed (average of all the measurements in past three minutes).  So I am sure the signal on the analog outputs is stable.  I have succesfully connected it before to Fibaro RGBW controller that can also be used to connect analog sensors. Disadvantage of this controller is that the output is only in integers (%) but I need a more precise measurement (at least 1 decimal).

This sensor has its own power (48 Volt adapter). Per analog output it has a + and - (ground) output signal. The ground outputs are gavanically separated from the ground of the power of the sensor.   So I connected the + output on one of the analog inputs of the Arduino (A0, A1, A2) and the - outputs on the GND inputs of the Arduino. In the sketch I put a delay of 10 seconds.
I also recalculated the measurements sucessfully from the 0-1023 scale that Arduino uses to the right WC%, EC level and Temperature.
But... as mentioned the measrues fluctuate a lot. For example temperature readings fluctuate more than 2 degrees Celcius within 2 minute time frame whereit should be exactly the same or vary maximum 0,1 degree.
So something is not correct yet I think in the wiring or too much noise. I am not very familiar with electronics and no experience with Arduino.

May be someone out here knows a solution for this.
I will also ask this on forum specialized in Arduino.

many thanks in advance.

Offline JohnRob

  • Full Member
  • ***
  • Posts: 245
  • Karma: +12/-4
Re: Arduino without radio (wired sensors directly on arduino) ?
« Reply #6 on: April 05, 2018, 11:19:28 am »
Since my original response I've learned a few things:

1) you can compile without a radio.  Comment out MY_RADIO_RFM69 and add MY_GATEWAY_SERIAL.

2) to include a sensor on the gateway you need MYSController.zip    It is a Windows based GUI that acts like a gateway controller, allowing you to include the sensor on the hardware controller.

John

Offline ninkasi

  • Full Member
  • ***
  • Posts: 194
  • Karma: +10/-0
Re: Arduino without radio (wired sensors directly on arduino) ?
« Reply #7 on: April 23, 2018, 09:08:54 pm »
2) to include a sensor on the gateway you need MYSController.zip    It is a Windows based GUI that acts like a gateway controller, allowing you to include the sensor on the hardware controller.

That's a neat utility, but you should be able to hook sensors straight onto the gateway without anything else. I'd only bother running that utility to help troubleshoot if the sensors don't appear on Vera (perhaps they won't appear as you won't have to "include" them, so the utility can emulate that so the Vera plugin will then recognise they exist). Search the forums eg https://forum.mysensors.org/topic/2794/connect-sensors-directly-to-the-gateway-again. The only problem you might have with a genuine arduino as both a gateway and sensor is running out of memory, depending on the number of sensors and size of your program - but frankly that's unlikely to be an issue.

Once you've got the gateway running, just install the vera plugin (https://www.mysensors.org/controller/vera) and tell it the IP address of the gateway (make sure you give the gateway a fixed IP address).

Personally though, I like having the gateway and sensors separate. Yes it's an additional cost, but that additional cost is minimal and it means if you are adding in an extra sensor etc it doesn't impact on all the other sensors. A full sensor (radio, arduino pro mini, case, etc) costs me around $5 to build - I use them to monitor temperature in fridge/freezers, door open/close, etc. FWIW I also use an ESP8266 (WeMos D1R2) as the gateway - it has wifi built in (so was cheaper than an arduino with shield), and compared to an arduino has lots of memory and way more processing power.
Home Automation veteran. Rolled own, then MisterHouse and X10, now Vera - mysensor arduino and ESP8266 network - zwave lights, locks, switches - milights - yeelights - google home(s) - Broadlink RM - raspberry pi(s) with various scripts for power and weather station - Logitech Harmony - Imperihome