Announcement

Collapse
No announcement yet.

Analog Devices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Analog Devices

    As a sign of support I made my purchase for the plug in today. It has been rock solid and I can reach out with a cat 5 cable to control devices or gather information. POE (power over Ethernet) can make it all just one single wire to that location. Thanx.
    It would be nice to gather ideas as to how others are using the analog features of the arduino to interface with HS3. Using changing values to make decisions and what next action needs to be done to change the value back to the "ideal" value by way of a fan, opening a window, moving something and on and on.
    I'm having trouble using the analog values and I'm sure others might be too HS3 has not provided any information as to how to manipulate these values into useful actions my first attempt was with the ADIO100, it sits aside now that I have the Arduino. Is there more information about using the API? Perhaps someone can provide an example from conception to working. I know I'm going to learn to use the sketches to use the possessing features in the Arduino to perform actions and send back the results to HS3 so I can use other technology's connected to HS3 to turn lights on, send an email, connect to another Arduino on the other side of the house, property or city and take readings of temperature or current being drawn from a battery or solar charger.
    Has anyone thoughts on being able to record the analog values or digital I/O's into a chart or data base to use in a way to measure progress on the signals HS3 is using to make decisions to help "tune" things up. It would be very helpful to capture the data to adjust the way HS3 is seeing things to get what is desired.
    Thanx again for a very promising introduction to a very flexible device that anyone can now access no matter their programming abilities.

  • #2
    Although I don't use the plugin I do use analogue data with the Arduino, I know it can appear a little vague of connecting say an LDR and having a value of "34" for this and how does that correlate to something that actually means something logical. I will explain a little bit what I think you might want to do.

    For that you have to look at analogue to digital conversion, an analogue input on the Arduino is ten bits. It therefore has a range of 0 to 1023, as the input is 0 to 5 volts each step is worth 0.0049 volts. A reading of 898 is 898 x 0.0049 = 4.40 volts on the input pin.

    So if you pick a device on your input like a LDR then providing these are connected directly to the input (without any additional resistance) you would get a value on the analogue input proportional to the resistance of the LDR. This is where maths get involved and you need to calculate what the voltage means, thermistors can be a nightmare (use one wire ) because of the maths. If you pick something like http://www.rapidonline.com/Electroni...rSearchScope=1 you get typical values for the light and dark resistance, you then need to work out what your typical voltage values would be for those resistances and you can translate your A-D value to something meaningful like lux.

    My preference was always to do calculations like this in HS, the alternative is to do them inside the arduino and just send data into HS already formatted. My preference was if the calculation ever needed changing then it is far easier to do it in a script than an arduino sketch if the arduino is hanging outside somewhere. What I did was to trigger off the value changing, fire another script, make the calculation and write this to another device.

    If you post your specific sensors can give you an idea, sometimes it is just easier to get approximate (light/dark rather than lux) values rather than trying to calculate something accurate.

    Charting is a whole other game, I do it with my Arduino but that isusing an SQLite DB and not straightforward to get going. There are a couple of solutions out there but there is a possibility this function is going to end up in HS anyway.
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Originally posted by Daggy67 View Post
      As a sign of support I made my purchase for the plug in today. It has been rock solid and I can reach out with a cat 5 cable to control devices or gather information. POE (power over Ethernet) can make it all just one single wire to that location. Thanx.
      It would be nice to gather ideas as to how others are using the analog features of the arduino to interface with HS3. Using changing values to make decisions and what next action needs to be done to change the value back to the "ideal" value by way of a fan, opening a window, moving something and on and on.
      I'm having trouble using the analog values and I'm sure others might be too HS3 has not provided any information as to how to manipulate these values into useful actions my first attempt was with the ADIO100, it sits aside now that I have the Arduino. Is there more information about using the API? Perhaps someone can provide an example from conception to working. I know I'm going to learn to use the sketches to use the possessing features in the Arduino to perform actions and send back the results to HS3 so I can use other technology's connected to HS3 to turn lights on, send an email, connect to another Arduino on the other side of the house, property or city and take readings of temperature or current being drawn from a battery or solar charger.
      Has anyone thoughts on being able to record the analog values or digital I/O's into a chart or data base to use in a way to measure progress on the signals HS3 is using to make decisions to help "tune" things up. It would be very helpful to capture the data to adjust the way HS3 is seeing things to get what is desired.
      Thanx again for a very promising introduction to a very flexible device that anyone can now access no matter their programming abilities.
      I think MrHappy summed this all up and if you do have a calculation that needs to be done then this can be added to the Analog inputs on the config page so that it shows on the device in Homeseer so there is no double device creation or scripts needed for this. The default calculation that is in there will give a value from 0% to 100% and can be inverted to give 100% to 0%. The calculation is Value*100/1023.

      What are you thinking of using?

      The API.ino is just like programing the Arduino with your own code but I have wrapped it with the required code to send the data you want to Homeseer in an easy way. You can now also send data from a Homeseer Device to the Arduino and act on that data so if you can program the Arduino or want to learn how this would be the way to go.

      If you are looking to chart then I would say BDGraphs would be worth a look.

      Greig.
      Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
      X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
      Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
      Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
      Scripts =
      Various

      Comment


      • #4
        Thank you for taking the time to explain. I've been busy sorting out what & how I want to do things. I'm stuck with the analog input to show humidity. I have an HIH-4000 sensor, that has a zero offset of .799 and a slop of 31.096907mv/%RH. I need to include data from the one wire temp sensor on the same board to give me relative humidity. I have had no luck doing it in the arduino plug in, not using the API. I was hopeful I could use the analog pin setup sum box but it wont work(value-0.799)/0.031 and somehow put the temp reading from one wire in for the rest of the calculation . Is there a way I can create a virtual device that will gather up my humidity sensor and temp readings do the calculation and present it?
        I was also wondering about the preset output pin going high, a lot of the isolated relay packs sold on ebay for AVR seem to lead towards sinking the pin to ground rather than source the output pin. Could their be an option to have sink or source selection for the output pins? I'm putting together my own relay drive using the ULN2003 type Darlington array that suites my purpose for driving the relays with whatever voltage I want and satisfies the sourced pin output.
        I wish someone would do a video of their set up, from concept model to working finish. That would really get the creative juices flowing, do you know of anyone who has done such with HS3?
        Thanx again

        Comment


        • #5
          Daggy67 drop me an email and I will send you a beta version tha should allow you to do this calculation.

          Sent from my HTC One using Tapatalk
          Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
          X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
          Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
          Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
          Scripts =
          Various

          Comment

          Working...
          X