Making a USB Temperature Sensor, Journal

Making a USB Temperature Sensor, Journal

Postby SirLeech » Fri Nov 28, 2008 6:53 am

Here is a recent experiment I've done with making a cheap temperature sensor connected to my MAC. The sensor itself is quite cheap to make (the orange board), the sensor IC is about 3 dollars, and the rest are some wire jumpers, a 2k trim potentiometer and a resistor. Total cost about $8-10 and some free time.

What you see the temperature board hooked up to is an Arduino, a cheap USB i/o controller available from Sparkfun electronics. I can control about 10 analog inputs (one is being used to monitor the voltage of the temperature sensor) and 10 or so 5V outputs that I monitor/switch from the computer. The neat thing about getting this interfaced to an i/o board is I can use the temperature data to switch devices, sound alarms, etc.

Image


Here is a screenshot of the software. Basically, the temperature sensor takes an input of 5v, and will output a voltage at +10 mV/ Kelvin, which can be easily converted to Celcius as seen in the software. The sensor turns out to be quite accurate and highly responsive -- I can breath on the sensor lightly and detect a minute temperature change. Right now it is obviously not waterproof, but that is easily solvable with some heat shrink tubing (this is actually recommended in the IC datasheet by the manufacturer for making waterproof temp. sensors!)
Image

A diagram of the board, and all the parts used. I'm happy to explain how the Arduino board works to any interested, and code examples are available for the brave hearted.

Image
Image
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Postby TheChemist » Fri Nov 28, 2008 3:30 pm

Awesome!

Could you post the actual schematic, just so it is more clear, how the connections on the test board were made.

Also, how cheap is Arduino? Do you know if it is available worldwide?
Is there something similar for digital input/output? I see so much potential use for this gizmo it is mind boggling. :)
Also, do you know, how accurate are the readouts from Arduino?

Thanks!
Andy

Onyx A. percula, A. ocelaris. P. kauderni, L. wurdemani, L. amboinensis, black ocelaris, E. oceanops, grama loreto, P. aldabraensis
TheChemist
 
Posts: 319
Joined: Tue Jul 22, 2008 7:29 am
Location: Slovenia, EU

Postby SirLeech » Fri Nov 28, 2008 4:47 pm

Andy, the Arduino boards are about $30 USD, I have one I brought from the US from Sparkfun electronics, and I've also purchased another one here in Australia (thats why you see two, my temp sensor actually only uses one, but I was playing with getting the two to talk when I took the pictures). They are fairly popular among the physical computing community so you should be able to find them quite easily; if you don't have any in your country I'm sure you could find an international shipper.

The Arduino board has 13 digital in/out pins that can be used either way, and 6 analog inputs. Each digital pin can also be used for serial TX or RX, and two digital pins are also available for hardware serial TX/RX. Lots more information on these boards is available on the Arduino.cc website. Great little boards and I love them to death.

Your question about accuracy-- the accuracy would be as good as your sensor. The temperature sensor I've build here depends on the trim pot to make a calibration, which is only as good as the thermometer I'm calibrating to. What I read from my analog input is an integer value from 1-1024, which I'm assuming 1 = 0v and 1024 = 5v in my calculations. I then convert the number to volts, then to kelvin, then to celcius. You can see the original 1-1024 reading as "raw" in my software.

Here is the schematic I used from the LM335Z Temperature Sensor PDF. The trim pot used is actually 5k (10k works, but I found 5k is actually better for the 5V load you get from the Arduino), and the R1 resistor is 2k. Find the LM335z from Mouser or some other electronics supply. I can buy them from my local electronics shop they are that common.

-Chris

Image
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Postby TheChemist » Fri Nov 28, 2008 5:28 pm

Regarding the accuracy, I am particularly interested to know the bit resolution of the integrated ADC. 12 bit? :) More?
Andy

Onyx A. percula, A. ocelaris. P. kauderni, L. wurdemani, L. amboinensis, black ocelaris, E. oceanops, grama loreto, P. aldabraensis
TheChemist
 
Posts: 319
Joined: Tue Jul 22, 2008 7:29 am
Location: Slovenia, EU

Postby SirLeech » Fri Nov 28, 2008 5:30 pm

