New module: POT board
#21
Hello. I use i2cset and i2cget command to work with himmidity and light sensor. I can get data ( temp and himm) from sensor in hexadecimal. How I can correct translate it into normal (decimal) values? I use formula from datasheet and can not calculate correct value... Can you post example of calculation himmidity and temperature?
  Reply
#22
Hi,
Below is the program section taken from the WifiAppDemo. ( I will post the full source code later in the wiki page)

tmpH is the MSB and tmpL is the LSB of the temperature or humidity reading from the device, if current pClientProp->i2ccmdstep is under step3, the tmpvalue is humidity reading, or else is the temperature reading. The calculation is in the if-else loop.


                tmpvalue=(double)(256*tmpH)+tmpL;
                if (pClientProp->i2ccmdstep==step3)
                {
                    //Humidity reading
                    pDrvHumidity->humidity=(float)(125*tmpvalue/65536)-6;
                    DMgr_RecNextStep(pClientProp,&DrvHumidity_refresh);
                }
                else {
                    //temperature reading
                    pDrvHumidity->temperature=(float)(175.72*tmpvalue/65536)-46.8;
                    pDrvHumidity->dataready=1;
                    DMgr_SendDone(pClientProp);
                }

Just uploaded the full source code for the Wifi Remote I2c Server and the Demo App. The link in the wiki are,
http://wiki.pine64.org/index.php/Wifi_Re...c#Download
  Reply
#23
(07-07-2016, 09:13 PM)khgoh Wrote: Hi,
Below is the program section taken from the WifiAppDemo. ( I will post the full source code later in the wiki page)

tmpH is the MSB and tmpL is the LSB of the temperature or humidity reading from the device, if current pClientProp->i2ccmdstep is under step3, the tmpvalue is humidity reading, or else is the temperature reading. The calculation is in the if-else loop.


                tmpvalue=(double)(256*tmpH)+tmpL;
                if (pClientProp->i2ccmdstep==step3)
                {
                    //Humidity reading
                    pDrvHumidity->humidity=(float)(125*tmpvalue/65536)-6;
                    DMgr_RecNextStep(pClientProp,&DrvHumidity_refresh);
                }
                else {
                    //temperature reading
                    pDrvHumidity->temperature=(float)(175.72*tmpvalue/65536)-46.8;
                    pDrvHumidity->dataready=1;
                    DMgr_SendDone(pClientProp);
                }

Just uploaded the full source code for the Wifi Remote I2c Server and the Demo App. The link in the wiki are,
http://wiki.pine64.org/index.php/Wifi_Re...c#Download
Thanks for answer. But I already find solution...)))
  Reply
#24
(07-08-2016, 09:45 AM)Artyom Wrote:
(07-07-2016, 09:13 PM)khgoh Wrote: Hi,
Below is the program section taken from the WifiAppDemo. ( I will post the full source code later in the wiki page)

tmpH is the MSB and tmpL is the LSB of the temperature or humidity reading from the device, if current pClientProp->i2ccmdstep is under step3, the tmpvalue is humidity reading, or else is the temperature reading. The calculation is in the if-else loop.


                tmpvalue=(double)(256*tmpH)+tmpL;
                if (pClientProp->i2ccmdstep==step3)
                {
                    //Humidity reading
                    pDrvHumidity->humidity=(float)(125*tmpvalue/65536)-6;
                    DMgr_RecNextStep(pClientProp,&DrvHumidity_refresh);
                }
                else {
                    //temperature reading
                    pDrvHumidity->temperature=(float)(175.72*tmpvalue/65536)-46.8;
                    pDrvHumidity->dataready=1;
                    DMgr_SendDone(pClientProp);
                }

Just uploaded the full source code for the Wifi Remote I2c Server and the Demo App. The link in the wiki are,
http://wiki.pine64.org/index.php/Wifi_Re...c#Download
Thanks for answer. But I already find solution...)))
Bty, another info might be helpful is that the Temperature/Humidity sensor will do a I2c clock stretching when the host request to read the reading from the sensor. This is because the sensor require about 100~200ms to convert the reading to digital data. If you did not implement clock stretching in you I2c communication, you will receive the wrong reading.

../KH Goh
  Reply
#25
(07-11-2016, 04:01 AM)khgoh Wrote:
(07-08-2016, 09:45 AM)Artyom Wrote:
(07-07-2016, 09:13 PM)khgoh Wrote: Hi,
Below is the program section taken from the WifiAppDemo. ( I will post the full source code later in the wiki page)

