Arduino -> RPi Data Logging & Graphing my Garden

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
CaseyScalf
 
Posts: 149
Joined: Wed Nov 05, 2014 3:07 am

Arduino -> RPi Data Logging & Graphing my Garden

Post by CaseyScalf »

Hello,

After much research I am ready to get down with a gardening project. I got a single section of http://www.florafelt.com/ at the recent Maker Faire and now I would like to use this as a chance to learn about future gardening and also some new skills.

My aim is to gather data (Temp, moisture, light, PH, etc) and then save this data. Then, be able to graph that data and make sense of it and hopefully gain some insight.

Clearly there are many ways to do this. I am not looking for a exacting How To, but rather a few guidelines or suggestions.

I have a good handle on the sensing parts. I got most of them from you. I will be using an Arduino for the sensing because it is 5V and has analog sensors.

I want to use a RPi to do the displaying because they have handy touch screens and can do more computing than an Uno.

I would like the data logging and graphing to be done locally. The cloud is cool but I want to keep it simple. Unless... there is some huge reason I should send these readings to a database somewhere...

And then start my questions...

How should I save the data? I was thinking an SD card on the Arduino would be possible, yet it would require the Pi to call the Arduino every read. So I am thinking send the data from the Arduino, over serial, every time it is gathered, to be saved on the Pi. Totally possible right? Best of practices or methods anyone?

Next, after this is saved in a text file or something similar I am assuming. I would like to read and graph this data using Processing. Assuming it is a text file I can find lots of ways to do this. I am thinking a view for daily readings, weekly, monthly. Show this data, hide that data. I can take care of that.

But what about running the sketch while it reads/writes data? Do these interrupt each other? Can it live update?

I hope I stated my project and unknowns well. A) How to send and save to the Pi B) How to read without interrupting.

Very very stoked on this one! Thanks again for literally having everything in one place too!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino -> RPi Data Logging & Graphing my Garden

Post by adafruit_support_rick »

Not sure I see the need for communicating between the Arduino and Pi in real-time. It sounds like you want to process and view the data on the off-line. So why not just record the data to an SD card on the Arduino, and process it later?

User avatar
CaseyScalf
 
Posts: 149
Joined: Wed Nov 05, 2014 3:07 am

Re: Arduino -> RPi Data Logging & Graphing my Garden

Post by CaseyScalf »

Thank you for the reply,

I was hoping to be able to walk up to the system, wake the touchscreen, and look at the data.

Although I could easily write the data to a SD card, and then mount that to the RPi, I was hoping to have it to be a little more hands off.

Is there perhaps a way that the Arduino could do a nightly or hourly dump of the data?

For me this is a proof of concept. I am looking towards the future where this will be a much more synchronous system and there will be more likely be a few of these in my house.

Do you see there being any serious problems with the Arduino writing to a text file on the RPi?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino -> RPi Data Logging & Graphing my Garden

Post by adafruit_support_rick »

There are lots of ways to communicate between an Arduino and an R Pi. Since this is just one-way, I suppose a text file would be the easiest. You could simply write csv lines to a serial port on the Arduino, and pipe that stuff to a file on the pi.

User avatar
CaseyScalf
 
Posts: 149
Joined: Wed Nov 05, 2014 3:07 am

Re: Arduino -> RPi Data Logging & Graphing my Garden

Post by CaseyScalf »

Excellent, thank you for the pointers I will definitely dig into that and research it some more

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”