So this is my first electronics project but I got dropped into it for a senior design project. My team is building a Relative Humidity and Temperature sensor using the Arduino platform. We are using the RHT03 sensor along with the Arduino Uno right now but plan to go to the Pro Mini as soon as possible. We apparently weren’t thinking when we bought the first batch of parts and don’t have any data logging parts now. We also don’t really know what we would need either. Can any one help me out with picking a data logger and any other necessary equipment. I’ve been checking out the uLog and the OpenLog so far. Also any helpful tips with making the whole thing work in general would be great! We’ve got the sensor running but so far I’ve only been able to get it to produce output as “Relative Humidity = x.x% Temperature = x C.” Is there a way to get it to store in a format that’s easy to turn into a graph?
CSV (comma separated variables) is a reasonable format as long as you don’t care too much about memory space. It has the advantage of being easily machine parse-able and is also human readable for debug. Because the data is a stream of ascii records you can put it in local memory or you could stream it over most any communications channel back to a host.
Records should be delimited so you can find the start and terminated so you can do some validation.
How often are you taking samples; once per second, once every minute, 10 times a second ? How many samples or how long must it run for before you get around to retrieving the data ? These are somewhat important factors in picking a logger. When retrieving the data how are you going to do that ? Are you going D/L it via a serial link or do you want to change out and put in some new physical media (like a USB drive or SD card or ??) ? Is power usage an important consideration ?
Data will be collected at most once an hour. We would like the sensors to be able to collect for days at a time if that’s possible. So power usage is probably an important consideration. I did a little more research and will probably be going with the OpenLog so I’ll be using an SD card but have no idea how big to use. I also haven’t really decided what size of battery to use either.
How about a very crude analysis of your data storage requirements ?
You have temperature which I will say takes a sign, 3 digits and 1 more digit to the right of the decimal point (+/-XXX.x). Sent as ASCII characters to the logger that’s 5 bytes. Humidity will be another 3 digits (HH.h). Add a comma and a end of line character and that’s 10 bytes per sample. If by “days” you mean 1 week then that’s 10 bytes x 24 samples/day x 7 days/week = 1680 bytes, a pittance. You could store that amount in the Uno’s SRAM, but I wouldn’t for fear of some power outage or reset. If you didn’t store the data as ASCII, rather just in it’s raw data form (2 bytes, 4 bytes per sample) then you could assign them locations in Uno EEPROM and forgo any external logger. You have 1k of EEPROM and need 672 bytes at 4 bytes/hr for 1 week.
Now that is some very very useful information. Thank you so much! So if I were to still want to use an external logger, any SD card should have way more than enough storage capacity correct? But with the EEPROM method, does the Pro Mini have that capability as well? As for the power consumption, how would I calculate the size of the battery needed? Thanks for all the help!
Yes, any SD or pretty much any logger will have enough space to record that little data. The Pro Mini is just an Uno but w/o the USB-serial converter and w/o the 3.3V voltage regulator (and the headers obviously). It has the same microcontroller as the Uno and so has the same flash, SRAM and EEPROM memories.
As for battery size, you need to estimate how much power each device uses and then how long they’ll be consuming power at that rate. That will be a crude estimate of the energy the battery must have. Generally batteries will have energy ratings expressed as milliAmp - hours (mAh or mA-Hr). So a single cell might have a rating of 1000 maH. That (ideally) means it could support a draw of 100 mA for 10 hours (100 mA x 10 hr = 1000 mAh) or perhaps 1000 mA for 1 hr or … you get the idea. However the larger the actual current draw is, the less energy can be extracted from the battery. And you’ll find that there are no 5V batteries so there will be some waste in converting the battery voltage to the voltage(s) used by the Arduino and devices. And, depending on how that conversion is done, you may not be able to extract the full capacity of the battery.
Lastly I will mention that running different blocks of code will affect the amount of current drawn by the Arduino. But you can also put the Arduino into lower power “sleep” modes to reduce power consumption if there are long periods of time when it’ll be doing nothing but waiting. I don’t know about your sensor or logger or other devices you may be using. Perhaps a good reason to use the Arduino EEPROM ? Or recharge the battery with a solar cell instead of swapping them out ?
For a long winded discussion on batteries and power usage and such you might find this thread useful to read: