Mood Cue: a Scientific Temperature- Mood- Correlation

by TechMartian in Circuits > Arduino

1477 Views, 3 Favorites, 0 Comments

Mood Cue: a Scientific Temperature- Mood- Correlation

UNADJUSTEDNONRAW_thumb_7c0.jpg

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.

BoM

* Arduino

* Servo motor

* Temperature sensor - TMP36

* Popsicle

* Box

Tools

* Blade

* Glue gun and Glue sticks

Making the Pointer

WSKHbwRRR8e1Bnlp8L6SSw_thumb_7ac.jpg
7kYrLUrdQ3OHD606oyqLBw_thumb_7ad.jpg
9fS8e39zQHa2mbAMeyrXww_thumb_7ae.jpg
dMDMz3jYQYecTKUo5mep%A_thumb_7af.jpg
KOBG46w9TO6OnI3pRfVS4A_thumb_7b0.jpg

* 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.

Wiring the Servo

0FmRC7NQSbycqLDPtgBXYA_thumb_7b1.jpg
55wkhnjbRxSI20l7RkRLrA_thumb_7b2.jpg

* 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.

Wiring the Temperature Sensor

wsgqSx1YRDyd01SVZ0Gphg_thumb_7b8.jpg
u7RznCf6T3uUKm6s8JkThQ_thumb_7b9.jpg

* 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.

Enclosing in a Box

UNADJUSTEDNONRAW_thumb_7b6.jpg
B6ThHMBQQQeb70Uob1CNIA_thumb_7b5.jpg
vxJniPWVTxW6Hf%NLwzBgg_thumb_7bb.jpg

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.

Coding and Uploading

Screen Shot 2017-08-20 at 8.45.40 PM.png

Upload the following code to the Arduino.

#include <Servo.h>
const int servo = 9;
const int tempPin = 0;
//raw reading variable
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
 tempVal = analogRead(tempPin);
 //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);
}