Announcement

Collapse
No announcement yet.

Noob reporting in

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

    Noob reporting in

    I have heard of Arduino but I really have no idea what it is and was wondering if you guys could give me some examples of what you are using it for to see if it would benefit me at all. I also have no idea what board would be the best to get (I would want one that will last me a while and not have to upgrade to get more inputs)

    I appreciate it
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    #2
    Originally posted by Blade View Post
    I have heard of Arduino but I really have no idea what it is and was wondering if you guys could give me some examples of what you are using it for to see if it would benefit me at all. I also have no idea what board would be the best to get (I would want one that will last me a while and not have to upgrade to get more inputs)

    I appreciate it
    There are lots of choices of Arduino boards. I believe the UNO and the Mega are the two most viable choices for use with HomeSeer. They are based on 5-volt TTL logic, where some of the newer ones are 3.3v. The Uno is slightly smaller and offers up to 14 Digital I/O pins and 6 analog inputs. The Mega is slightly larger and offers 54 digital I/O pins and 16 analog pins. They are each compatible with the same "shields" which can be used for Ethernet connectivity, relay boards, PWM controllers, etc.

    The two most viable connection options is via USB which can power the board and Ethernet, requiring a separate 6-9 volt power supply. There are also POE Ethernet shields.

    I use 3 Mega boards, one is a test board on my workbench used for breadboarding to work out ideas for control and the other two are in production. I chose to use Ethernet with POE shields instead of USB so that the boards are reachable by any HomeSeer server I bring online without the need to move wires. Since my POE switch is supplied by a UPS, the boards are assured constant power. Every device I have that connects to HomeSeer uses Ethernet for the ame reasons. The following are things I have implemented in a production environment with the two Mega boards.
    • I use 9 outputs to control zone valves in my heating system via opto-isolated relay boards
    • I use 9 inputs to monitor the zone valve position switches
    • I use 6 inputs to monitor the dry contacts from the wireless receivers from some ground moisture sensors to help control irrigation logic
    • I use a couple oF OneWire DS18B20 temperature sensors to monitor the temperature in each board location.
    • I use 2 inputs and two outputs for control of my master water shutoff valve. The inputs monitor the valve position and the outputs control whether the valve is opening or closing
    • Three PWM outputs control an RGB LED strip that I installed in a groove I dadoed into the bottom of my stair grab rail. It is used for night illumination of the stairwell to the basement and we use color and intensity for fun. It might light up in Christmas colors or our favorite sports teams colors during games (we are NFL football fans)
    • I use several outputs and one input to control LEDs and read a button input on a wall plate upstairs. The LEDs show us if the heat is enabled, if the heat is running and if the DHW (hot water) is heating. The button toggles the heating system from enabled to disabled. With the press of this button we can shut off the heat throughout the house without going to the 8 thermostats. I use the same outputs and inputs, plus a few more outputs for a heating system status panel in the basement. The status panel shows if the circulator or burner is running, which of the 9 zones is demanding heat and if there is a fault in the communication of either Arduino board.
    • I use an output pin on each board as an "alive" pin. This pin is pulled high as long as the board is communicating with HomeSeer. The pin will go low if the board stops communicating for any reason, whether the network or the HS server is down or if the boards loses power. These "alive" pins display via the fault indicators above as well as to switch over to failsafe control of my heating and hot water system if there is a failure in the boards or HS server.
    • I used an output to control a relay to power cycle my Z-Troller before I switched to a Z-Net. The Z-troller would on rare occasions need resetting, so far the Z-Net has not. The Z-Net is powered by POE I can control it through the network switch.

    I am playing with an LCD display hat has 4 lines of 20 characters. each board can drive one of these. I may use some more PWM outputs for some more LED lighting at some point

    The boards can read analog inputs, I have not found a need for that in my system. The boards can control a servo, another item I haven't found a use for yet.

    I recommend the Mega board because of the huge number of inputs and outputs for not much more money. Both boards give up 2 or 3 digital pins if you use an ethernet shield which can be limiting on the Uno.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      That should cool. Thanks for the reply.

      The MEGA is likely the one I would get. Looks like there are 2 Mega boards (Mega 2560 and Mega ADK). Not sure if one is better than the other.

      I assume this is the Ethernet board needed:

      http://www.arduino.cc/en/Main/ArduinoEthernetShield
      Cheers,
      Bob
      Web site | Help Desk | Feature Requests | Message Board

      Comment


        #4
        Originally posted by Blade View Post
        That should cool. Thanks for the reply.

        The MEGA is likely the one I would get. Looks like there are 2 Mega boards (Mega 2560 and Mega ADK). Not sure if one is better than the other.

        I assume this is the Ethernet board needed:

        http://www.arduino.cc/en/Main/ArduinoEthernetShield
        The 2560 is the one. The ADK is the same board specifically equipped to connect to Android phones. That is the correct shield. I highly recommend genuine Arduino for the Ethernet shields. I have had trouble with the knock offs. I also use genuine Arduino boards, though the Chinese clones have not had any problems in testing.
        HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

        Comment


          #5
          Wireless is also an option. It's possible to make arduino that broadcasts data that can be received and decoded by RFXCOM, or MySensors. Sparkman shared some info in this thread:

          http://forums.homeseer.com/showthrea...=174071&page=2
          HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

          Google Search for HomeSeer Forum

          Comment


            #6
            Originally posted by LeoS View Post
            Wireless is also an option. It's possible to make arduino that broadcasts data that can be received and decoded by RFXCOM, or MySensors. Sparkman shared some info in this thread:

            http://forums.homeseer.com/showthrea...=174071&page=2
            It is an option, but the reason I didn't mention it is because I don't think it is an option that can be used with this plug-in. WiFi is also an option, but connection reliability has been a problem for some users.
            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              Originally posted by rprade View Post
              It is an option, but the reason I didn't mention it is because I don't think it is an option that can be used with this plug-in. WiFi is also an option, but connection reliability has been a problem for some users.
              Ahh ok, missed the context. I often think Arduino as a platform to create inexpensive sensor/input devices with many comm options.. of course it's much more than that.
              HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

              Google Search for HomeSeer Forum

              Comment


                #8
                So this is what I would need then to get started:

                Arduino Mega 2560:

                http://canada.newark.com/arduino/a00...ega/dp/45W6205

                Ethernet Shield:

                http://canada.newark.com/arduino/a00..._Ethernet_None
                Cheers,
                Bob
                Web site | Help Desk | Feature Requests | Message Board

                Comment


                  #9
                  Originally posted by Blade View Post
                  So this is what I would need then to get started:

                  Arduino Mega 2560:

                  http://canada.newark.com/arduino/a00...ega/dp/45W6205

                  Ethernet Shield:

                  http://canada.newark.com/arduino/a00..._Ethernet_None
                  Those should do it. Don't hesitate to ask if you have questions. EnigmaTheatre (Greig) wrote a great plug-in.
                  HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #10
                    I'm also checking out the Arduino for some garage projects.

                    Garage door control - connect across the garage door opener buttons to open/close the garage (two garage openers)
                    1-Wire sensors - would like to read several 1-wire sensors: temp for chest freezer, temp for ambient temperature/humidity in the garage, moisture sensor to detect leaks under my water meter - total 3 sensors
                    Valve control - if leak is detected, turn off water.

                    Could this be accomplished with 1 Arduino, or will I need multiple units?

                    Thanks.
                    Jim

                    Comment


                      #11
                      Originally posted by GadgetBoySI View Post
                      I'm also checking out the Arduino for some garage projects.

                      Garage door control - connect across the garage door opener buttons to open/close the garage (two garage openers)
                      1-Wire sensors - would like to read several 1-wire sensors: temp for chest freezer, temp for ambient temperature/humidity in the garage, moisture sensor to detect leaks under my water meter - total 3 sensors
                      Valve control - if leak is detected, turn off water.

                      Could this be accomplished with 1 Arduino, or will I need multiple units?

                      Thanks.
                      Jim
                      Hi and welcome to the world of Arduino.

                      Yes is the answer to can you do this on one Arduino. Get a mega and this will do you for while. Some people prefer to have a couple of Ethernet Uno's so you can place them around the house closer to the contacts so there is only one cable to run and not one for each contact.

                      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


                        #12
                        Originally posted by enigmatheatre View Post
                        Hi and welcome to the world of Arduino.

                        Yes is the answer to can you do this on one Arduino. Get a mega and this will do you for while. Some people prefer to have a couple of Ethernet Uno's so you can place them around the house closer to the contacts so there is only one cable to run and not one for each contact.

                        Greig.
                        That is the plan (to start). The first Arduino would be located in the garage to connect to everything located there. Running CAT5/6 to the garage would be extremely easy.

                        So, I can get away with Arduino Mega? I see a ton on eBay - where's the best place in your opinion to pick them up?

                        Comment


                          #13
                          Guys, check out mysensors.org (and search for the forum thread). It's a framework someone has invented to get started in this super easy. You can use any board (including the $5 nanos and pro minis) and get setup and speaking to homeseer in less than a few hours. It's a bit like z-wave, you build a gateway (think usb z-wave module) and then build all your wireless sensors which speak to the gateway.

                          So far I've built a wireless 4x power adaptor, a garage multi-unit (garage door open/close with open/close/moving status and motion sensor), a single motion sensor and a single button. Today I'm going to build a blind controller to replace the z-wave one I broke last week (doing something stupid). Z-Wave in australia costs about $85 per module, I can build the exact equivalent using arduino for less than $10.

                          If Blade is getting into arduino I think we can expect some cool plugins and developments!!!

                          Comment


                            #14
                            Originally posted by Mattyjee View Post
                            Guys, check out mysensors.org

                            So far I've built a wireless 4x power adaptor, a garage multi-unit (garage door open/close with open/close/moving status and motion sensor), a single motion sensor and a single button. Today I'm going to build a blind controller to replace the z-wave one I broke last week (doing something stupid). Z-Wave in australia costs about $85 per module, I can build the exact equivalent using arduino for less than $10.

                            If Blade is getting into arduino I think we can expect some cool plugins and developments!!!

                            Do you have links or guides to the things you've built? I did a quick search on mysensors.org and couldn't find the garage door controller.

                            Thanks!

                            Comment


                              #15
                              Here are some example sketches:

                              This is my garage door and motion sensor sketch. I have a reed switch wired between ground and pin 3 for open, ground and pin 4 for closed and have a motion sensor wired to pin 5 (as per the examples on mysensors.org). This one doesn't have control but that is easy to add by incorporating the relay example (similar to my second example). I'm still using my DSC alarm system to control my garage door.
                              Code:
                              #include <MySensor.h>  
                              #include <SPI.h>
                              
                              boolean D3_T = LOW;
                              boolean D4_T = LOW;
                              boolean D5_T = LOW;
                              boolean D6_T = LOW;
                              int millis_T = 0;
                              int millis_S = 0;
                              int COMPOSITE = 0;
                              int COMPOSITE_T = 0;
                              boolean LAST_STATE = LOW;
                              
                              MySensor gw;
                              // Initialize motion message
                              //MyMessage msg3(3, V_TRIPPED);
                              //MyMessage msg4(4, V_TRIPPED);
                              MyMessage msg5(5, V_TRIPPED);  //Motion Sensor
                              MyMessage msg6(6, V_TRIPPED);  //Spare DI
                              MyMessage msg7(7, V_DISTANCE); //Composite Garage Door Position
                              
                              void setup()  
                              {  
                                gw.begin(incomingMessage);
                              
                                // Send the sketch version information to the gateway and Controller
                                gw.sendSketchInfo("Garage Multifiunction", "1.0");
                              
                                pinMode(3, INPUT);      // sets the pin as digital input
                                pinMode(4, INPUT);      // sets the pin as digital input
                                pinMode(5, INPUT);      // sets the pin as digital input
                                pinMode(6, INPUT);      // sets the pin as digital input
                                digitalWrite(3,HIGH);   // Activate internal pull-up
                                digitalWrite(4,HIGH);   // Activate internal pull-up
                                digitalWrite(6,HIGH);   // Activate internal pull-up
                                // Register all sensors to gw (they will be created as child devices)
                                //gw.present(3, S_DOOR);      //send composite data only (7)
                                //gw.present(4, S_DOOR);      //send composite data only (7)
                                gw.present(5, S_MOTION);     //motion sensor
                                gw.present(6, S_DOOR);       //spare DI
                                gw.present(7, S_DISTANCE);   //composite garage door position
                              }
                              
                              void loop()     
                              {   
                                // Read digital pins
                                boolean D3 = digitalRead(3);
                                boolean D4 = digitalRead(4);
                                boolean D5 = digitalRead(5);
                                boolean D6 = digitalRead(6); 
                                
                                int timesince = millis() - millis_S;
                                
                                // do computation for composite door status
                                if (D3==LOW && D4==HIGH) {
                                 COMPOSITE = 1; // Open
                                 millis_S = millis();
                                 LAST_STATE = HIGH;
                                }  
                                if (D3==HIGH && D4==LOW) {
                                 COMPOSITE = 0; // Closed
                                 millis_S = millis();
                                 LAST_STATE = LOW;
                                }  
                                if (D3==LOW && D4==LOW) {
                                 COMPOSITE = 5; // Error
                                }   
                                if (D3==HIGH && D4==HIGH && LAST_STATE==HIGH && timesince <= 20000) {
                                 COMPOSITE = 3; // Closing
                                } else if (D3==HIGH && D4==HIGH && LAST_STATE==LOW && timesince <= 20000) {
                                  COMPOSITE = 2; // Opening
                                } else if (D3==HIGH && D4==HIGH) { 
                                 COMPOSITE = 4; // Partial
                                }
                                
                                // write out changes to Gateway.
                                if (COMPOSITE!=COMPOSITE_T) {
                                gw.send(msg7.set(COMPOSITE), true);  // Send composite value to gw
                                }
                              
                                  if (D5!=D5_T) {
                                gw.send(msg5.set(D5?"1":"0"), true);  // Send DI value to gw
                                }
                                
                                  if (D6!=D6_T) {
                                gw.send(msg6.set(D6?"1":"0"), true);  // Send DI value to gw
                                }
                                
                                // re-write out status every 90 seconds
                                int deltaT = millis() - millis_T;
                                if (deltaT >= 90000) { 
                                Serial.println(deltaT);  
                                gw.send(msg7.set(COMPOSITE),true);  // Send composite value to gw
                                gw.sleep(200);
                                gw.send(msg5.set(D5?"1":"0"),true);  // Send DI value to gw
                                gw.sleep(200); 
                                gw.send(msg6.set(D6?"1":"0"),true);  // Send DI value to gw
                                gw.sleep(200);
                                millis_T = millis();
                                }
                                gw.wait(200);
                              }
                              
                              // keep sending data until status is confirmed as recieved
                              void incomingMessage(const MyMessage &message)
                              {
                                  if (message.sensor==7) {
                                    COMPOSITE_T = message.getInt();
                                  }
                                  if (message.sensor==5) {
                                    D5_T = message.getInt();
                                  }
                                  if (message.sensor==6) {
                                    D6_T = message.getInt();
                                  }
                              }
                              This is my blind controller (a bit better commented). It's based on the relay example in mysensors.org but obviosuly tweaked to my liking. The hardware setup is almost identical to the relay example in mysensors.org but pin numbers may be different. I have the first relay supply power to the second relay which switches power between the two outputs. If you had have asked yesterday, I would have taken a photo before I installed one yesterday.
                              Code:
                              // Matt's blind controller
                              // This example will remember relay state even after power failure.
                              
                              #include <MySensor.h>
                              #include <SPI.h>
                              
                              MySensor gw;
                              MyMessage msg_s(1,V_STOP);
                              MyMessage msg_u(1,V_UP);
                              MyMessage msg_d(1,V_DOWN);
                              MyMessage msg_v(1,V_DIMMER);
                              
                              long millivanilli = 0;
                              int ard_status = 0; // Arduino relay status, 0=stopped(up), 1=up, 2=stopped(dn), 3=down
                              int hs3_status = 0; // HS3 status as above
                              int armed = 0;      // is the button armed for use?
                              
                              void setup()  
                              {   
                                // Initialize library and add callback for incoming messages
                                gw.begin(incomingMessage, AUTO, true);
                                // Send the sketch version information to the gateway and Controller
                                gw.sendSketchInfo("Blind_Controller", "1.0");
                              
                                // present device to controller
                                gw.present(1, S_COVER);
                                
                                // setup pins
                                pinMode(3, OUTPUT);     // On/Off Relay
                                pinMode(4, OUTPUT);     // Up/Down Relay
                                pinMode(5, OUTPUT);     // Second Ground
                                pinMode(6, INPUT);      // Wall Switch
                                digitalWrite(5, LOW);  // Creating a ground pin for switch.
                                digitalWrite(6, HIGH);  // Internal pullup. Ground to activate.
                                
                                // Set relay to last known state (using eeprom storage)
                                  digitalWrite(3, HIGH);                          // Load Stopped state
                                  digitalWrite(4, gw.loadState(0)?1:0);     // Load last Up/Down
                                  ard_status = 2*gw.loadState(0)?0:1;      // Store current state in RAM
                                  Serial.println(ard_status);
                                  
                                  armed = 1;
                              }
                              
                              void loop() 
                              {
                                // Alway process incoming messages whenever possible
                                gw.process();
                                
                                // Process button press
                                int button = digitalRead(6);
                                if (button==LOW && armed==1) {
                                  switch (ard_status) {
                                    case 0:          // stopped in up
                                    cmd_down();
                                    break;
                                    case 1:          // going up
                                    cmd_stop();
                                    break;
                                    case 2:          // stopped in down
                                    cmd_up();
                                    break;
                                    case 3:          // going down
                                    cmd_stop();
                                  }
                                  gw.wait(500);
                              armed==0;
                              }
                              if (button==HIGH && armed==0) {
                                armed = 1;
                                gw.wait(500);
                              }
                              
                              gw.wait(200);
                              
                              // Goto Stop after 30 seconds (for electrical safety)
                              if (((millis()-millivanilli)>=30000)) {
                                digitalWrite(3, HIGH);
                                if (ard_status==3 || ard_status==1) {
                                  ard_status = ard_status-1;
                                }
                              }
                              
                              }
                              void incomingMessage(const MyMessage &message) {
                                
                                if (message.isAck()) {
                                    hs3_status = ard_status; 
                                    Serial.println("ack recieved");   
                                }
                                else {
                                  // Stop Message
                                  if (message.type==V_STOP) {
                                    cmd_stop();
                                  }
                                
                                  // Up Message
                                  if (message.type==V_UP) {
                                    cmd_up();
                                  }
                              
                                  // Down Message
                                  if (message.type==V_DOWN) {
                                    cmd_down();
                                  }
                                }
                              }
                              
                              void cmd_stop() {
                                digitalWrite(3, HIGH);
                                Serial.println("Stop commanded");
                                if (ard_status==3 || ard_status==1) {
                                  ard_status = ard_status-1;
                                }
                                gw.send(msg_s.set("1"), true);
                                Serial.println(ard_status);
                              }
                              
                              void cmd_up() {
                                digitalWrite(3, LOW);
                                digitalWrite(4, HIGH);
                                gw.saveState(0, 1);
                                ard_status = 1;
                                Serial.println("Up commanded");
                                gw.send(msg_v.set("100"), true);
                                Serial.println(ard_status);
                                millivanilli = millis();
                                Serial.println(millivanilli);
                              }
                              
                              void cmd_down() {
                                digitalWrite(3, LOW);
                                digitalWrite(4, LOW);
                                gw.saveState(0, 0);
                                ard_status = 3;
                                Serial.println("Down commanded");
                                gw.send(msg_v.set("0"), true);
                                Serial.println(ard_status);
                                millivanilli = millis();
                              }
                              The 4x wireless power board is here: http://board.homeseer.com/showpost.p...&postcount=180

                              these are set to work with the mysensors plugin (see other thread). If you take a look at this and at the Serial API section of the mysensors.org website it will begin to make sense with all the S_COVER and V_TRIPPED stuff. Once you start playing around it will become very easy.

                              Happy to answer any questions. This is powerful stuff and I'd like to see more people get involved.

                              Comment

                              Working...
                              X