Easiest way to do this is to use a NodeMCU or WeMOS (or other board with ESP8266 processor). It's got WiFi connectivity built in, and plenty of Flash (4 MB for the ESP12E modules used on those two boards) to store your waste levels. In deep sleep mode it will run on batteries for a long time.
Of course you have to tell the code to store the data, and how (write a file on SPIFFS). Timestamp: easy, just make sure you have the current time. Get it over NTP if you have WiFi available or connect a RTC. Then store it as UNIX timestamp for easy processing.
Just to add onto this. If you want to store timestamps in your local time instead of UTC (that is what you get from an NTP server) then you can use this github repository code to parse the local timezone file (you can get the local timezone file from this path /usr/share/zoneinfo from any linux machine or from the github itself).
If you know your timezone you can just hardcode an offset :-) Good enough for most purposes.Good luck with your research.
Hi, a follow-up question:I found sketches for activating the HC-SR04; NTP server pooling; and simple file creation. I am just not sure how I would put these all together in a way that would give me waste levels with a time stamp, that I could then see at a later date when I plug the NodeMCU back into the laptop?Thanks
I had a similar project and I ended up using microSD card with 512 MB size (pretty cheap around 3$ per SD card).