Connect Sensirion SFM3000 Flow Sensor - I2C via Raspberry Pi

조회 수: 6 (최근 30일)
Simon Orlob
Simon Orlob 2018년 1월 7일
답변: Clancy Dennis 2021년 3월 7일
Can somebody help me to translate the following I2C description into MATLAB code?
I'm trying to access a Sensirion Flow Sensor ( SFM 3000 ) via Raspberry Pi. So far I manage to connect to Raspberry Pi's I2C device. Nevertheless the received data do not alter at all.
mypi=raspi
flowsensor=i2cdev(mypi,'i2c-1','0x40')
x=0;
write(flowsensor,(hex2dec('1000')),'uint16')
while (x<100)
pause(0.02);
read(flowsensor,3,'uint8')
x=x+1;
end
The answer always is
ans =
1×3 uint8 row vector
7 194 139
  댓글 수: 1
Esha Bhargava
Esha Bhargava 2018년 1월 12일
Are you able to read data continuously outside of MATLAB via the I2C interface?

댓글을 달려면 로그인하십시오.

답변 (2개)

AJI
AJI 2018년 5월 3일
Hey :) Did you find a solution to your problem yet? I am having the same problem and get the same numbers as output. The only difference is that I am using an Arduino (also with Matlab)... When I try to connect the sensor with the Arduino Software everything works perfectly.

Clancy Dennis
Clancy Dennis 2021년 3월 7일
write(flowsensor,[hex2dec('10') hex2dec('00')]) works for me

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Raspberry Pi Hardware에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by