# Mood Cue: a Scientific Temperature- Mood- Correlation

391

3

Posted

## Introduction: Mood Cue: a Scientific Temperature- Mood- Correlation

There are studies thats show that mood affects the body temperature of a person. This projects uses a temperature sensor to sense the body temperatures of a person and guess the corresponding mood.

## Step 1: BoM

* Arduino

* Servo motor

* Temperature sensor - TMP36

* Popsicle

* Box

Tools

* Glue gun and Glue sticks

## Step 2: Making the Pointer

* Take a popsicle stick and begin shaving down the sides with the blade of an x--acto knife until you get an arrow-like shape. Roughen it up with an x-acto blade to increase surface area for glue bonding.

* Glue this pointer to the servo horn with hot glue.

## Step 3: Wiring the Servo

* Connect the red wire of the servo motor to 5V.

* Connect the black wire of the servo motor to GND.

* Connect the white wire of the servo motor to pin 9 on the Arduino.

## Step 4: Wiring the Temperature Sensor

* Connect the top pin of the sensor to 3.3V.

* Connect the bottom pin of the sensor to ground.

* Connect the middle pin of the sensor to pin A0 on the Arduino.

## Step 5: Enclosing in a Box

Take the lid of a box and tape the Arduino on it securely. Then snake the wires through a notch. Add some paper and draw the different moods from sad to neutral to angry.

Glue the servo to the base of the box with the pointer pointing at neutral.

Upload the following code to the Arduino.

#include <Servo.h>
const int servo = 9;
const int tempPin = 0;
int tempVal;
//voltage variable
float volts;
//final temperature variables
float tempC;
Servo servo1;
void setup() {
// put your setup code here, to run once:
servo1.attach(servo);
}
void loop()
{
//read the temp sensor and store it in tempVal
//converting that reading to voltage by multiplying the reading by 3.3V (voltage of       //the 101 board)
volts = tempVal * 3.3;
volts /= 1023.0;
//calculate temperature˜ celsius from voltage
//equation found on the sensor spec.
tempC = (volts - 0.5) * 100 ;
if (tempC <28)
servo1.write (80);
else if (tempC <30 && tempC > 28)
servo1.write (100);
else if(tempC<36 && tempC>31)
servo1.write(120);

//wait a bit before taking another reading
delay(1000);
}

## Recommendations

• ### Arduino Class

66,444 Enrolled

• ### Pocket-Sized Contest

We have a be nice policy.
Please be positive and constructive.