Announcement

Collapse
No announcement yet.

Arduino - Projects by topics

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

    #16
    Originally posted by Conrad_Turbo View Post
    I plan on doing essential oils mixed in a solution and in a spray bottle. Then you could do something based on time to either blend smells or just have them on their own. With 4 bottles you could have quite a few permutations, the harder part would be having the HS event parse out a weather report and then decide what combination to spray. Or heck if you're expecting an important email when the furnace turns on and the house smells like mint...you know you've got mail! lol.

    PS I live in a log house too.
    As far as weather sensing, I use the weatherXML plugin. It connects to weatherunderground and parses the current weather as well as forecasts into HS3 devices. Real simple to deal with in an event. I mainly use it for my HSTouch app which surfaces a weather report and forecast.

    What solution are you planning on using with the oils? I've made my own bug repellent with essential oils. I used vodka to make it sprayable. It evaporates real fast.

    I think it would be neat to have it so that we woke up to a smell that kind of sets the stage for the day. A sunny day would smell different than a rainy day.

    While you are planning on incorporating with your furnace, I can see a stand alone one. It is 28' to my ridgepole with an open floor plan. Putting one up high would probably fill the whole house.

    The arduino seems perfect for this. Sketch would not be that complicated. I think I might incorporate the mixing logic into the arduino. Timing on events is not always that instantaneous. If you need to fire 1 sec of oil A and 2 sec of oil B and .5 sec of oil C, I would not trust the event timing to give you what you want. I see it more along the lines of the event just telling the arduino to mix smell #7 and the arduino would know how to do that with precision.

    Just thinking out loud.

    Comment


      #17
      Originally posted by logbuilder View Post
      As far as weather sensing, I use the weatherXML plugin. It connects to weatherunderground and parses the current weather as well as forecasts into HS3 devices. Real simple to deal with in an event. I mainly use it for my HSTouch app which surfaces a weather report and forecast.

      What solution are you planning on using with the oils? I've made my own bug repellent with essential oils. I used vodka to make it sprayable. It evaporates real fast.

      I think it would be neat to have it so that we woke up to a smell that kind of sets the stage for the day. A sunny day would smell different than a rainy day.

      While you are planning on incorporating with your furnace, I can see a stand alone one. It is 28' to my ridgepole with an open floor plan. Putting one up high would probably fill the whole house.

      The arduino seems perfect for this. Sketch would not be that complicated. I think I might incorporate the mixing logic into the arduino. Timing on events is not always that instantaneous. If you need to fire 1 sec of oil A and 2 sec of oil B and .5 sec of oil C, I would not trust the event timing to give you what you want. I see it more along the lines of the event just telling the arduino to mix smell #7 and the arduino would know how to do that with precision.

      Just thinking out loud.
      Yep I am using weatherxml as well, I had my proto NodeMCU sitting beside the bed, first movement of the morning it announced what the day's weather was. lol. I'll disable that event when I move it, but it was neat to try this morning.

      I found the arduino plugin blink to be quite consistent with the NodeMCU, so you could write an event that changed the blink time, then turned the blink on the solenoids you want which would then pump some faster than others. Then after X seconds shut it off. All this would only turn on when the furnace fan was on. Definitely needs some real world testing. My only initial concern would be scumming up the inside ductwork. lol

      A stand alone one could work too, up on a ridgepole would easily cover our place as well. I just don't want to be able to hear it spray and hiding it away in the furnace room would eliminate that. Also for changing the reservoirs etc..would be easier in the furnace room.

      Initially I thought of using a febreeze spray can, super easy...but cost wise a spray bottle with some alcohol, water and some essential oil mixed in I assume will be less and the scents can be changed out easily or blended to make new scents in each bottle.

      This NodeMCU opens up a lot of possibilities!

      Comment


        #18
        A project I have been contemplating is a monitor and controller for my meat smoker. Keeping it at 225 degrees by controlling the air intake seems feasible. If I could also automatically feed it wood chips when it needs more smoke would be icing on the cake.

        Comment


          #19
          @conrad_turbo

          Have you had any problems with the nodeMCU not being able to reliability communicate to the router in some locations? Since we are both in log houses, I thought maybe you might have experienced this too. In some places in the house, the signal might have to go thru 2 log walls and in some cases that might be 24+ inches of solid wood. I think the wifi signal gets to the nodeMCU but I'm not confident that the nodeMCU has enough xmit power to get back to the router. I was wondering if there might be some way to extend the antenna on the nodeMCU.

          Comment


            #20
            Well I have to say that I know nothing about Arduino but will be getting into it soon

            Might I suggest that a sub forum is created called "Projects" where people could post their projects. It might make it easier for newbies (like myself) to learn about what others are doing. Just a thought
            Cheers,
            Bob
            Web site | Help Desk | Feature Requests | Message Board

            Comment


              #21
              Originally posted by Blade View Post
              Might I suggest that a sub forum is created called "Projects" where people could post their projects. It might make it easier for newbies (like myself) to learn about what others are doing. Just a thought
              Yes this is something on my to do list. I will put all the API.ino codes in a list for users to.

              Greig.

              Sent from my SM-G925F 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


                #22
                Originally posted by logbuilder View Post
                A project I have been contemplating is a monitor and controller for my meat smoker. Keeping it at 225 degrees by controlling the air intake seems feasible. If I could also automatically feed it wood chips when it needs more smoke would be icing on the cake.
                Yep...I used to be on a BBQ comp team in the past. lol. You could do thermocouples to measure the temp of the meat and then sound an alarm or turn your bedroom lights on when it's time to wrap your pork butt in foil or when it's time to give it a mop with some apple juice through the night.

                Originally posted by logbuilder View Post
                @conrad_turbo

                Have you had any problems with the nodeMCU not being able to reliability communicate to the router in some locations? Since we are both in log houses, I thought maybe you might have experienced this too. In some places in the house, the signal might have to go thru 2 log walls and in some cases that might be 24+ inches of solid wood. I think the wifi signal gets to the nodeMCU but I'm not confident that the nodeMCU has enough xmit power to get back to the router. I was wondering if there might be some way to extend the antenna on the nodeMCU.
                I haven't used mine a lot yet, but it's still on the breadboard with the motion sensor, relay and a few LED's. I wrote an event to toggle the LED whenever motion was sensed. That way I can test the connection time and to see if the device is till communicating (tx and rx) with HS. I haven't had any issues yet. My router is central to the house (essentially on the floor of the loft) and the NodeMCU is having it's signal pass through the floor and through one log wall and some interior walls (2"x4" construction) in the bedroom. I've had no connection issues as of yet and that layout is probably the worst case, other than if I tried to put it in the basement (under the bedroom the NodeMCU is currently in).

                I find this amazing as we're expecting a little one in mid-October, so it'd be easy to build and set up temporary nodes for motion or heck it could be tossed behind some plants an if the cat starts munching on the plants it triggers a sound to be played. lol. Put it in a car and when the engine is running it'll know to open the garage door...when arriving at the house and connecting it'll open the door. Lots of neat ideas to play with.

                I am curious the power draw of the device as I may consider putting it in my shed to replace the FortrezZ MimoLITE, then I'd have more inputs and outputs to play with. Sensors on both doors with motion and also control of the LED lighting and possibly reporting back battery voltage etc... Much more capable than the MimoLITE that just monitors motion and controls the LED light.

                Comment


                  #23
                  Hi Logbuilder,
                  Trying to use your code for the DS18B20 sensor. It looks like that you have some code commented out. That is not a problem since I can read your coding well since you are very detailed in your code. Unfortunately, it looks like that the final code for this sensor is missing, I'm correct?

                  Thanks,
                  Aldo


                  Originally posted by logbuilder View Post
                  I just migrated from the basic sketch to the API based sketch this last weekend. My sketch handles PIR for motion, DHT11 for temp/humidity and a digital pin for door/window sensors. If you know Arduino programming, it is easy to understand. If you don't know about how to handle devices and sensors on an Arduino, get a breadboard and a sensor kit and start learning. Then integrating your code into the API sketch will be pretty easy.

                  If you look in the basic API sketch, at the first you will find HSSetup and HSloop. These are roughly equivalent to the standard setup and loop functions in any Arduino sketch.

                  I am including my code that was added to the first of the sketch. I don't claim it is anything great but it does work. You will notice some commented code for the OneWire devices such as the Dallas temp sensor. It hasn't been tested yet which is why it is commented.

                  Code:
                  //**************Declare your variables here******************* 
                  
                  #include <SimpleDHT.h>
                  //#include <OneWire.h>
                  //#include <DallasTemperature.h>
                  
                  //  This is the place where you define the hardware that is attached to this device. That hardware attaches thru a PIN on the Arduino.
                  //  PINS (cross referencing the UNO to the 12E)
                  
                  int DHT11_Sensor  = 2;     //  ESP 12E pin D4
                  int Motion_Sensor = 13;    //  ESP 12E pin D7
                  int Door_Sensor   = 12;    //  ESP 12E pin D6
                  
                  /*int DS18B20_Sensor = 4;    //  ESP 12E pin D2
                  
                  OneWire oneWire(DS18B20_Sensor);
                  
                  // vars used within this Sketch (locally)
                  int Loop_Delay = 1000;
                  int pirState = LOW;             // we start, assuming no motion detected
                  int val = 0;                    // variable for reading the pin status
                  */
                  
                  // DHT11 variables
                  byte DHT_Temperature = 0;
                  byte DHT_Humidity = 0;
                  byte DHT_Data[40] = {0};
                  int DHT_Return;
                  unsigned long DHTCurrentMillis = 0;
                  unsigned long DHTPreviousMillis = 0;
                  
                  /*
                  // 18B20 variables
                  
                  // Pass our oneWire reference to Dallas Temperature.
                  DallasTemperature sensors(&oneWire);
                  
                  float DS18B20_temp = 0;
                  */
                  
                  SimpleDHT11 dht11;
                  
                  //motion PIR variables
                  int PIRCurrentState = 0;
                  int PIRPreviousState = -1;
                  
                  int DoorCurrentState = 0;
                  int DoorPreviousState = 100;
                   
                  void HSSetup() {
                    
                    //************************
                    //Add YOUR SETUP HERE;
                    //************************
                  
                  pinMode(DHT11_Sensor, INPUT);
                  pinMode(Motion_Sensor,INPUT);
                  pinMode(Door_Sensor, INPUT);
                  
                  DHTCurrentMillis = millis();
                  DHTPreviousMillis = millis();
                  
                  Serial.begin(9600);
                  
                  //sensors.begin();
                  }
                  
                  
                  void HSloop() {
                      //************************
                      //Add YOUR CODE HERE;
                      //************************
                      /* To Send Data to Homeseer use SendToHS(Device,Value)
                       Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send
                       To Recieve data from Homeseer look up the FromHS array that is updated when the device value changes.
                       Eg.. FromHS[5] would be the data from API Output device 5
                       All code that is located just below this block will execute regardless of connection status!
                       You can include SendToHS() calls, however when there isn't an active connection, it will just return and continue.
                       If you only want code to execute when HomeSeer is connected, put it inside the if statement below.
                       */
                  
                      /*Execute regardless of connection status*/
                  
                   
                  
                   if (IsConnected == true) {
                     /*Execute ONLY when HomeSeer is connected*/
                     
                   // **************  Start Motion Sensor *****************    
                    PIRCurrentState = digitalRead(Motion_Sensor);
                    if (PIRCurrentState != PIRPreviousState) {
                       if (PIRCurrentState == HIGH) {
                          SendToHS(1,100);  
                       } 
                       else {
                          SendToHS(1,0);
                       }
                       PIRPreviousState = PIRCurrentState;   
                    }
                  // **************  End Motion Sensor *****************   
                  
                  // **************  Start Door Sensor ***************** 
                    DoorCurrentState = digitalRead(Door_Sensor);
                    if (DoorCurrentState != DoorPreviousState) {
                       if (DoorCurrentState == HIGH) {
                          SendToHS(2,100);  
                       } 
                       else {
                          SendToHS(2,0);
                       }
                       DoorPreviousState = DoorCurrentState;   
                    }
                  // **************  End Door Sensor ***************** 
                  
                  // **************  Start DHT11 Sensor *****************  
                    DHTCurrentMillis = millis();
                    if (DHTCurrentMillis - DHTPreviousMillis >= (5 * 60 * 1000)) {      // Update every 5 minutes
                       DHT_Return = 1;
                       DHT_Return = dht11.read(DHT11_Sensor, &DHT_Temperature, &DHT_Humidity, NULL);
                       if (DHT_Return == 0) {
                          DHT_Temperature =  (DHT_Temperature * 18 + 5)/10 + 32;    // adjust from C to F
                  //        Serial.print("T = ");
                  //        Serial.print((int)DHT_Temperature); 
                  //        Serial.print(" F,   ");
                  //        Serial.print("H = ");
                  //        Serial.print((int)DHT_Humidity); 
                  //        Serial.println(" %");
                          SendToHS(3,DHT_Temperature);
                          SendToHS(4,DHT_Humidity);    
                          DHTCurrentMillis = millis();
                          DHTPreviousMillis = DHTCurrentMillis;
                       }
                    }   
                  // **************  End DHT11 Sensor *****************   
                  
                    }    // end of 'if (IsConnected == true) {'
                  
                  }
                  
                  //************Do not change anything after Here*****************

                  Comment


                    #24
                    @aldo

                    In the sketch I had prior provided, I had not yet implemented the DS18B20 sensor. I've been using the DHT11 temp sensor instead since it also has humidity. The DS18B20 is more accurate though.

                    Here is a simple little test program for the DS18B20 sensor. I just loaded it onto a UNO and it worked. You should be able to integrate into the API sketch.

                    Code:
                    #include <OneWire.h>
                    #include <DallasTemperature.h>
                    
                    // Data wire is plugged into port 4 on the Arduino
                    #define ONE_WIRE_BUS 4   // ESP 12E pin D2
                    // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
                    OneWire oneWire(ONE_WIRE_BUS);
                    // Pass our oneWire reference to Dallas Temperature.
                    DallasTemperature sensors(&oneWire);
                    
                    float DS18B20_temp = 0;
                    
                    void setup(void)
                    {
                      // start serial port
                      Serial.begin(9600);
                      Serial.println("Dallas Temperature IC Control Library Demo");
                      // Start up the library
                      sensors.begin();
                    }
                    void loop(void)
                    {
                      // call sensors.requestTemperatures() to issue a global temperature
                      // request to all devices on the bus
                      Serial.print("Requesting temperatures...");
                      sensors.requestTemperatures(); // Send the command to get temperatures
                      Serial.println("DONE");
                    
                      Serial.print("Temperature for the device 1 (index 0) is: ");
                    
                      DS18B20_temp = sensors.getTempCByIndex(0);
                      DS18B20_temp =  (DS18B20_temp * 18 + 5)/10 + 32;    // adjust from C to F
                      Serial.print(DS18B20_temp);
                      Serial.println("  F");
                    }

                    Comment


                      #25
                      Thank you Logbuilder. Not sure what I'm doing wrong, it is giving me an error, redefinition of "Void Setup ()'

                      I think being a Nodemcu, I would also change the serial code to the appropriate nodemcu code correct?

                      FYI, I'm building a Nodemcu that support this sensor for pond monitoring of temperature, your code that contains the humidity and temperature for external values, the soil moisture and the pond water level since this board is located next to the pond.

                      I have few DTH11 and I found some being accurate, some I do not thin they are. Do you have a way to determine how far off they are humidity wise?

                      Thanks,
                      Aldo


                      Originally posted by logbuilder View Post
                      @aldo

                      In the sketch I had prior provided, I had not yet implemented the DS18B20 sensor. I've been using the DHT11 temp sensor instead since it also has humidity. The DS18B20 is more accurate though.

                      Here is a simple little test program for the DS18B20 sensor. I just loaded it onto a UNO and it worked. You should be able to integrate into the API sketch.

                      Code:
                      #include <OneWire.h>
                      #include <DallasTemperature.h>
                      
                      // Data wire is plugged into port 4 on the Arduino
                      #define ONE_WIRE_BUS 4   // ESP 12E pin D2
                      // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
                      OneWire oneWire(ONE_WIRE_BUS);
                      // Pass our oneWire reference to Dallas Temperature.
                      DallasTemperature sensors(&oneWire);
                      
                      float DS18B20_temp = 0;
                      
                      void setup(void)
                      {
                        // start serial port
                        Serial.begin(9600);
                        Serial.println("Dallas Temperature IC Control Library Demo");
                        // Start up the library
                        sensors.begin();
                      }
                      void loop(void)
                      {
                        // call sensors.requestTemperatures() to issue a global temperature
                        // request to all devices on the bus
                        Serial.print("Requesting temperatures...");
                        sensors.requestTemperatures(); // Send the command to get temperatures
                        Serial.println("DONE");
                      
                        Serial.print("Temperature for the device 1 (index 0) is: ");
                      
                        DS18B20_temp = sensors.getTempCByIndex(0);
                        DS18B20_temp =  (DS18B20_temp * 18 + 5)/10 + 32;    // adjust from C to F
                        Serial.print(DS18B20_temp);
                        Serial.println("  F");
                      }

                      Comment


                        #26
                        @aldo

                        The sample program above is a freestanding program. You need to migrate it into you API sketch.

                        Generally, migrate the code from the above program's setup into the HSSetup in your API sketch and the code from the above loop into HSloop.

                        Comment


                          #27
                          Thanks Logbuilder, I will take another fresh look, something basic I'm sure that I'm missing.

                          Aldo

                          Comment


                            #28
                            A good understanding of the structure of a sketch is important. I'll try to highlight the really important things here. From your posts it seems as though this concept could use a little review. Hope this helps.

                            First, the most basic arduino sketch consists of a setup() function and a loop() function:

                            Code:
                            // Include external libraries here
                            
                            // Declare some global variables here
                            
                            void setup()  {
                            // do any setup items here
                            
                            }
                            
                            void loop() {
                            // add program logic here
                            
                            }
                            In the API app, it follows that structure but in a way duplicates it. This makes it easy to isolate your modifications and easily migrate to new versions of the API sketch.

                            Here is what is added (in bold):

                            Code:
                            // Include external libraries here
                            
                            // Declare some global variables here
                            
                            [B]void HSSetup() {
                              //************************
                              //Add YOUR SETUP HERE;
                              //************************
                            
                            }[/B]
                            
                            [B]void HSloop() {
                                //************************
                                //Add YOUR CODE HERE;
                                //************************
                            
                            }[/B]
                            
                            
                            void setup()  {
                            // do any setup items here
                            
                            [B]HSSetup();[/B]
                            }
                            
                            void loop() {
                            // add your program logic here
                            
                            [B]HSloop();[/B]
                            }

                            Comment


                              #29
                              logbuilder, you are a great teacher, unfortunately I'm a failing student :-) In your previous code for DTH11, I paste it into the beginning of the API board and I had no issues compiling or understanding it, while I have issues understanding this code. I use the same process as of the DTH11 code so not sure what I'm doing wrong. Maybe is the combination of studying 1000 pages of CISSP and Arduino :-) The great news, so far as a teacher you are not giving up so easily on me :-)
                              P.S. everything that I'm doing is on the board nodemcu, could it be the issue?


                              Let me try few more things, I will keep you posted,
                              Aldo

                              Comment


                                #30
                                I think I got it. I was able to compiling it, unfortunately it is giving me

                                Temperature for the device 1 (index 0) is: -196.10 F
                                Requesting temperatures...DONE

                                I do not see anything wrong in your code, I plug the yellow cable in pin D2, the red in the 3.3v and the back in the ground.

                                Aldo

                                Comment

                                Working...
                                X