Hi! Complete beginner here- I'm creating a soil temperature sensor, which I would like it to track soil temp in a greenhouse over the course of a few days and I can take the data out afterwards and graph it. Am I on the right track by looking to purchase a DS3231 Timer Module, SD Card Module with a Micro SD Card 8GB?
Also, it would be great to have it be solar powered- can anyone point me to tutorials and components I would need to make it so and how it would retain energy during the night?
Here is my wiring currently- temperature readings are working!
Assume your sketch opens the file when it starts up, and writes to it at intervals. How does your sketch know its hardware is being turned off and that it's time to close the file on the SD card? @Paul_KD7HB has pointed out one solution to that.
I 'just unplugged' an Uno one time and lost a 20x4 LCD display. Don't be sure you won't corrupt the SD card, have a clean power-off where it is not being fed data.
An advanced tinkerer would use a WiFi enabled board, running a web server.
Then you don't need a RTC or SD card and you can see the temp data directly (data or graph) on a smartphone or laptop. An ESP(32) board has enough internal storage for months (years) of data. Some ESP boards even have a battery connector and built-in charger. So you can connect a 5volt solar panel directly to the board.
I don't know where to find complete working examples like that.
The fun of this hobby is that you first learn the individual building blocks and then string them together.
Many years ago I built a website/temp logger with an ESP8266. (see last page).
Worked, but is very outdated. I would now use a Seeed XIAO-C3 instead.
I have implemented a river level monitor with temperature and humidity sensors using a Heltec WiFi32 LoRa V3 which has a ESP32-S3 (with WiFi and BLE) with onboard SX1262 LoRa and OLED modules
it uses BMP280 temperature/pressure sensor, a SR04M ultrasonic transducer and a DS18B20 DallasTemperature sensor uploading data over LoRaWAN to the ThingsBoard desktop, e.g.
the advantage of use a module such as the Heltec LoRa V3 with onboard LoRa module and OLED is it reduces the module interconnection wiring which is a source of poor connections and intermittent problems
to use LoRaWAN you would require a a LoRaWAN gateway in range - maybe a problem in remote areas
for local communication you could use LoRa point-to-point communicating between a pair of LoRa modules
i would start by checking the heatmaps for The Things Network and Helium. If your location is in range of a public gateway, congrats, you have access to a free, secure, time-stamped way to get your data on the net, using LoRaWAN.
If you're not in range, it's possible to set up your own gateway but this is definitely not a beginner level exercise. Instead, as already mentioned, point to point LoRa (not LoRaWAN) is a very effective and quite simple alternative.
You need two Arduino / ESP32 devices, one in the field, one back at base where it can access both LoRa and wifi. Here's an example I built, using an Arduino MKRWAN 1310 in the field and a Heltec LoRa V3 Wifi for the base station.
The field end is now solar powered although the photo is earlier than that. The MKRWAN 1310 can accept a 5V solar panel plugged into Vin without the need for a separate battery charger chip - it has one onboard.
Several years ago I worked on a river monitor project. Many locations did not have WiFi coverage so we used an ESP-01 (ESP8266) in Access Point (AP) mode as the interface to the system. In this mode the ESP-01 module acts as the connection point for WiFi so no router or internet required. An ATMEGA1284 did the data collection and storage. The ESP-01 implemented a web server to connect to a browser (phone or laptop) on one side and a serial interface to the ATMEGA1284 for maintenance and data download.
Since there was no internet connection we used a DS3231 RTC for timestamps. We used the alarm functions to generate interrupts for the data collection and WiFi on times.
We used an SD card for data storage and generated a new file each week to keep the files to a manageable size. The web server could download a file to the browser using the browser file download function. An advantage of the web server interface is that only a browser was needed on the reading device.
If I were doing the project today I would use something like an ESP32-S3 and put all the functions in one module. I would still use the DS3231 for timing. Depending on the data collection rate I would use the onboard flash or an SD card. The onboard flash memory has a limited number of write/erase cycles so I would do the calculation to see if that would be a problem.
We used solar power to run the system. We powered off the sensors between readings and only powered on the WiFi at specific times. The WiFi was the biggest power user and by limiting the on time and only running it during the day it was powered by the solar cells and didn't deplete the battery (but did slow down charging while it was on).
When using solar power be aware that solar panel output and battery capacity specs are optimistic, fantasy or outright lies. Multiply your expected power needs by 2 or 3 the get a reasonable value for the solar panel and battery.