Open Source EMERGENCY Based Ventilator -sensor integration

Dear developer and friends in this wonderful forum

Thanks a lot for great efforts helping us with XOD nodes special thanks to wayland
As i mention in my previous post we are developing fast prototype of (Open Source EMERGENCY Ventilator) based on XOD IDE
Now we having hard times trying to build nod for the i2c flow sensor (SFM3300)
Here is some information and library


Sensor Datasheet: https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/5_Mass_Flow_Meters/Datasheets/Sensirion_Mass_Flow_Meters_SFM3300_Datasheet.pdf

Similar project

I’m not expert in c++ I need help to warp the c++ library and create i2c nod for (SFM3300) sensor

thanks a lot and we appreciate your help to help us combating covid 19 in Africa

1 Like

my progress so far i m confused with 12c component


sfm3300.xodball (5.3 KB)

I’ve created a very basic node for the SFM3300 and similar devices (SFM3200 and SFM3400):
https://xod.io/libs/wayland/sfm3x00-flow-meter/

However, I don’t have the hardware and so testing has been limited to checking that the example patch compiles.

Dear wayland
I send you all my respect and appreciation for helping us accomplish this work
the sensor working properly

do you have any ideas for soft reset and temperature readings from the sensor ?
pleas see the original cod here with the offset value and and other parameters

https://github.com/Nabilphysics/SensirionSFM3300FlowMeterOLED/commit/22ade899dda2a9a2f6de5495e65bfe9d9720907a


float flow = ((float(result) - sensirion3300Offset) / scaleFactor)- flowErrorSLM;
Serial.println(flow);

long int sensirion3300Offset = 32768; // Offset for Sensirion 3300 Flow Sensor
float scaleFactor = 120.0; //For Air
const float flowErrorSLM = 0.3;
reference

did you receive my last replay ?
thanks a lot for your help

Sorry it’s taken me a while to reply. The Arduino library I’ve wrapped doesn’t have methods for reading temperature or performing a soft reset. I’ll see if I can add these over the weekend. If I remember correctly, the device outputs its own temperature, which is not necessarily the same as the temperature of the gas flowing through it.

I am very grateful to you for the time you put into helping us with this project

can you please see this links


its complete code for Arduino including temperature and equation process and sensor offset
thanks a lot

I’ve just published an updated library (version 0.0.3) that may be able to perform soft reset and temperature measurements. As before, the only testing I’ve been able to do is check that the example patches compile.

Please try each of the example patches and let me know the results. I’ve labelled the temperature output as T_raw, because I’m not sure what units we’re expecting. It’s important to note that the temperature of the sensor does not necessarily reflect the temperature of the gas flowing through the sensor (see https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/5_Mass_Flow_Meters/Sensirion_Mass_Flow_Meters_Application_Note_SFM3xxx.pdf).

I saw that some of the nodes were missing descriptions. Corrected in version 0.0.4.

WOOOW
i cant Waite to test it and sharing results …god bless you wayland

I wish you all the best…you are a wonderful person
thanks for XOD community and developers for creating this powerful IDE

Dear wayland
i have a question because something is not clear to me …do i need to process the out put (slm) with this equation ?

This conversion is performed by the underlying Arduino library (https://github.com/PubInv/SFM3X00).

If you want to see the details, take a look at this file:

You will see that the offset and scale factor are read from the device using the methods requestOffset and requestScaleFactor respectively. The method readFlow calculates flow rate in slm using the formula you posted. I’ve created a new node request-offset-scale-factor which will report the offset and scale factor. If you want to check these values, run example-read-offset-scale in the debugger.

I noticed a warning in the compiler output related to one of the methods in the underlying Arduino library. I don’t know if this was a critical problem, but I’ve forked the Arduino library and fixed the problem (https://github.com/WaylandM/MTW-SFM3X00).

thanks a lot for explanation …i will test the device and share results
regards

dear waylantd
after testing all the examples i m getting this error


thamks alot for your efforts

regards
M.AaL

[quote=“wayland, post:12, topic:4406”]


[/quote]after instaling the https://github.com/WaylandM/MTW-SFM3X00

You need to scroll back in the compiler window to see what the actual compiler error is.

Hi M.AaL,

Which board are you using? The code compiles for the Arduino Uno on my macbook. Are you running the latest version of the XOD IDE? Please let me know the details of the compiler error.

Thanks

i m using Arduino DUE with ver 0.34

already show print screen is there other details to show compiler error please tell haw to

thanks a lot

You’ll need to upgrade to the latest version of the XOD IDE (0.35.1). I’ve used the new C++ syntax for clarity and brevity, but this is only supported in version 0.35.0 onwards. I’ve checked that the code will compile for the Due, but I don’t have a Due for testing.

For future reference, to see the full compiler output you have to scroll up (as mentioned by @gweimer). The screenshot you posted shows us only the last part of the compiler output telling us there was an error. The specific problem would have been highlighted earlier in the compiler output.

thanks wayland gweimer
for the unlimited support

its works properly after update to the last ver



i will keep you update about the development
as i m new to xod can you help me with ideas to implement flow charts like this code sample and picture

i m still not familiar with if conditions and other basic code parameters
any guide material or suggestion to read or study will be appreciated
also i found library for pid controller i need to use it to control motor over pwm