Hey all,
I have recently built a temperature controller. I am using it for beer brewing for two things, first is to control my mini-fridge as a temperature controlled fermenter (i.e. turns on a relay when temp goes above setpoint). Second I use it to control the temperature of my mash using a single plate stove (i.e. turns on the relay when temp goes below setpoint).
I am using arduino with the LCD shield and data shield from adafruit. I like having the option to log my data so it's a really neat feature. Especially while I am refining my code etc.. but I have a few questions.
First, when it is logging the fermentation chamber, having a reading and sync every second is a bit too often. The file gets very big and unwieldy very quickly. I tried setting the log_interval to 10sec but then it makes the buttons etc.. un-usable on the LCD shield as there is a 10 second delay between loops! What is the best way to reduce file size and shear number of data points but not delay the whole system?
Second, is there a way I can either have a physical switch or a software option to disable the data logger? Ideally I would like it that I would be able to turn on the system with no SD card attached and then only if I want to log, insert a data log and either flip a switch or select the option in a menu. At the moment every time it reboots it HAS to have an SD card inserted and also makes a new log file every time. Is there a way around this?
Any help would be great.
SW
Data logger questions
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88086
- Joined: Sat Feb 07, 2009 10:11 am
Re: Data logger questions
I am assuming you are using 'delay()' to time your logging loop. This is a problem for all but very simple-minded logging applications because nothing else can happen during the delay.I tried setting the log_interval to 10sec but then it makes the buttons etc.. un-usable on the LCD shield
A better way to do it is to let the loop run as fast as it wants, and base your logging on a time-check: If 10 seconds have elapsed since the last log, remember the time and do another log.
Just wire the switch to a digital input and check the state of that when you do the time-check mentioned above.Second, is there a way I can either have a physical switch or a software option to disable the data logger?
Most likely. Post the code you are using and we'll take a look.At the moment every time it reboots it HAS to have an SD card inserted and also makes a new log file every time. Is there a way around this?
Please be positive and constructive with your questions and comments.