tmpH is the MSB and tmpL is the LSB of the temperature or humidity reading from the device, if current pClientProp->i2ccmdstep is under step3, the tmpvalue is humidity reading, or else is the temperature reading. The calculation is in the if-else loop.


                tmpvalue=(double)(256*tmpH)+tmpL;
                if (pClientProp->i2ccmdstep==step3)
                {
                    //Humidity reading
                    pDrvHumidity->humidity=(float)(125*tmpvalue/65536)-6;
                    DMgr_RecNextStep(pClientProp,&DrvHumidity_refresh);
                }
                else {
                    //temperature reading
                    pDrvHumidity->temperature=(float)(175.72*tmpvalue/65536)-46.8;
                    pDrvHumidity->dataready=1;
                    DMgr_SendDone(pClientProp);
                }

Just uploaded the full source code for the Wifi Remote I2c Server and the Demo App. The link in the wiki are,
http://wiki.pine64.org/index.php/Wifi_Re...c#Download
Thanks for answer. But I already find solution...)))
Bty, another info might be helpful is that the Temperature/Humidity sensor will do a I2c clock stretching when the host request to read the reading from the sensor. This is because the sensor require about 100~200ms to convert the reading to digital data. If you did not implement clock stretching in you I2c communication, you will receive the wrong reading.

../KH Goh

Hi. I have problem with my I2C POT board. When i set jumper to 3.3V. I2C POT board still give 5V. I try set all (two) jumpers to 3.3V, power for i2c still 5 volts....
  Reply
#26
(07-12-2016, 11:02 AM)Artyom Wrote:
(07-11-2016, 04:01 AM)khgoh Wrote:
(07-08-2016, 09:45 AM)Artyom Wrote:
(07-07-2016, 09:13 PM)khgoh Wrote: Hi,
Below is the program section taken from the WifiAppDemo. ( I will post the full source code later in the wiki page)

tmpH is the MSB and tmpL is the LSB of the temperature or humidity reading from the device, if current pClientProp->i2ccmdstep is under step3, the tmpvalue is humidity reading, or else is the temperature reading. The calculation is in the if-else loop.


                tmpvalue=(double)(256*tmpH)+tmpL;
                if (pClientProp->i2ccmdstep==step3)
                {
                    //Humidity reading
                    pDrvHumidity->humidity=(float)(125*tmpvalue/65536)-6;
                    DMgr_RecNextStep(pClientProp,&DrvHumidity_refresh);
                }
                else {
                    //temperature reading
                    pDrvHumidity->temperature=(float)(175.72*tmpvalue/65536)-46.8;
                    pDrvHumidity->dataready=1;
                    DMgr_SendDone(pClientProp);
                }

Just uploaded the full source code for the Wifi Remote I2c Server and the Demo App. The link in the wiki are,
http://wiki.pine64.org/index.php/Wifi_Re...c#Download
Thanks for answer. But I already find solution...)))
Bty, another info might be helpful is that the Temperature/Humidity sensor will do a I2c clock stretching when the host request to read the reading from the sensor. This is because the sensor require about 100~200ms to convert the reading to digital data. If you did not implement clock stretching in you I2c communication, you will receive the wrong reading.

../KH Goh

Hi. I have problem with my I2C POT board. When i set jumper to 3.3V. I2C POT board still give 5V. I try set all (two) jumpers to 3.3V, power for i2c still 5 volts....
@Artyom, Just PM you on the I2c POT Board problem.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I2C Expansion Board DonFL 39 62,623 08-16-2022, 10:29 AM
Last Post: AndrewC78
Question Z-Wave module pinout to make it compatible with Pi b+ ebretteville 59 92,557 07-12-2019, 08:55 AM
Last Post: kris240376
  Poll: interest for SPDIF-only POT board? amp 0 2,763 05-01-2019, 11:17 PM
Last Post: amp
  Audio DAC pot board nejec 2 6,934 12-09-2017, 01:43 PM
Last Post: nejec
  KICAD Quick Lib and Module Generator mbt28 1 5,054 02-12-2017, 10:45 PM
Last Post: tllim
  Z Wave Module and still using GPIO bang 2 6,240 01-16-2017, 03:12 AM
Last Post: bang
  Zwave Board: 300, 400 or 500? Lugor 4 9,054 01-10-2017, 08:55 PM
Last Post: Lugor
  Z-Wave US module with adapter aegrotatio 4 7,938 01-08-2017, 12:03 AM
Last Post: aegrotatio
  RaZberry Module (z-wave) need support to get it working! Luxus 13 20,781 11-03-2016, 02:04 AM
Last Post: Luxus
  Z-Wave module problem vintagewaffle 0 2,542 10-26-2016, 10:50 AM
Last Post: vintagewaffle

Forum Jump:


Users browsing this thread: 1 Guest(s)