Sensor Data to CSV file

Hi,

I am trying to write the logged sensor data in CSV file. I am getting the file with “i” {x,y,z} values and want to write that data to a CSV file.
Has anyone done it before? What would you recommend looking at first?

Hi @arystan

  1. Which ncd sensor are you using?
  2. What data would you like to write in the CSV file?

I’m asking because we are developing ncd Node-RED Dashboard with the function to save CSV data.

For now they are available for:

and more coming soon.

But if you are using another type, don’t worry, I could help you create your own flow.

Hi Eduardo,

We are using NCD 2-channel vibration sensor plus. The file below is the vibration we are reading (testing it right now). I want to write X Y and Z to CSV file.

Data_points.txt (112.2 KB)

We were able to read the device temperature separately.
I have not tried reading data through modbus yet, but I believe it could be an easier way to collect data through modbus and write it to CSV. Json file is attached below:
vibrationflows.json (16.7 KB)

Thank you!

Best regards,

I share you a basic flow to save CSV file for “i” {x,y,z} values:

[{"id":"846bf67135d18c8c","type":"csv","z":"554db30249c9d434","name":"building CSV","sep":",","hdrin":false,"hdrout":"none","multi":"one","ret":"\\r\\n","temp":" key, value_x, value_y, value_z","skip":"0","strings":true,"include_empty_strings":true,"include_null_values":true,"x":650,"y":200,"wires":[["96fe9348b70f10f3"]]},{"id":"96fe9348b70f10f3","type":"file","z":"554db30249c9d434","name":"Add your local path","filename":"","filenameType":"str","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":830,"y":200,"wires":[["b2df274e1d839634"]]},{"id":"b2df274e1d839634","type":"debug","z":"554db30249c9d434","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":990,"y":200,"wires":[]},{"id":"abea9099e3c8c3b0","type":"function","z":"554db30249c9d434","name":"getData","func":"var data = msg.payload.data;\nfor (const property in data) {\n  msg.payload = {\n    key : property, \n    value_x : data[property].x,\n    value_y : data[property].y,\n    value_z : data[property].z,\n  };\n  node.send(msg);\n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":200,"wires":[["846bf67135d18c8c"]]}]
  1. Copy JSON.

  2. Go to Node-RED instance, click on main menu and select “Import” option.
    Screenshot from 2024-04-01 18-19-59

  3. Paste JSON in textbox (pink color):

  4. Click on “Import” button.

  5. Connect the output of your ncd node (2-Channel Vibration Plus) to input function node:

  1. Double clic on “Add your local path” node and type the path where you want to save the CSV file and add the file name at the end of the path with the CSV extension, for example:
  • C:\Users<username>\Desktop<yourFileName>.csv

Screenshot from 2024-04-01 18-23-55

  1. Click on DEPLOY button, and if everything is correct, as soon as a new message arrives from the sensor, you should be able to observe in the debug window the data being written:

Screenshot from 2024-04-01 18-16-50

Then go to the path you assigned and open the “log.csv” file to verify the data.

I hope you find the flow useful, let me know if you have any questions or if I can help you with anything else,
Thanks
Eduardo M.

1 Like

Hi @Eduardo_Mtz,

I was going through this forum. I reviewed your suggestions:

I would like to ask if there is github subflow code I can use for my NCD Vibration Sensor V3 with Dashboard 2.0 as the above links.

My Flow:

Please let me know ASAP.

Regards,
Krish

Hi @krish15
We’ve just completed the first version of the dashboard for Industrial IoT Wireless Vibration Temperature Sensor V3 (For now it only works for one channel). Here’s the link:

The procedure for importing this Subflow is identical to the one shown for machine uptime and environment. A comprehensive article outlining the installation procedure and features will be published on our website soon.

If you have any questions about the dashboard, feel free to open a new thread.

Thanks,
Eduardo M.

Hi @Eduardo_Mtz,

Thank you for sharing this dashboard version. Its great and helped alot. However, I want to know what all I need to change in the dashboard settings if I have configured my 1-channel Vibration Sensor in Raw Mode only.

I would like to acquire only the X-axis, Y-axis and Z-axis vibration data and not the processed data. Please let me know ASAP.

Cheers,
Krish.

Hi @krish15,

Unfortunately this version of the Dashboard currently only displays processed values. However, we’re working on adding a function for raw mode. I’ll keep you updated on its availability

Thanks,
Eduardo M.

Hi @Eduardo_Mtz,

Please do fill me in when you manage to get the RAW function operational. I am in need for acquiring Raw data for analysis.

Kind regards,
Krish.

Sure, as soon as I have it, I will share it with you.

Hi @Eduardo_Mtz,

Just a follow-up on my request. Did you manage to finish up with the Dashboard for RAW function operation ?

Cheers,
Krish.