I might have a faulty SHT25

I’ve plugged the MCP23008 , ADC121C021, and SHT25 into my Pi2 via the i2c-shield.

Google Photos

The MCP23008 is powered by it’s power adaptor.

The red power lights for each device comes on.

and on my Pi2 i have rasbian with node-red installed, the I2C communications have been enabled via the raspi-config

However with the following node-red flow to report the discovered I2C devices addresses :

[{“id”:“7a2e4ed3.4bba1”,“type”:“tab”,“label”:“Flow 1”,“disabled”:false,“info”:""},{“id”:“373d2416.edca24”,“type”:“inject”,“z”:“7a2e4ed3.4bba1”,“name”:"",“topic”:"",“payload”:"",“payloadType”:“date”,“repeat”:"",“crontab”:"",“once”:false,“onceDelay”:0.1,“x”:100,“y”:220,“wires”:[[“f3c122a1.aaa9a8”]]},{“id”:“556dd833.88f618”,“type”:“debug”,“z”:“7a2e4ed3.4bba1”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“x”:190,“y”:340,“wires”:[]},{“id”:“f3c122a1.aaa9a8”,“type”:“i2c scan”,“z”:“7a2e4ed3.4bba1”,“x”:140,“y”:280,“wires”:[[“556dd833.88f618”],[“556dd833.88f618”]]}]

This is the flow without the SHT25 attached:
https://i.imgur.com/NBUWhmZ.gifv

This is the same flow, with the SHT25 attached:
https://i.imgur.com/2JMOqih.gifv

Shouldn’t I expect to see the address 40 in that list ?

Running a few things on the ssh terminal:

pi@red:~ $ ls /dev/*i2c*
/dev/i2c-1  /dev/i2c-3

pi@red:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

So it seems all my i2c devices are there and responding… but differently inside node-red.

./confused

Looks like hardware is connected correctly and responding to the i2c scan command. You might look into your node red setup.
@Trey Might have node red lib for sht25?

Its possible that Node Red is using a general call to request everything check in and the SHT25 doesn’t respond whereas the in the command line it runs through every channel specifically.

Yeah definitely something to do with node-red.

i tried the python script here out: https://github.com/ControlEverythingCommunity/SHT25

Works fine.

Now i just need to get it working in node-red

Good news:

installed the 12c node package and created a function node with:

const i2c = global.get('i2c');

const deviceAddress = 0x40;
const temperatureCommand = 0xF3;
const humidityCommand = 0xF5;

const wire = new i2c(deviceAddress, {device: '/dev/i2c-1'}); // point to your i2c address, debug provides REPL interface


function getTemperature () {
    return new Promise((resolve, reject) => {
        wire.writeByte(temperatureCommand, () => {
            setTimeout(() => {
                wire.read(2, function(err, response) {
                    const [msb, lsb] = response;
                    const temp = (msb * 256 + lsb);
                    resolve(-46.85 + ((temp * 175.72) / 65536.0))
                });
          }, 500);
        })
    });
}

function getHumidity () {
    return new Promise((resolve) => {
        resolve();
    })
}


Promise.all([
    getTemperature(),
    getHumidity()
])
    .then(([temperature, humidity]) => {
       node.send({
           payload: {temperature, humidity}
       });
    });
   
return;

Is getting me temperature readings!

Nice! Glad you got it working and thanks for sharing your code.