🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ENV IV Sensor with M5Atom (lite)

    Atom
    4
    11
    3.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Kees
      last edited by

      After trying several examples and combining several sketches I do not get the sensor working. In one example I get pressure, but with a large number (perhaps the order, I did not check that), not sure if it makes sense. I never succeeded in getting other values than 0 for temperature and humidity. I tried several atoms as well as several sensors. Somehow the combination of I2C:SHT40(0x44) and BMP280(0x76) should work.

      Does anyone has a simple example sketch that really works?

      teastainT 1 Reply Last reply Reply Quote 0
      • teastainT
        teastain @Kees
        last edited by

        @kees What program language do you use?
        I have a ENV IV and a AtomS3 to try.
        Is yours a S3 model?

        Cheers, Terry!

        100% M5Stack addict with several drawers full of product!

        1 Reply Last reply Reply Quote 0
        • K
          Kees
          last edited by

          @teastain Hi, I use c++ with Arduino (IDE Microsoft Visual Studio and Visual Micro) and as far as I can tell I use the Atom Lite version. A basic version that I use for home automated applications. I expect both to work with the sensor. If you can shed some light on this I'd grateful.

          ajb2k3A teastainT 3 Replies Last reply Reply Quote 0
          • ajb2k3A
            ajb2k3 @Kees
            last edited by

            @kees said in ENV IV Sensor with M5Atom (lite):

            @teastain Hi, I use c++ with Arduino (IDE Microsoft Visual Studio and Visual Micro) and as far as I can tell I use the Atom Lite version. A basic version that I use for home automated applications. I expect both to work with the sensor. If you can shed some light on this I'd grateful.

            What's the error and are you sure you have the correct sensors as there are currently 5 different versions

            Does the sensor and ATOM lite work in UIFLow?

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            1 Reply Last reply Reply Quote 0
            • teastainT
              teastain @Kees
              last edited by teastain

              @kees The old Atom Lite is grey and the new AtomS3 Lite is white.

              It can make a difference!

              I will set up a test this afternoon with my AtomS3 and get back.

              Are you seeing these results on the Serial Monitor?

              Cheers, Terry!

              100% M5Stack addict with several drawers full of product!

              1 Reply Last reply Reply Quote 0
              • teastainT
                teastain @Kees
                last edited by

                @kees said in ENV IV Sensor with M5Atom (lite):

                (IDE Microsoft Visual Studio and Visual Micro)
                \o/
                is like playing Arduino IDE on 'hard mode'
                I use the new Arduino IDE ver2.3.x and I got it running on:
                AtomS3
                Stamp-Pico (which is about the same as the grey Atom Lite)
                And a generic ESP32
                I'm displaying in the Serial.monitor.
                16:23:46.537 -> Pressure=102.4
                16:23:46.537 -> Temp=23.21
                16:23:46.537 -> Humidity:40.32
                The pressure is in Pa, so I added this fix to make more sense and calibrate to my local atmosphere:
                Serial.println(pressure / 1000 + 3.6, 1);
                Gives 102.4 kPa, here in Southern Ontario Canada
                If you would tell me your Atom model I will post my sketch here:
                -Terry

                Cheers, Terry!

                100% M5Stack addict with several drawers full of product!

                1 Reply Last reply Reply Quote 0
                • felmueF
                  felmue
                  last edited by

                  Hello guys

                  here is my example using M5Atom Lite.

                  Thanks
                  Felix

                  GPIO translation table M5Stack / M5Core2
                  Information about various M5Stack products.
                  Code examples

                  1 Reply Last reply Reply Quote 0
                  • K
                    Kees
                    last edited by

                    Thanks Teastain (Terry) and Felmue (Felix),

                    Terry I am not sure what else I can tell than it is the M5Atom Lite! I would like to see your sketch. However it could basically be the same as Terry's.

                    Felix, thanks for your sketch. For some reason it fails on linking this: sht4x.begin(Wire, 0X44); I can not really see what is different in libraries. However I tried this: sht4x.begin(Wire). And this works well. At least I get readings that compare to the ones using another sensor (temperature and humidity). Perhaps the I2C address 0X44 is default.

                    Thanks both,
                    Kees.

                    teastainT 1 Reply Last reply Reply Quote 0
                    • teastainT
                      teastain @Kees
                      last edited by teastain

                      @kees If your Atom Lite has a Gray plastic body the try this sketch that I tested and it works!

                      #include <SensirionI2CSht4x.h>
                      #include <Adafruit_BMP280.h>
                      #include "Adafruit_Sensor.h"
                      
                      Adafruit_BMP280 bmp;
                      SensirionI2CSht4x sht4x;
                      float temperature, pressure,
                        humidity;  // Store the vuale of pressure and Temperature.
                      
                      void setup() {
                        Wire.begin(26, 32); // you may have to try other numbers, I do not have a gray Atom Lite!
                        Serial.begin(115200);
                        while (!Serial) {
                          delay(100);
                        }
                        while (!bmp.begin(
                          0x76)) {  // Init this sensor,True if the init was successful, otherwise
                                    // false.
                      
                          Serial.println(F("BMP280 fail"));
                          delay(500);
                        }
                        Serial.println(F("BMP280 test"));
                        uint16_t error;
                        char errorMessage[256];
                        sht4x.begin(Wire);
                        uint32_t serialNumber;
                        error = sht4x.serialNumber(serialNumber);
                        if (error) {
                          Serial.print("Error trying to execute serialNumber(): ");
                          errorToString(error, errorMessage, 256);
                          Serial.println(errorMessage);
                        } else {
                          Serial.print("Serial Number: ");
                          Serial.println(serialNumber);
                        }
                        bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,
                                        Adafruit_BMP280::SAMPLING_X2,
                                        Adafruit_BMP280::SAMPLING_X16,
                                        Adafruit_BMP280::FILTER_X16,
                                        Adafruit_BMP280::STANDBY_MS_500);
                      }
                      
                      void loop() {
                        uint16_t error;
                        char errorMessage[256];
                        delay(500);
                        error = sht4x.measureHighPrecision(temperature, humidity);
                        if (error) {
                          Serial.print("Error trying to execute measureHighPrecision(): ");
                          errorToString(error, errorMessage, 256);
                          Serial.println(errorMessage);
                        } else {
                          Serial.print("Pressure=");
                          Serial.println(pressure / 1000 + 3.6, 1);
                          Serial.print("Temp=");
                          Serial.println(temperature);
                          Serial.print("Humidity:");
                          Serial.println(humidity);
                          Serial.println("   ");
                        }
                        pressure = bmp.readPressure();
                        delay(500);
                      }
                      

                      Cheers, -Terry

                      Cheers, Terry!

                      100% M5Stack addict with several drawers full of product!

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        Kees @teastain
                        last edited by

                        @teastain Thanks, this is indeed basically the same as Felmue (Felix) has and it works also.
                        I compared the readings with the readings from a CO2-sensor. Temperature is close to each other (difference of about max. 0.2 Celsius). But the humidity differs about 8-9%. That is a lot. The sensors are adjacent to each wonder and should not differ so much regarding humidity (compared to a mechanic sensor, the CO2 sensor comes closest (difference of about 2-3%)).
                        I wonder how reliable the readings really are.

                        Thanks for the support anyway!

                        1 Reply Last reply Reply Quote 0
                        • ajb2k3A
                          ajb2k3
                          last edited by

                          I uploaded an example to UIFlow2 project zone on how to use the AtomS3lite and ENIV in UIFLOW with MQTT last night

                          UIFlow, so easy an adult can learn it!
                          If I don't know it, be patient!
                          I've ether not learned it or am too drunk to remember it!
                          Author of the WIP UIFlow Handbook!
                          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post