I need to export serial monitor to a txt file or anything similar

I want to save serial data in the serial monitor that IS NOT connected to any network nor connected to a computer.

Its for a project isolated from those two things, ive heard of putty but im not sure if it works wiht my situation.

Anything helps!

It sounds like you need an SD card, then log your serial stream to that.

No external connection, just a log of the desired messages.

Yeah thats what i figured as well but i read a few guides and its just too difficult for me

or its outdated :confused:

It's not clear from your post how much information you wish to save and over what time period.

For small amounts of data, then I think you can copy (CTRL-A then CTRL-C) and paste (CTRL-V) the text into something like notepad.

For larger amounts, maybe something like:

1 Like

The obstacle with PuTTY or other terminal solutions is the lack of a connection to a PC.

What parts do you have.?

I dont really know if its gonna be a large or small amount of data, what I want to do is to print something like "Your temperature sensor has detected low temperatures(i set it to 10C)!" on a txt file saying that my sensors detected that the data is below the set threshold.

Isnt the serial monitor always new when you plug in your arduino? lets say I upload the code and im gone 3 days later i plug it back in do i find my serial monitor empty or not?

I have a LOT of parts, before I list them why do you need to know? (Just curious)

Well, currently you don’t know what/which parts to use… maybe we can suggest an idea from the box of bits you have - without needing to buy more.

How much data are you expecting to log ?
Simplest case is save to RAM, then dump to the serial monitor or PuTTY when you’re finished.

well i have my previously failed data logger so i have a micro sd card reader but i dont really have extra parts. size wise im probably not expecting a lot maybe a few KB im only running this project for 2 weeks so yeah

not really sure how im gonna dump the data to PuTTY since theres no internet where the project will be located (I could probably provide it with pocket wifi) nor it will not be connected to a computer 24/7. Again I dont know how PuTTY works since everything I read has tons of jargon in it.

I think you need the do some of the intro examples to get to he basics.

yeahhh i knowww but i really dont have the time as of now i will DEFINITELY do that after this. but right now i just need a straight answer to my face can i do it or not?

Yes, you can do it.

How tho, please educate my dumb ass

Yes, it is empty. But I wonder if there is a detail here that maybe you missed out?

Is your Arduino sat on its own with no powered PC connection for those 3 days - i.e. your Arduino needs to remember these events itself?

If so, then you probably need to decide if you want to simply know if the event has happened, or if you want to know when it happened as well. The latter would involve some sort of time keeping such as an RTC or if you are not too concerned about accuracy, the millis elapsed time counter can be used..

Taking that requirement on its own, you could simply have a counter of how many times the event occurred - store that in internal EEPROM. If you needed to know the actual low temperature, then that takes a little more EEPROM space. You don't need to store all the text or the set temperature as they are all knowns.

There is a threshold with the amount of data logging that determines whether internal EERPOM will be enough or whether an external storage device is needed.

You could start by deciding how frequently you want to sample the temperature each day and see if that helps. Maybe you could log the fact that the temperature had dropped below the set level as 1 event and then a separate event when the temperature goes back above the set level. That way you only record 2 events, rather than several events.

Perhaps a little more detail on your project would help us assist you further.

1 Like

Alright heres more details on the project:
im making a self regulating fogponics greenhouse, it regulates temperature, humidity, pH and etc that suits shallots, i set the high and lows in the code already to what shallots are capable of handling. it is ALL automated except for refilling the water resevoir. I need to prove that it IS regulating the temperature etc. which is why i need it to log that the sensors sensed that the data is below the set threshold. It is as you said i dont need to record time but it is nice to have which is why i have a RTC ds3231. To address your other statements: The arduino will be powered with a 9V wall adapter, Not sure how to use EEPROM ill search that up, lastly the thing about the 2 events is intriguing since it definitely shows that the system regulated temperature but i dont know how one would store the information that those events occured

If you want to keep it really simple, you could take 1 temperature reading every 5 minutes. That would be 12 readings per hour - 288 readings per day. Over 7 days that would be 2016 readings.

You could log temperature in whole degrees so each reading takes 1 byte of EEPROM. If your temperature range was 0deg to 25.5deg, then you could store temperature to 1DP.

If the temperature range is different, then there are simple ways of storing it in 1 byte.

Storing readings at regular intervals sort of gets you time as well. You know when you started recording and you know the interval, so you can deduce time from that.

I like that, i really really like that how do I go about implementing it in my code?

actual-code.ino (5.3 KB)

Did you try? You can even try it after 5 minutes. Arduinos spit the data out; if there is nothing at the other end to receive it, it goes to bit heaven. Further most Arduinos reset when you open serial monitor; with most external terminal programs this can be prevented (not sure if it can be done with putty).

So if you don't want your PC to be permanently connected to the Arduino to log the data, your only way is an external storage mechanism for larger amounts (e.g. sd card, external EEPROM or FRAM) or use of (internal) EEPROM for small amounts. But you must have an idea how much data you need to store.