Go Down

Topic: Getting graphical output from a temperature sensor (Read 3622 times) previous topic - next topic

copjohn

Hi rbright PLX.DAQ would be the easiest way to go but getting a copy of Excel 2007 or earlier is nigh on impossible.
I haven't had any success with LiveGraph forum as the SourceForge site has been down for the last few days, and your right the amount of information on LiveGraph is sadly lacking and the manual gives even less information.

rockwallaby

Do you by chance have an Ethernet shield or an Ether-Ten or access to one ?
I'm really thinking that to do what you would like would be better with a board that has an Ethernet port.
IF you do, then it opens up the possibility to have the Arduino as web server or being able to connect to the internet to push data to a host site.

The other option is to use the 'Processing' language to connect to your Arduino via the USB port and have a small program made up in 'processing' that will do your plotting. I don't use Processing, but many others do and the Arduino environment originally came from this Processing environment.

Another option might be to use Python with the PySerial and do things that way. Robin2 is good with all things Python I believe.

Food for thinking :)

What is your timeline in terms of when is the due date for your daughters presentation ?
____
Paul
Paul - VK7KPA

copjohn

Hi Paul I have been playing with LiveGraph and CoolTerm and have found it possible to record data directly from the Uno board to LiveGraph in real time. My next quest is to daisychain 3 DS18B20 sensors together and record this in real time.

rockwallaby

Good to hear you have made some progress.
If you have trouble with having the additional temperature sensors incorporated into the code, then post your code thus far and I'm sure we can help.

How are you going with project completion date ?
____
Paul
Paul - VK7KPA

copjohn

Hi Paul There are only two problems left to overcome and this is probaly not the right place to do it so if you can suggest which forum to use that would be great.
The problems I have are:-
1. The 3 Values need to be seperated into individual C.S.V i.e 20.25, 16.24, 17.34,
Code: [Select]

/* Basic 2xDS18B20 code for serial monitor, bluetooth, Excel or w.h.y.
Derived from Hacktronics. Use their address sniffer and substitute your
numbers. Use Hacktronics connections diagram. \
Resolution is 12bit by default, prints to two decimal places
Stay away from using parasite power
 85 means you haven't gotten a read yet, probably wrong order of commands
-127C means bad connection
*/

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 3

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// Assign the addresses of your 1-Wire temp sensors.
byte Thermo1[8] = {0x28, 0xBC, 0xBF, 0xE9, 0x03, 0x00, 0x00, 0x7A};
byte Thermo2[8] = {0x28, 0x09, 0xA9, 0xC0, 0x03, 0x00, 0x00, 0x95};
byte Thermo3[8] = {0x25, 0x04, 0xBC, 0xC7, 0x03, 0x00, 0x00, 0x85};

float Temp, Temp1, Temp2, Temp3;

void setup() {
  Serial.begin(9600);
  sensors.begin();
  delay(750);//Wait for newly restarted system to stabilize
}

void loop() {
  sensors.requestTemperatures();  // call readings from the addresses
  Temp1 = sensorValue(Thermo1);
  Temp2 = sensorValue(Thermo2);
  Temp3 = sensorValue(Thermo3);


  Serial.print(Thermo1);
  Serial.print(Thermo2);
  Serial.print(Thermo3);
  Serial.println(",");


  delay(10000);
}

//sensorValue function
float sensorValue (byte deviceAddress[])
{
  Temp = sensors.getTempC (deviceAddress);
}



2. I need one of the temp sensors to not only record the temp but to also turn on and off a relay to control a heating device.

If you can just point me in the right direction I should be able to work it out


rockwallaby

#20
Jul 23, 2015, 04:51 pm Last Edit: Jul 23, 2015, 04:57 pm by rockwallaby
I quickly put together a small program that I hope will get you closer to what you need.
It should print out to your serial port as CSV format and also, it should control an output to which you can connect a relay for heating.

I haven't tested it, but it compiles fine in Eclipse.

You will need to either copy and paste the code or rename the file from copjohn.cpp to copjohn.ino

In the code, there are notes at the beginning to give you more information and the code is documented and is kept simple with no special tricks.

Attached is a PDF of the code as well from Eclipse, which may appear neater. I use tabs as my delimiter, not spaces, so the neatness of indentation and comments will be spoilt if you import into Arduino IDE, which uses spaces.
____
Paul
Paul - VK7KPA

copjohn

Thank you Paul I'ii give them a go. My daughter's presentation is on the 30th August so got a little bit more time than I thought to get this right. :)

rockwallaby

It was late at night when I put that together and missed a few lines of code, hence an update :)
____
Paul
Paul - VK7KPA

copjohn

Thanks Paul Downloaded first program seems to be working well. I getting 3 temperature outputs in real time, putting together the relay circuit today to see how that works. :)

rockwallaby

Good to hear.
Just noticed this project which may offer you another alternative to graphing.
Enhanced Serial Monitor - Version 3.1
I only read the first few posts to see it's features.
It is windows application only.
____
Paul
Paul - VK7KPA

Go Up