edge lab LIVE! starts Tuesday in Munich. Grab a workshop seat and take home the board you build on. Code FRIEND-HACKSTER saves 20%. () Learn more!
shotsphere
Published © CC BY

Wireless Thermometer

Using twos xbees and a tmp36, the temperature of a room can be wirelessly sent to my computer.

IntermediateFull instructions provided560
Wireless Thermometer

Things used in this project

Hardware components

Temperature Sensor
Temperature Sensor
×1
Battery, 9 V
Battery, 9 V
×1
SparkFun XBee Explorer Dongle
SparkFun Electronics SparkFun XBee Explorer Dongle
×1
SparkFun XBee Shield
SparkFun Electronics SparkFun XBee Shield
×1
WROOMBEE -  ESP32 WROOM Xbee form factor
EngeBOT Technology WROOMBEE - ESP32 WROOM Xbee form factor
×2
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

temperature_tmp36fritz_wNYivmVsNH.gif

Code

Wireless Thermometer Code

Arduino
//Project 49 - Building a Remote Control Thermometer

char a;
float voltage=0;
float sensor=0;
float celsius=0;
float fahrenheit=0;
float photocell=0;

void setup() {
  Serial.begin(9600);
}

void sendC()
{
  sensor=analogRead(0);
  voltage=((sensor*5000)/1024);
  voltage=voltage-500;
  celsius=voltage/10;
  Serial.println(" ");
  Serial.print("Temperature: ");
  Serial.print(celsius,2);
  Serial.println(" degrees C");
}

void sendF()
{
  sensor=analogRead(0);
  voltage=((sensor*5000)/1024);
  voltage=voltage-500;
  celsius=voltage/10;
  fahrenheit=((celsius*1.8)+32);
  Serial.println(" ");
  Serial.print("Temperature: ");
  Serial.print(fahrenheit,2);
  Serial.println(" degrees F");
}

void getCommand()
{
  Serial.flush();
  while (Serial.available() == 0)
  {
    //do nothing
  }
  while (Serial.available() > 0)
  {
    a = Serial.read(); //read the number in the serial buffer
  }
}

void loop() {
  getCommand(); //listen for command from PC
  switch (a)
  {
    case 'c':
    //send temperature in Celsius
      sendC();
      break;
    case 'f':
      //send temperature in Fahrenheit
      sendF();
      break;
  }
}

Credits

shotsphere
0 projects • 0 followers

Comments