PINE64
New module: POT board - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32)
+---- Forum: POT modules (https://forum.pine64.org/forumdisplay.php?fid=8)
+---- Thread: New module: POT board (/showthread.php?tid=231)

Pages: 1 2 3


RE: New module: POT board - Artyom - 07-05-2016

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?


RE: New module: POT board - khgoh - 07-07-2016

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_Remote_I2c#Download


RE: New module: POT board - Artyom - 07-08-2016

(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_Remote_I2c#Download
Thanks for answer. But I already find solution...)))


RE: New module: POT board - khgoh - 07-11-2016

(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_Remote_I2c#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


RE: New module: POT board - Artyom - 07-12-2016

(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_Remote_I2c#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....


RE: New module: POT board - khgoh - 07-12-2016

(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_Remote_I2c#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.