Ha...I'm not sure. You probably want to look at the documentation of the ATMEGA 168 chip that drives the board. I'm sure its accurate enough for what we want do do though (fish tank control)....just maybe not for cruise missiles and space ships and such.

I hope you are able to get an Arduino, they are great to play with and a cheap alternative to marine controllers if you want to have a little fun building as well. I've successfully driven high-current relays for mains power with the arduino (using an external power source, and diode-protected transistors of course).

In the end though, making your own gives you so much more possibilities for what you can do (not to mention much cheaper), but potentially more prone to failure if your craftsmanship is shoddy.
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Postby BaboonScience » Sat Nov 29, 2008 3:51 am

Awesome! I have been looking for something cheap that I could integrate into my MAC menagerie. I have several older MACs, including a G5 tower. Trying to stay away from the intel stuff for a while.

It looks as if the electronic assembly is fairly simple. I may even be able to remote the temperature probe.

What interface programs are you playing with?
Thanks.
"The exact contrary of what is generally believed is often the truth" Jean De La Bruyère (1645-1696)
User avatar
BaboonScience
 
Posts: 3629
Joined: Fri Mar 02, 2007 8:47 pm
Location: High Shoals

Re:

Postby TheChemist » Sat Nov 29, 2008 6:46 am

SirLeech wrote:....just maybe not for cruise missiles and space ships and such.


Oooohhh, but that is exactly what I want to do. :D

Seriously, I am thinking about using it for some laboratory equipment interfacing. Like running a HPLC and being able to read the data (-1 to +1 V signal). So 12 bit would be at least minimum. I guess I'll just look up the specs.
Another question, how do you read the data (software?) is it custom, is there a neat way of writing your own (commands wise?)
Last edited by TheChemist on Fri Jan 16, 2009 2:07 pm, edited 1 time in total.
Andy

Onyx A. percula, A. ocelaris. P. kauderni, L. wurdemani, L. amboinensis, black ocelaris, E. oceanops, grama loreto, P. aldabraensis
TheChemist
 
Posts: 319
Joined: Tue Jul 22, 2008 7:29 am
Location: Slovenia, EU

Postby SirLeech » Sat Nov 29, 2008 9:18 am

Baboon and Andy,

About software, the Arduino board has a few options you can go with. The board was designed to be a programmable controller-- you program the board with your USB cable, then let it go free, it does its own thing. The example I show however is using Processing, a Flash-type language for graphics programming. Some good folks at Arduino have written a good library for talking with Processing, so it's really easy to get the the Arduino talking to your computer. This is totally customizable as you are writing the code for the software Andy.

I've also looked into other alternatives to Processing. At first I really wanted to get the board hooked up to Flash so I could use Actionscript and not have to learn a new language. There are Actionscript 3-Arduino libraries/drivers, but I couldn't get them to work very well as they are out of date and have not been maintained (as sometimes happens with Open Source projects).

The Arduino uses serial communication, so if you want a custom software solution, any language that can read/write your serial ports can communicate with the board. Just could take a little (or alot) of work.

In the end I am using Processing anything I want to see on my computer as it was the easiest solution, but will still want to take advantage of the "programmable" nature of these boards and configure them to run on their own. I wouldn't trust any general-use operating system with life support. I've only recently started using these boards, and will try to apply them in interesting and useful ways to my fish tanks. Will keep you guys posted of my progress if interested...
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Postby BaboonScience » Sat Nov 29, 2008 9:44 pm

And Processing is an open source option as well. I like that.
John
"The exact contrary of what is generally believed is often the truth" Jean De La Bruyère (1645-1696)
User avatar
BaboonScience
 
Posts: 3629
Joined: Fri Mar 02, 2007 8:47 pm
Location: High Shoals

Re: Making a USB Temperature Sensor, Journal

Postby BaboonScience » Sat Feb 06, 2010 1:32 pm

I remember this thread from the past about the Arduino USB interfaced controller.
I finally have a use and need to figure this one out. There are quite a few add ons and extension circuits available, including temperature sensors and a variety of other sensor and controller circuits.
I also noticed a variety of genuine arduino main boards and clones available. What are the functional differences. Which is more versatile? Which are more functional.

