5 Replies Latest reply on Jul 12, 2017 5:29 PM by Intel Corporation

    UART malfunction upon communication with SHT10 sensor

    cyrillicsoft

      I've got a new issue which concerns the same old UART and is similar to this previous case.

      When I communicate with an SHT10 Temp. and Humidity sensor using its respective library (libupm-sht1x), data suddenly appears on the UART TX.

       

      I've enclosed a small test to illustrate this.

      1) TEST RESULTS screenshot: SHT10 working alone and there is nothing on TX (pin 1)

      2) TEST+UART RESULTS screenshot: UART is initialized with the mraa library (mraa_uart_init function) and the SHT10 is being used with the libupm-sht1x library (sht1x_update function)

           During measurement updates, bogus data appears on the UART TX, which is captured by a Saleae logic analyzer.

           There are 3 sensor requests and the following data sequentially appears on the TX line when they are executed:

            1st update: FE FF F8 C0 C0 C0 F0 E0 F8 E0 C0 C0 F8 E0 FC F0

           2nd update: FE FF 80 C0 FC F0 F0 F0 80 C0 F8 F0 FC E0

           3rd update: FF E0 C0 C0 FC F0 FC F0 F0 F0 80 E0 F8 E0 F8 F0

      These sequences can be viewed by opening the Saleae .logicdata or .png screenshots in the archive enclosed.

       

      It seems that there are some serious issues with either the UART driver or the Edison for Arduino board.

       

      In addition, I can say that I've got 2 Edison for Arduino boards and they both show this behavior.

      Plus, I have tried connecting my SHT10 sensor to different pins (3 and 4; 16 and 17; 18 and 19): the effect is the same for all 3 pairs.

      The sensor itself works very well and gives correct measurements.

       

      Any ideas on what to do?

        • 1. Re: UART malfunction upon communication with SHT10 sensor
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi cyrillicsoft,

           

          Thanks for your interest in the Intel® Edison™ Platform.

           

          I see that you have opened several threads (UART sensitivity of Edison for Arduino  and Multiple 0xFF returned after every transmission ) indicating that you have issues with the Edison UART. Please let us investigate more about your issue and we will get back to you as soon as we have some useful information.

           

          Best Regards,
          -Jose P.

          • 2. Re: UART malfunction upon communication with SHT10 sensor
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hi cyrillicsoft,

            We are attempting to replicate your issue, as soon as we have any update I will be contacting you back.

            Have a nice day!

            Best Regards,
            -Jose P.

            • 3. Re: UART malfunction upon communication with SHT10 sensor
              cyrillicsoft

              Hi Jose!

              I've carried out another experiment with the SHT10 sensor and found out that when I read measurements off of it using the sht1x_update() function (from the libupm library I mentioned before), the 0-13 GPIO pins receive noise.

              However, there is no noise on pins 14-19. There is NOTHING connected to the pins apart from the sensor itself.

              In the test program below, the SHT10 sensor is connected to the 19th and 18th pins, but the results will not change if I connect it to other pins.

              Here's a link to the SHT10 brick itself: Electronic Brick - SHT10 Temperature Humidity Sensor

              unsigned int  SigStop = 1;

               

              void* digit (void *val)

              {

                   unsigned int i;

                   mraa_gpio_context gpio;

               

                gpio = mraa_gpio_init(2);

                   mraa_gpio_dir(gpio, MRAA_GPIO_IN);

               

                    while (SigStop) {

                   i = mraa_gpio_read(gpio);

                         if(i){fprintf(stdout, "\nGpio is %d", i)}

                         usleep(100000);

                    }

                    printf ("\nStop Signal in Thread\n");

               

                    for(i=0; i<10; i++) {

                        fprintf(stdout, "\nGpio is %d", mraa_gpio_read(gpio));

                        usleep(100000);

                    }

                i = mraa_gpio_close(gpio);

               

                   printf ("\nThread Ended\n");

                    pthread_exit(0);

              }

               

              int main()

              {

                   unsigned int i,er;

                   pthread_t proc_hnd;

               

                   if(pthread_create(&proc_hnd, 0, *digit, &i))

                   {

                        printf ("\nNO THREAD");

                        return 0;

                   }

                   sht1x_context sensor = sht1x_init (19,18);

               

                   if (!sensor){

                        printf("sht1x_init() failed.\n");

                        return 0;

                   }

                   for (i=0; i<3; i++){

                        sleep(2);

                        printf("\nBegin Update");

                  er = sht1x_update(sensor);

                        if(er != 0){printf("sht1x_update() failed, exiting.\n"); break;}

                        printf ("\nTemperature: %.2f C\n", sensor->temperature);

                        printf ("Humidity: %.2f RH\n", sensor->humidity);

                        fflush(stdout);

                   }

                   sht1x_close(sensor);

                   sleep(2);

                   SigStop = 0;

                   sleep(2);

                   return 0;

              }

               

              Here are the results which it prints out:

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Begin Update

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Temperature: 37.52 C

              Humidity: 29.48 RH

               

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Begin Update

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Temperature: 26.43 C

              Humidity: 28.82 RH

               

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Begin Update

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Temperature: 24.50 C

              Humidity: 31.47 RH

               

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Gpio is 1

              Stop Signal in Thread

               

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Gpio is 0

              Thread Ended

              logout

              • 4. Re: UART malfunction upon communication with SHT10 sensor
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hi cyrillicsoft,

                Thanks for sharing these results! We will go ahead and replicate this as well.

                We appreciate your patience.

                Have a nice weekend!

                Best Regards,
                -Jose P.

                • 5. Re: UART malfunction upon communication with SHT10 sensor
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hi cyrillicsoft,

                  Thanks for your patience.

                  We try to replicate your issue, but unfortunately we don't have a SH10 sensor at hand. We perform a test where we communicate the Edison with an Arduino through I2C and then attempt to initialize the UART, regrettably we didn't get any noise on the TX line. I think that this noise might due to the sensor that you are using, I would encourage to use a Low pass Filter in order reduce the undesirable noise that you are having.

                  Best Regards,
                  -Jose P.