Mood Cue: a Scientific Temperature- Mood- Correlation
by TechMartian in Circuits > Arduino
1523 Views, 3 Favorites, 0 Comments
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.
BoM
* Arduino
* Servo motor
* Temperature sensor - TMP36
* Popsicle
* Box
Tools
* Blade
* Glue gun and Glue sticks
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.
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.
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.
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.
Coding and Uploading
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); }