View Single Post
Old 12-11-10, 01:14 AM   #15
strider3700
Master EcoRenovator
 
Join Date: Dec 2008
Location: Vancouver Island BC
Posts: 745
Thanks: 23
Thanked 37 Times in 30 Posts
Default

Quote:
Originally Posted by AC_Hacker View Post

So, do you think you could help me out with code to read several 1-wire therrmal sensors?
Not a problem. Before I go to bed I'm hoping to have the logging to csv of multiple sensors working. The reading is already there.

Your basic steps are -

first use a breadboard and wire up 1 sensor

Here's a nice page explaining it. Arduino and DS18B20 - 1-wire digital thermometer | Ogalik

on the arduino you'll see VCC and gnd so you plug them in. Pick any of the digital pins you just need to know the number.

Then load the arduino IDE and install the dallas temps and 1 wire library - it's pretty trivial and I can point it out if needed when the time comes, basically just put the correct file from a downloaded zip in the right space.

Then if you grab my code a couple of posts back paste it into the arduino IDE change the pin number at the top to whatever you used and hit compile it should compile with no errors. click upload and then fire up the serial monitor in the arduino IDE and it should tell you the sensors ID and the temperature.

record the ID and label the sensor, repeat till you have ID's for all of them

wire two of them up like in that page I posted and restart the serial monitor. The code will work fine for two with no changes as it currently is. Soon I'll make it work for any number (up to 64 is the limit I think) of sensors without any changes and you'll be good to go.

That will give you data being dumped into the arduino serial monitor. When the java part of the program is finished I'll post it up and you can dump the data to a csv. Or you can grab the code as it currently stands and track down the rxtx library and build it yourself.

As I go whatever I create while working on this project I'll post on here and anyone can take and do whatever with it. Just be forewarned I'm posting where I'm at every couple of days and much of it is far from optimal. I'll hopefully get it pretty by the end but if you grab something now just be aware that it's a very early stage work in progress/proof of concept.

I am hoping that the java code will be good enough in the end to be useful for others that want basic data logging via an arduino. Just have the arduino return the sensor ID and a value and the java program will put that to a csv file.
strider3700 is offline  
The Following User Says Thank You to strider3700 For This Useful Post:
AC_Hacker (12-11-10)