Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Using Arduino for Remote Sensing Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
renard
Groupie
Groupie
Avatar

Joined: November 01 2009
Location: United States
Online Status: Offline
Posts: 74
Posted: October 27 2015 at 21:44 | IP Logged Quote renard

I am looking at strategies to use Arduino micro-computers to support remote (non-Insteon) sensors and incorporating them into the PH Device database using Virtual Devices. I want to review my proposed architecture with this august body for comments and suggestions.

There are several design objectives:

1.     Support 1-wire sensors beyond thermometers to include sensors for humidity, soil moisture, solar flux, and other interesting things.

2.     Support solar-powered devices and Wi-Fi connectivity to not be limited to either grid power or powerline/Insteon-mesh network communication.

3.     Not compromise security of my household network comprised of nine PCs connected by gigabit Ethernet cabling and a part-time, highly secured Wi-Fi network with long and complex password. Total IP connected devices in the house are thirty.

Arduino Uno with the appropriate library provides native 1-wire support as well as USB-serial connectivity and WiFi capability with the appropriate shield. For network security reasons, I have eliminated as an option a PH network plug-in as that would require imbedding the primary Wi-Fi network password into the Arduino device that could/would be outside the house and subject to theft. Even using a second Wi-Fi network (except for the solution proposed below) could allow an unintended bridging between the two IP networks by Windows and permit an intruder to connect using the stolen Arduino WiFi network password and gain access to the primary PC network.

The proposed solution will use a second Wi-Fi network to communicate between an Arduino Master Controller (AMC) and a constellation of Arduino Remote Controllers(ARCs) that is totally independent of the primary network. The AMC would communicate with the House Control PC using a USB hardwired to a USB port on the House Control PC and using the COM Control PH functions discussed below.

PH would communicate with the AMC using a set of standard message formats. The first format is to initialize the AMC and using a ‘roll-call’ function in the AMC sketch, determine what ARCs are available. The roll-call function would also be called by the AMC sketch Setup function when the board is powered up. The roll-call function could be commanded on a periodic basis by PH by sending the proper command to the AMC.

When the AMC roll-call function is started, the AMC would attempt to communicate in turn with a predefined number of ARCs using a query status command. ARCs that respond would be noted on an array of valid ARCs in the AMC sketch. The AMC sketch Loop function would run continuously and poll the identified ARCs in turn on a cycle, perhaps once per minute.

The ARC sketch Setup function would establish communication with its 1-wire sensor array and await the roll-call from the AMC. When identified by the AMC roll-call function, the ARC Loop function would periodically poll the 1-wire sensor array and maintain the current value of each 1-wire sensor. When the AMC sends a data poll to the ARC, it responds back to the AMC with predefined packets with current values for its sensor array.

The AMC sketch Loop function would decode the packets and send them via to the USB link to PH where the appropriate PH COM function would generate an interrupt that would launch a macro that uses ph_comrecvstring retrieve and various functions to decode the message and put provided value into the Vx.xx.xx Insteon Virtual Device level in the device table using ph_insteonwithret . All ‘levels’ for that device will need to be translated into a single byte value between 0 and 255 that is appropriate for the sensor.

Does anyone see a technical problem with the proposed approach, particularly around using Insteon Virtual Devices and the ph_insteonwithret function. The objective is to have these ‘devices’ report their level value just like a real device.

Thanks to everyone.


__________________
Terry
Back to Top View renard's Profile Search for other posts by renard
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 27 2015 at 23:10 | IP Logged Quote dhoward

Terry,

Based upon your requirements concerning your network,
I think your proposed solution is probably our best
option. I would like to say this is a grand vision and
I would be very interested in hearing how it all turns
out . I don't think anybody has attempted this
level of custom hardware integration.

That said, a couple of suggestions. If you're up for
creating your own custom sketches and such for the
arduino's, it probably wouldnt be too difficult for
you to create a custom plugin to handle the
communication. This would be alot cleaner and more
efficient than relying upon the internal COM routines.

The other thing I would change is using the Insteon
virtual devices. While this should work for you, I
think you would have alot more flexibility in using
virtual Analog I/O devices. The Analog I/O table gives
you both a "raw" value and a "calculated" value with
formulas for conversion between the two and would make
the display of your temperatures, humidity, solar,
etc. much easier than adapting a virtual Insteon which
is going to try to display Lighting percentage and on
or off. The Analog table is what is used for all of
the "extended" Insteon controls such as the
thermostats, IOLincs, etc. You could declare a new
PowerHome Controller of type "PowerHome Virtual" (this
is just a dummy controller) and an Analog I/O type of
"Input" or "Output" and then control or "set" the
virtual device using the ph_setanalogout function. It
takes a little getting used to if you havent used the
Analog table before but there are quite a few
functions that make this great for any type of
"virtual" device and allows you a much greater range
of options for Display on the device status screen.

Hope this helps and let me know how it goes.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
renard
Groupie
Groupie
Avatar

Joined: November 01 2009
Location: United States
Online Status: Offline
Posts: 74
Posted: October 29 2015 at 22:20 | IP Logged Quote renard

Thanks Dave,

I appreciate the advice and will follow it. I'll keep everyone updated on my progress.

__________________
Terry
Back to Top View renard's Profile Search for other posts by renard
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum