Pages: [1]   Go Down
Author Topic: Programming Arduino + Ethernet shield to measure temperature  (Read 849 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hi guys,

Is there any program to run the Arduino board and Im in need to get help in programming my board + Ethernet shield in order to take a human temp using a sensor and get it written in a text file and sent to a selected location using the Ethernet shield.

i have some programs but i dont understand them well because im a beginner.

Thanks in advance,
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 45935
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is there any program to run the Arduino board
There are a few...

Quote
Im in need to get help in programming my board + Ethernet shield in order to take a human temp using a sensor
Which sensor?

Quote
and get it written in a text file
A text file implies some file storage mechanism. Where do you propose to store the file?

Quote
sent to a selected location using the Ethernet shield.
Selected by who? How will that selection occur?

Quote
i have some programs but i dont understand them well because im a beginner.
One can be a beginner and still understand what a program does.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is an example in the Ethernet library (called BarometricPressureWebServer) which could act as a starting point for you.

If you are complete beginner to coding/electronics/arduino/Ethernet then I would probably start with measuring the temperature and report that via serial and then add the webserver elements latter.

If you are looking for a temperature sensor something like an LM35 (or similar) would be your best bet.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you guys for replying

im using the sensor AD22103

it does not matter where the data will be stored the important thing is to have them ready and send via the Ethernet shield through radio waves.

for the location im going to be using a tiny tracker to locate the location of the device, and the device will be connected directly to fixed receiver.

i found this code in the net if you guys could check it and let me know if it would work for my project or it would need some editting, here is the code:

----------------------------------------------------------------------------

/*
An open-source LM35DZ Temperature Sensor for Arduino. This project will be enhanced on a regular basis
(cc) by Daniel Spillere Andrade , http://www.danielandrade.net
http://creativecommons.org/license/cc-gpl
*/

int pin = 0; // analog pin
int tempc = 0,tempf=0; // temperature variables
int samples[8]; // variables to make a better precision
int maxi = -100,mini = 100; // to start max/min temperature
int i;

void setup()
{
  Serial.begin(9600); // start serial communication
}

void loop()
{
 
 
for(i = 0;i<=7;i++){ // gets 8 samples of temperature
 
  samples = ( 5.0 * analogRead(pin) * 100.0) / 1024.0;
  tempc = tempc + samples;
  delay(1000);

}

tempc = tempc/8.0; // better precision
tempf = (tempc * 9)/ 5 + 32; // converts to fahrenheit

if(tempc > maxi) {maxi = tempc;} // set max temperature
if(tempc < mini) {mini = tempc;} // set min temperature

Serial.print(tempc,DEC);
Serial.print(" Celsius, ");

Serial.print(tempf,DEC);
Serial.print(" fahrenheit -> ");

Serial.print(maxi,DEC);
Serial.print(" Max, ");
Serial.print(mini,DEC);
Serial.println(" Min");

tempc = 0;

delay(1000); // delay before loop
}





Logged

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not going to provide details right now. But... I have done a similar project with a lot more data than temperature and have it working by sending the data in UDP packets (Ethernet).

So yes. It is a workable project.
Logged

Just another Hacker

Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The code you have provided is for an LM35 temperature sensor. It checks the temperature once a second reports the a sort of moving average temperature and the max/min temperatures detected over the serial connection.

That’s not really what you want. From my understanding you want a user (or server) to request the temperature from the arduino (via Ethernet) and the arduino will report it back.

If that’s the case you simply need a basic Ethernet script (see webserver.pde in the Ethernet library) with an analogread() to get the output of the sensor (and a bit of maths to convert the sensor input into a temperature).
Logged

Pages: [1]   Go Up
Jump to: