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](/proxy/?url=https://content.instructables.com/FJZ/LKDJ/J6IF6DOX/FJZLKDJJ6IF6DOX.jpg&filename=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](/proxy/?url=https://content.instructables.com/F4B/F88N/J6IF6DPI/F4BF88NJ6IF6DPI.jpg&filename=WSKHbwRRR8e1Bnlp8L6SSw_thumb_7ac.jpg)
![7kYrLUrdQ3OHD606oyqLBw_thumb_7ad.jpg](/proxy/?url=https://content.instructables.com/FB8/KA5V/J6IF6DDY/FB8KA5VJ6IF6DDY.jpg&filename=7kYrLUrdQ3OHD606oyqLBw_thumb_7ad.jpg)
![9fS8e39zQHa2mbAMeyrXww_thumb_7ae.jpg](/proxy/?url=https://content.instructables.com/FHZ/IMU1/J6IF6DEB/FHZIMU1J6IF6DEB.jpg&filename=9fS8e39zQHa2mbAMeyrXww_thumb_7ae.jpg)
![dMDMz3jYQYecTKUo5mep%A_thumb_7af.jpg](/proxy/?url=https://content.instructables.com/FGK/7ZXI/J6IF6DG8/FGK7ZXIJ6IF6DG8.jpg&filename=dMDMz3jYQYecTKUo5mep%A_thumb_7af.jpg)
![KOBG46w9TO6OnI3pRfVS4A_thumb_7b0.jpg](/proxy/?url=https://content.instructables.com/FJ5/ICCH/J6IF6DIF/FJ5ICCHJ6IF6DIF.jpg&filename=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](/proxy/?url=https://content.instructables.com/F2E/34FX/J6IF6DBX/F2E34FXJ6IF6DBX.jpg&filename=0FmRC7NQSbycqLDPtgBXYA_thumb_7b1.jpg)
![55wkhnjbRxSI20l7RkRLrA_thumb_7b2.jpg](/proxy/?url=https://content.instructables.com/F09/Y6YQ/J6IF6DFF/F09Y6YQJ6IF6DFF.jpg&filename=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](/proxy/?url=https://content.instructables.com/FOZ/HZ4S/J6IF6DPF/FOZHZ4SJ6IF6DPF.jpg&filename=wsgqSx1YRDyd01SVZ0Gphg_thumb_7b8.jpg)
![u7RznCf6T3uUKm6s8JkThQ_thumb_7b9.jpg](/proxy/?url=https://content.instructables.com/FPC/Q09N/J6IF6DJO/FPCQ09NJ6IF6DJO.jpg&filename=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](/proxy/?url=https://content.instructables.com/FPL/GQ6X/J6IF6DKW/FPLGQ6XJ6IF6DKW.jpg&filename=UNADJUSTEDNONRAW_thumb_7b6.jpg)
![B6ThHMBQQQeb70Uob1CNIA_thumb_7b5.jpg](/proxy/?url=https://content.instructables.com/FN7/C0FU/J6IF6DG6/FN7C0FUJ6IF6DG6.jpg&filename=B6ThHMBQQQeb70Uob1CNIA_thumb_7b5.jpg)
![vxJniPWVTxW6Hf%NLwzBgg_thumb_7bb.jpg](/proxy/?url=https://content.instructables.com/FZ2/PV00/J6IF6DPE/FZ2PV00J6IF6DPE.jpg&filename=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](/proxy/?url=https://content.instructables.com/FKT/7J95/J6IF6CU3/FKT7J95J6IF6CU3.png&filename=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); }