PDA

View Full Version : Temp Control and Data Logging



Pages : 1 [2]

Kirk Keyes
01-09-2009, 02:03 PM
Even nicer:
http://www.danielandrade.net/2008/07/05/temperature-sensor-arduino/

I guess I get one and try it!

Can you Arduino experts :^) point me to how you take the readings from the Arduino and save the results, perhaps with a timestamp? Can you tell the software to save values to a text file or something?

Photo Engineer
01-09-2009, 04:59 PM
Use Timer$ in VB or C++ on a Windows machine to get the absolute time, or Timer.now - Timer.then (made up variables) to get offset. The value can be gotten by an In statement or other type depending on the language and port. For a parallel port, which was easy, it was a bit compare. For serial it is a bit (hah pun alert) harder.

PE

optique
01-09-2009, 05:16 PM
Kirk

IMHO you should join the forum at arduino.cc and spend a few days there first. You will make informed decisions then and end up having much more fun. WARNING: THE ARDUINO IS HABIT FORMING.

I can guarantee you will become well familiar with the concept/utility of the "serial terminal."

BTW, the arduino forum people are some of the most patient and helpful you will find (outside of apug that is!) As Lee indicates, Arduino net support is broad and deep.

Good luck
Steve.


Even nicer:
http://www.danielandrade.net/2008/07/05/temperature-sensor-arduino/

I guess I get one and try it!

Can you Arduino experts :^) point me to how you take the readings from the Arduino and save the results, perhaps with a timestamp? Can you tell the software to save values to a text file or something?

Lee L
01-09-2009, 06:48 PM
Kirk,

It might be helpful to know what platform you're on, and what languages you have available or would prefer to use. I know I was looking at code last week for doing just what you want, python (a "free in all senses" programming language) reading the serial port (actually USB posing as serial) where the arduino was connected, the arduino supplying data at a given frequency to the port (9600,8,N,1), then a write to a file. I also found a polynomial fit for the data on a thermistor I had on hand (mfgr's data, not tested) that was within +/- a degree celsius over a broad range. There's also a system time call in python that's simple. Is there a language without one? There are more linear thermal sensors than a thermistor available. Parallax has some of those, as do the usual suspects, Mouser, Digikey, etc.

I was thinking that I might point you at some code, but after looking a bit decided that it would be too early to try that (way too many possibilities) when I don't know your OS or preferred computer language for communicating with the arduino and writing to files. Try looking at the documentation and introductory downloads at arduino.cc, read through some of the sample programs, look at the forae there, and that will give you a good idea of what's involved. You might be surprized at how easy it can be. Google on 'arduino thermometer' and browse what comes up.

Lee

Kirk Keyes
01-10-2009, 09:43 AM
Lee - I'm running Win 2K and XP, and I can build a Fedora box if need be, but I kind of prefer to stick with windows. I can get around in Linux, but I'm not too fast with all the make/makefile stuff. Languages, I know Basic best, and when I say Basic, I mean like True Basic, not any of the VB versions that have come along over the years. I really don't know any others to that depth, and it's really been 20+ years since I've used it. I can muddle my way around Excel macros and HTML, I supposedly learned a bit of Pascal years ago. (The t-shirt that was popular at the time I was at Reed College was "Pascal - for those that can't C"). All I really remember is that I hated Pascal - too strict or something. I looked at Python for a half hour about 10 years ago...

So I guess I guess I'm learning something new, as far as languages go.

After that, I'd like the data in text or csv form and then I'll use Excel for my number crunching.

Lee - if you want to collaborate, I'm up for it. I've ordered a Arduino Duemilenova and a DS18B20 serial "one wire" temp sensor. That one looked like it had a bit more resolution than the other stuff I looked at. The DS18B20 seems kind of elegant. And being serial, I figured I could always just plug it into a serial port and use a program like Windmill serial software http://www.windmill.co.uk/

But the LM-34/35 temp senors looked easy enough as well, and cheap and easy to find. No fitting polynomials to any of the 3 chips I've mentioned.

I've got breadboarding stuff, and I'm able to understand basic electronics - I've build a MIDI interface for my old analogue synths from a kit as well as other mics projects like I did a shutterspeed timer years ago. It's not elegant, but it does work and reads down to 0.1 milliseconds.

I'm flexible on languages, so what ever you know, we can do. I see Python is available for Windows.

Kirk Keyes
01-10-2009, 09:47 AM
And after doing a temp project, I'd like to data log off the serial port on my pH meter, and maybe send commands down a serial port to control the speed of my peristaltic pumps. But first temps.

Lee L
01-12-2009, 11:28 AM
<snip>
Lee - if you want to collaborate, I'm up for it. I've ordered a Arduino Duemilenova and a DS18B20 serial "one wire" temp sensor. That one looked like it had a bit more resolution than the other stuff I looked at. The DS18B20 seems kind of elegant. And being serial, I figured I could always just plug it into a serial port and use a program like Windmill serial software http://www.windmill.co.uk/

Kirk,

I have too many irons in the fire already, and a few other arduino projects ahead of something like process control logging. But you've hit on the right stuff already, and I think you'll be surprised how quickly it will come once you get started. Besides, I'm on linux only now, and can'd duplicate your setup. I haven't done much real program writing since the mid-80's when I got the first release of Turbo-Pascal for $49. Put together an Epson FX-80+ control program that (along with other things) would upload a Greek and math character set I put together to upper ASCII for my wife to use in her thesis.