Considering how this community has grown in the last year or so, has anyone else had experience with the use of this interface?
Any other thoughts?
John
"The exact contrary of what is generally believed is often the truth" Jean De La Bruyère (1645-1696)
User avatar
BaboonScience
 
Posts: 3629
Joined: Fri Mar 02, 2007 8:47 pm
Location: High Shoals

Re: Making a USB Temperature Sensor, Journal

Postby robvdv » Sun Feb 07, 2010 3:56 pm

I've been playing around with my MAKE controller today. I want to use it to control my greenhouse, so I presume I'll have a number of the challenges you have.

Tagging along with interest :)
User avatar
robvdv
 
Posts: 96
Joined: Mon Apr 21, 2008 12:43 am
Location: Cape Town, South Africa

Re: Making a USB Temperature Sensor, Journal

Postby SirLeech » Tue Jul 20, 2010 4:00 am

This post has been extended to my Wordpress blog:

1) Original Post as Above, with additions
http://sirleech.wordpress.com/2010/06/0 ... and-lm335/

2) Pachube Temperature Logging to Web with EthernetShield
http://sirleech.wordpress.com/2010/06/2 ... sor-build/
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Re: Making a USB Temperature Sensor, Journal

Postby SirLeech » Fri Nov 19, 2010 5:47 pm

Hi All, back after a while. Good to see the forum is still growing strong and the redesign looks good.

"I remember this thread from the past about the Arduino USB interfaced controller.
I finally have a use and need to figure this one out. There are quite a few add ons and extension circuits available, including temperature sensors and a variety of other sensor and controller circuits.
I also noticed a variety of genuine arduino main boards and clones available. What are the functional differences. Which is more versatile? Which are more functional.

Considering how this community has grown in the last year or so, has anyone else had experience with the use of this interface?
Any other thoughts?


John,

Arduino Clones are mean't to be exact copies of the Arduino Duemilanove and Mega, and sometimes include extras such as wireless communications and SD card slots. There are indeed lot's of sensors you can hook up to the Arduino and outputs such as relays you can drive to control your pumps and heaters.

For reference here is a selection of clones and official boards from my website:
http://www.australianrobotics.com.au/?q ... ibleBoards

Another interesting "shield" for the Arduino is the Ethernet Shield-- it allows your temperature readings to be posted to the internet via HTTP or act as a web server and serve live sensor feeds, or a form to control the Arduino's outputs.

Here is my live air temperature feed from Canberra, an Arduino with Ethernet Shield and LM335 temperature sensor ran outside my house:
http://www.pachube.com/feeds/8281

Image

Happy to talk more about Arduino used in Mariculture Automation!
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Re: Making a USB Temperature Sensor, Journal

Postby spawner » Fri Nov 19, 2010 8:43 pm

This is great. But can you make one for Salinity as well?
User avatar
spawner
 
Posts: 1610
Joined: Mon Mar 05, 2007 8:28 am

Re: Making a USB Temperature Sensor, Journal

Postby BaboonScience » Sat Nov 20, 2010 1:59 am

All, thanks for the response.
I also have a greenhouse full of water.

Yes, I was considering using a thermistor as a submersible sensor but a LM317 sensor properly insulated and attached to the outside glass of one of my growout tanks might serve the purpose without actually getting into wet electronics. I might even be able to attach sensors to several tanks to monitor temperature variations within the system.

I was also considering which circuit would be best for driving 200 - 500 watt heaters. The idea is to minimize power deain while maximizing the temperature control. It is not very efficient for all heating units to come on all at once when only 200 or 300 watts is necessary. Pulsing power to a few units might be better as well.

The ethernet shield would help communicate with a remote control computer. I am planning to use an old Mac G4 to drive and monitor the system.

John
"The exact contrary of what is generally believed is often the truth" Jean De La Bruyère (1645-1696)
User avatar
BaboonScience
 
Posts: 3629
Joined: Fri Mar 02, 2007 8:47 pm
Location: High Shoals

Re: Making a USB Temperature Sensor, Journal

Postby BaboonScience » Sat Nov 20, 2010 2:04 am

