Announcement

Collapse
No announcement yet.

Arduino - Projects by topics

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

    #31
    Originally posted by aldo View Post
    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
    Could you send a link to the sensor you are using? The pins are not always the same on different manufacturers.

    Comment


      #32
      HI Logbuilder, these are the ones

      http://www.ebay.com/itm/ELENKER-5PCS...UAAOSw3h1ZTDHv

      Thanks,
      Aldo

      Comment


        #33
        I've not used a sensor like that. My 18B20 is on a board module.

        This link talks about your type of sensor and it calls for a 4.7k resistor between data and vcc. Read it and see if it makes sense to you. That would be the first thing I would try.

        https://create.arduino.cc/projecthub...arduino-9cc806

        Comment


          #34
          I agree with you, it should work. I compared some other code as well with the one you gave me, they look very similar. I will keep trying, will keep posted.

          Aldo

          Comment


            #35
            NodeMcu Scale

            Some time back i posted a help request for assistance with this idea which has been on my to do list for about five years. At the time I think the request was very premature as the API for the nodemcu was not ready and hence I did not receive any replies.

            However now that Greig has completed the API (thanks Greig) I have now been able to move this along, so I thought I'd share my progress so far.

            The original requirement was to remotely weigh 2 large Gas bottles, similar to what would be used for BBQ's and Caravans but bigger. and report their respective weights back to HS, in order to gauge their capacity. Presently there is a auto change over mechanism which turns red when a bottle expires. this need to be sighted and a reorder call placed. Usually around once a month but easy to forget.

            I used some 50kg load cells (4 per bridge) and a HX711 load cell amplifier in addition to the NodeMCU. All from AliExpress.

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	30.9 KB
ID:	1191445

            Connected like this

            Click image for larger version

Name:	FUO46W0I0C96FJG.MEDIUM.jpg
Views:	1
Size:	33.3 KB
ID:	1191446

            Original sketches were obtained from:

            https://learn.sparkfun.com/tutorials...t-hookup-guide

            Once the initial calibration had been done using the sketches above, thinning out the code for the API was quite easy.

            My code below is more than required as I used 2 sets of HX711 amps, although 1 can handle 2 scales, the gain is different on each scale. Due to the HX711or the Library.

            One scale ran fine without the Millis commands, (and I'm not sure I have done that right) but when the second was added there was some kind of timing problem and only scale B would update.

            ------------------------------------------------------------------------

            //**************Declare your variables here*******************

            #include "HX711.h"

            //#define DOUT 4
            //#define CLK 0


            HX711 scaleA(4, 0);
            HX711 scaleB(14, 12);

            unsigned long interval=(5 * 60 * 1000); // Update every 5 minutes; // the time we need to wait
            unsigned long previousMillis=0; // millis() returns an unsigned long.

            //************************************************************ ****




            void HSSetup() {

            //************************
            //Add YOUR SETUP HERE;
            //************************


            scaleA.set_scale(22600); //Adjust to this calibration factor
            scaleA.set_offset(-224233);

            scaleB.set_scale(23530); //Adjust to this calibration factor
            scaleB.set_offset(389602);





            }


            void HSloop() {

            unsigned long currentMillis = millis(); // grab current time



            //************************
            //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*/
            scaleA.get_units(10);
            if ((unsigned long)(currentMillis - previousMillis) >= interval);{
            SendToHS(1,(scaleA.get_units(1)));
            SendToHS(2,(scaleB.get_units(1)));
            previousMillis = millis();
            }
            }
            }

            -------------------------------------------------------------

            Whilst I had a specific need for this project, it could be used for a variety of things, bathroom scale, BBQ gas bottle level, how long pooch spends in the basket, is the beer fridge running low etc.

            Hope someone finds this useful.

            B

            Comment


              #36
              Thanks for sharing, greatly appreciated

              Sent from my SM-G935V using Tapatalk

              Comment


                #37
                DHT11 Temp and Humidity

                Do I need to switch to the API mode to use the DHT11 or the onewire will work, I don't have any feedback with the onewire.

                Comment


                  #38
                  Originally posted by DonMor View Post
                  Do I need to switch to the API mode to use the DHT11 or the onewire will work, I don't have any feedback with the onewire.
                  With DHT11 you need API mode.

                  Comment

                  Working...
                  X