BTW, with newer versions of linux, there's not nearly so much compiling necessary anymore. Most distributions install binaries from repositories and have installation managers that take care of dependencies these days.

Lee

Lee L
01-12-2009, 11:30 AM
And after doing a temp project, I'd like to data log off the serial port on my pH meter, and maybe send commands down a serial port to control the speed of my peristaltic pumps. But first temps.
The Arduino IDE has a serial monitor that will show you the raw output from the serial port for your pH meter if it's sending. Just point it at the correct port with the right baud rate.

Lee

domaz
01-12-2009, 11:52 AM
Careful waterproofing an LM35, since it's analog it seems to be very responsive to any electricity in the water. Case in point: I waterproofed my LM35 using epoxy, Cat5 cable and a plastic pen tip. I tested it in a plain cup of water and it gives a reasonable reading. The moment I put it in my Jobo's water the temperature goes crazy. It only does this in the Jobo's water, I suspect because of the heating element. My next attempt I'm going to have to try to shield the sensor better I guess.

Kirk Keyes
01-12-2009, 12:15 PM
Lee, thank for the info. What Linux distro are you running? I've got a computer in the darkroom that has removable bays in it so I can whip together a linux box pretty quick. I've got RH/Fedora disks up to about Fedora 3 or so, and all my experience has been with RH/Fedora.

DOmaz - so you are thinking you have a bit of a ground fault in your Jobo? I was thinking about unclosing whatever sensor I get in a stainless tube so I can hang it from a ring stand clamp and suspend it is the emulsion kettle. There should be no stray electrical currents in there though. Just magnetic ones!

Lee L
01-12-2009, 12:45 PM
Kirk,

I'm running several vintages of Ubuntu now and for the last 3 years or so. I've tried a few others, including Red Hat, but that was back at 5.2 or so, ancient history in computer years. Fedora 3 and later should use RPM (Red Hat Package Manager) binary repositories. Ubuntu is built on Debian and uses .deb binary packages. Nearly any current linux you pick will have binary package management. Fedora is now at 10, so you might want to try it if you'd feel more at home there. Even software that isn't in official distribution repositories is often available in .rpm and .deb form on various web sites.

You should also be able to easily dual boot MS and linux if you have enough space on your hard drive, or a slot for another hard drive. I do that with a couple of machines here to keep other people in the family happy. I prefer to add a dedicated linux hard drive, and storage is pretty cheap now. Linux can also now read and write NTFS, and someone's done a program that allows MS Windows to read/write ext3 *nix formatted drives.

Lee

optique
01-12-2009, 01:10 PM
Funny, I messed with LM34/35 + Arduino a few years ago too. Making the sensor waterproof was a pain but also a challenge.

Ubuntu is a good platform for the Arduino IMHO. If you are serious about Arduino, you need to learn C asap and C under Linux is natural.

There is a pretty good learning curve even with a great environment like the Arduino offers. So plan on doing very small things, like learning to blink an LED, before you even think about serial stuff.

I thought a lot of these site:
www.sparkfun.com - general hardware
www.moderndevice.com - kit forms of the Arduino hardware.

Good luck.
steve.

Kirk Keyes
01-20-2009, 04:39 PM
OK - I got the Arduino, and I've blinked the LED. I wasn't able to find a LM-34/5, but I've got a DS18S20 too. I need to find my breadboarding stuff and some time to try it out. It looks like it should work nicely.

Phillip P. Dimor
01-20-2009, 06:47 PM
I googled Arduino and it is seriously cool.
Years ago I found a text file on 'dream goggles'.. An IR emitter/sensor that bounces off of your eye and waits for a change (REM sleep), once that happens it blinks an LED light to let you know that you are dreaming.. Pretty cool stuff, I just remember the software being kludgey but it did work.

Arduino would be perfect for that.. OT sorry.. just wanted to say thanks for the heads up on that.

Kirk Keyes
02-20-2009, 02:49 PM
After a bit of programming help from my cousin's husband who programs in C and Java professionally, I can data log temps with the Arduino board and either a Maxim-IC.com DS18B20 or DS18S20 1-wire serial temperature sensor (they have different software requirements). Total parts used are the Arduino board ($35), a breadboard ($10), a 4.7K ohm resistor ($0.01), a couple bits of 24 ga. wire, and 1 to 3 temps sensors (free samples can be obtained from Maxim-IC).

Now to hard wire everything and put the sensors in to stainless tubing, and do a bit of soldering, it should be up and running. We're still putting a bit of prettiness in to the logging program, which time stamps the data and writes to a text file. I'll post the code for it when it gets finalized.

In the mean time, for those that want a cheaper and commercially available option, look into the Go!Temp sensor from Vernier.com http://www.vernier.com/go/gotemp.html It's $39 with its own data logging software. That's a pretty sweet deal. Looking at the specs, it's got the same accuracy and prescision as the Maxim chips I used above. The Go!Temp probe also plugs directly into the USB port so no additional hardware is needed as in the do-it-yourself approach.

Lee L
02-20-2009, 03:16 PM
Very nice Kirk. I was wondering a couple of days ago how things were progressing. Thanks for posting the sources for hardware. I'm looking forward to seeing the code.

Lee