Andy
I would guess that a conductivity probe could work well to monitor salinity. These probes are relatively easy to make from small pieces of platinum wire (an old chlorine titration probe or something has plenty of platinum wire. Two pieces spaced about a cm apart would provide a good gap for low voltage jump from wire to wire. They could be sealed into a short piece of small diameter tubing if I am not mistaken. The platinum would be soldered to copper leads to complete the run to a A/D converter.

Someone correct me if I have this wrong.
John
"The exact contrary of what is generally believed is often the truth" Jean De La Bruyère (1645-1696)
User avatar
BaboonScience
 
Posts: 3629
Joined: Fri Mar 02, 2007 8:47 pm
Location: High Shoals

Re: Making a USB Temperature Sensor, Journal

Postby SirLeech » Sat Nov 20, 2010 3:00 am

Regarding Salinity measurements, the Aquamedic Controller seems to measure both Conductivity and Density:

http://www.aquamedic.pl/at/AT%20Control-e.pdf

(page 31 talks about this.)

Regarding a circuit to drive heaters, sounds like you need to switch some heavy duty relays for the heaters. With the Arduino you can use a transistor array to switch 12v which can be used to switch larger 120v mains relays (that are operated by 12v). Here is a schematic I followed to do just this:

http://www.arduino.cc/playground/upload ... relays.pdf
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Re: Making a USB Temperature Sensor, Journal

Postby PaulG » Sat Nov 20, 2010 4:10 am

Rather than going to the lengths of an overly complicated circuit... you could have a look at these.....

http://www.littlebirdelectronics.com/pr ... 18B20.html

That is what I'm using (going to, just need the time to build it out) for internal & external fishroom temperature.
User avatar
PaulG
 
Posts: 1127
Joined: Thu Oct 18, 2007 5:44 am

Re: Making a USB Temperature Sensor, Journal

Postby SirLeech » Sat Nov 20, 2010 10:40 am

Paul- Yes an easy to use sensor indeed! I'm also a fan of the SHT1x line of Temperature and Humidity sensors that output a digital signal, here is one that we stock:
http://www.australianrobotics.com.au/?q=node/31

But perhaps to get this post on to more productive discussions, can I raise some questions to the group regarding automation in mariculture? I'll throw some out:

1) We've already seen the possibilities of marine breeding automation using microcontrollers in the previous posts. However, is automation desired, or even needed in marine breeding? Does it over complicate things or add an extra expense?

2)If so what aspects need controlling and would benefit from digital/computerised controls? Can we narrow down some "Easy wins" to target possible systems to be developed?

3) Can microcontrollers combined with communication tech's (SMS,Email, Web) help with disaster prevention and early warnings? Does anyone have disaster stories that could have been prevented by "smart" monitors? (e.g. a SMS that is sent when water flow is stopped to your main growout system? or heaters fail in a cold climate?)
User avatar
SirLeech
 
Posts: 33
Joined: Thu Nov 27, 2008 4:40 pm
Location: Canberra, Australia

Re: Making a USB Temperature Sensor, Journal

Postby kswaby10 » Thu Dec 02, 2010 1:26 am

SirLeech wrote:This post has been extended to my Wordpress blog:

1) Original Post as Above, with additions
http://sirleech.wordpress.com/2010/06/0 ... and-lm335/

2) Pachube Temperature Logging to Web with EthernetShield
http://sirleech.wordpress.com/2010/06/2 ... sor-build/


Nice blog you have there. You should get your own domain name though.
kswaby10
 
Posts: 1
Joined: Thu Dec 02, 2010 1:17 am

Re: Making a USB Temperature Sensor, Journal

Postby oemtds » Sun May 29, 2011 11:27 pm

If youre looking for a conductivity sensor that will provide output to ardunio , here is one that works.
http://webpages.charter.net/tdsmeter/conductivity.html
oemtds
 
Posts: 1
Joined: Sun May 29, 2011 11:24 pm

Re: Making a USB Temperature Sensor, Journal

Postby BaboonScience » Mon May 30, 2011 10:37 pm

That looks Great! Just what I have been looking for.
Can you provide a link to a source. eBay or other.
Thanks John
"The exact contrary of what is generally believed is often the truth" Jean De La Bruyère (1645-1696)
User avatar
BaboonScience
 
Posts: 3629
Joined: Fri Mar 02, 2007 8:47 pm
Location: High Shoals


Return to Equipment



Who is online

Users browsing this forum: No registered users and 0 guests