Save data from a sensor using a button

#1

I am currently using a GrovePi distance sensor, I would like some ideas as I am new to this area. Would it be possible for me to save in a file to download, the data obtained by the sensor at a certain time? If so, could you tell me where to start?

thanks Gabriel

0 Likes

#2

yes

I’d start by looking at flows.nodered.org and finding a node that can handle data from the sensor. wire that up to a debug to see what you get and then look at the file out to save all the data to a file.

When you have that working I’d move onto how to save it when you push a button, which could be an inject node or on a dashboard

0 Likes

#3

this I already did, my sensor is already working, throwing information to a graph, there is a start and pause button, and a reset button. Now I would like to make the button to save data.

0 Likes

#4

well it might have been worth mentioning that!

There are many ways to do it, for example…
You can add a change node into your flow to save the last value to a global variable.
Then in another flow have a button press pick up the global variable and save it to a file.

0 Likes

#5

Sorry, I forgot to mention it. Do you have some example of this application? I’m really new in the IOT area

0 Likes

#6

Sorry I don’t but you can read about Global Variables in the docs on the website, and theres lots of examples of dashboard buttons on flows.nodered.org

But the best way to learn, is by having a try yourself

0 Likes

#7

i will have a try, thanks

0 Likes

#8

Are the buttons physical buttons or buttons in the ui-dashboard?

0 Likes

#9

button in the ui-dashboard

0 Likes

#10

Ok, then follow the suggestions from @ukmoose - I just wanted to make sure it wasn’t a physical button.

0 Likes