Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real-time plotting of Arduino sensor data on a laptop/PC #4

Open
dwblair opened this issue Aug 20, 2012 · 11 comments
Open

Real-time plotting of Arduino sensor data on a laptop/PC #4

dwblair opened this issue Aug 20, 2012 · 11 comments

Comments

@dwblair
Copy link
Member

dwblair commented Aug 20, 2012

Image

Background

We've been able to get the Arduino to report pressure and temperature values (details listed on PVOS soon ...). But we'd like to plot the values in real time, in a graphical window, rather than just spitting out values to the serial port. Below are some research notes on this.

@dwblair
Copy link
Member Author

dwblair commented Aug 20, 2012

A standard way to do this is to write code in Processing (Processing.org) to read values from the serial port and plot them, and then write Arduino code that sends values to the serial port.

-- but I'm having trouble getting my Ubuntu / Linux version of Processing to play nice with the particular Java library that regulates serial communication (at least, I think that's the problem) -- so I'm going to try another way: getting Python to talk to the serial port, and plot the results in a(n awesome) Python plotting library, "matplotlib". Will report on progress ASAP.

@dwblair
Copy link
Member Author

dwblair commented Aug 20, 2012

Here's the link that convinced me to try Python + Arduino + matplotlib.

@dwblair
Copy link
Member Author

dwblair commented Aug 20, 2012

I followed the instructions in the above link -- one catch was that I had to use the following command:
"sudo apt-get install python-wxgtk2.8" on Ubuntu.

@dwblair
Copy link
Member Author

dwblair commented Aug 20, 2012

Hmm. Okay, that's not working immediately. I think I'm doing something wrong vis a vis the code and the serial port. I'm going to look for a simpler demo re: python and serial. Found one here ...

@dwblair
Copy link
Member Author

dwblair commented Aug 20, 2012

Hmm. That's also a bit screwy. Trying this tutorial instead ...

@dwblair
Copy link
Member Author

dwblair commented Aug 20, 2012

Ah! Okay, here was the trick -- needed to close the Arduino IDE before trying to read from the serial port with Python!
In the end, here's the code I used -- based precisely on the great tutorial here. Generated the graph below.


@jywarren
Copy link

This is pretty cool -- Don, we have this project going where Public Lab folks are trying to detect hydrogen sulfide with DIY photosensitive strips, but we want to correlate data with an electronic sensor we connected to an arduino. I was curious if it was an interesting use case which you folks would want to collaborate on?

You can read more about the electronic sensor here: http://publiclaboratory.org/tool/hydrogen-sulfide-sensing

and many updates on the paper sensing strips here: http://publiclaboratory.org/notes/hydrogen-sulfide-sensing

Basically trying to do some triangulation of various sensing techniques. We have an SD card writer too so the arduino sensor can be left on site for a few days with the strips.

@dwblair
Copy link
Member Author

dwblair commented Aug 21, 2012

Hi Jeff!

Wow, this project is super cool! I'll definitely pass the links around -- I'm pretty sure that a bunch of folks here would be interested. A lot of people are away / traipsing about during the summer, but after the first week of September I'm guessing that folks will become more active. I'll look into it meanwhile, and corral whomever I can into looking into it, too ...

On PLOTS there is a post indicating that the Figaro TGs 825 hydrogen sulfide detector needs temp & humidity correction -- and it just so happens that I'm looking into temp and humidity sensors for use on an Arduino board myself right now, and the least expensive I could find were the DHT11/22 sensors for $5 / $12.50 on Adafruit. The sensors are almost identical except for the sensitivty; details via that link, but in summary:

  • The $5 version (DHT11) is good for 20-80% ± 5% humidity readings and 0-50°C ± 2°C temperature readings
  • The $12.50 version (DHT22) is good for 0-100% ± 2-5% humidity readings and -40 to 125°C ± 0.5 °C temperature readings

Brilliant idea re: getting triangulation on an H2S reading via multiple techniques. I'm eager to look at the paper-based technique, see how the setup works, and play around with it. I'll also ask around and see if any of the supergeeks can dig up any cheaper Arduino-based sensors than the Figaro, somewhere online ...

Thanks!

@dwblair
Copy link
Member Author

dwblair commented Aug 21, 2012

Update: I've created an new "PLOTS H2S Sensor issue" on github (to try to grab the attention of folks here -- it points them towards the PLOTS pages on H2S sensor topic) and I've posted the above DHT11/22 info to the "temp and humidity correction" H2S page on PLOTS.

@jywarren
Copy link

great, i'm so glad you're into this project. We already bought a
temp/humidity sensor and i'm digging around to find which one we found...
it was pretty cheap.

Update: here it is, $12 shipped:
http://www.dfrobot.com/index.php?route=product/product&filter_name=DFR0067&product_id=174

That old thread on temp/humidity is here:
https://groups.google.com/forum/?fromgroups=#!searchin/publiclaboratory/temp$20humidity/publiclaboratory/j_VABzIOFCM/5QTcJ52sdlQJ

and I'm CC'ing the main PLOTS list just because I know there were folks
with ideas/suggestions on temp/humidity I was chatting with some months ago.

Jeff

On Tue, Aug 21, 2012 at 3:49 PM, dwblair notifications@github.com wrote:

Update: I've created an new "PLOTS H2S Sensor issue"https://github.com/Pioneer-Valley-Open-Science/pioneer-valley-open-science.github.com/issues/5on github (to try to grab the attention of folks here -- it points them
towards the PLOTS pages on H2S sensor topic) and I've posted the above
DHT11/22 info to the "temp and humidity correction" H2S pagehttp://publiclaboratory.org/notes/warren/9-26-2011/temperature-and-humidity-sensors-correct-h2s-sensoron PLOTS.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-7913725.

@dwblair
Copy link
Member Author

dwblair commented Aug 22, 2012

Thanks re: the link for the humidity / temp sensor -- yeah, that's the same DHT11, although on a breakout board -- cool -- and dfrobot looks like they have a bunch of other cool sensors, too -- will check them out.

Will check out the old temp/humidity thread, too.

This'll be fun -- cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants