compare sensor data range over time to shut off

danieljay:
how would i reset millis() ? how to apply it to sensor pin? I've read documentation and understand it, but i can't grasp how to apply it. to reset... and then it seems like i need some more logic?

Calling millis() returns the time it's been since the last reset. When you make a call like:

timeSinceChange = millis();

This is essentially a saying take a time stamp of right now and store it in the previously declared variable named timeSinceChange.

In your project specifically, you want to keep track of the last time the value has changed, so you need to set the "timestamp" whenever your reading is different from your last reading. If it is the same, you need to compare the time since the change (Hint: Millis() - timeSinceChange) to see if it's greater than a certain interval.