49713 Designing for the Internet of Things
· 25 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
Found in DIoT 2018 3: Connected Intimacy
An ambient device that enables couples separated by distance to effectively express their emotions and resolve conflicts well in time
Long distance relationships are very difficult to deal with, especially if couples are separated by different time zones. During such scenarios, interpreting emotions like love, longing, conflict etc. is very difficult because the possibility of misinterpreting these emotions is highly likely. Emotions like love and longing have a better chance at being understood the right way but conflict can be extremely misunderstood. Bottling up the emotion of anger is a very common process in couples to avoid uncomfortable situations and this pent up anger grows with time. Ranging from passive aggression to violent aggression, conflict has many layers that couples usually find themselves stuck between and these emotions vary immensely with time. Thus, getting the timing right is extremely important for couples to effectively resolve conflicts.
Due to erratic schedules, couples fail to attend to their angry partners in time which is why LoveLIT aims at giving couples the opportunity to resolve their conflicts just in time, through an IoT device. Following are the top objectives of LoveLIT -
1. To ease the process of communication during conflict so that couples express their anger the right way and in the right time.
2. Provide the recipient with a chance to resolve the conflict.
3. Effectively communicate the emotions by creating a calming environment (through a range of colorful lights).
Additionally, the device aims at giving the recipient of the emotion, a choice to resolve or reciprocate the emotion.
Brainstorming
After setting the goals for the project, we brainstormed the possible solutions and the intention of wanting to transfer two kinds of emotions between couples was established. There are multiple ways to express anger or stress, we thought about a concept of a volcano where the “lava” reflected aggression and anger. In order to simulate the motion of “lava,” we thought about using a fan to blow out orange confetti. In addition to that we wanted to pop-up hearts/roses for love. However, we could not move the servo motor vertically, unless we used the rack and pinion mechanism. We then felt that the volcano failed to reflect love and truce effectively. Drawn from the stress ball concept, we then moved to the idea of expressing anger or stress by squeezing something and we decided to communicate the emotion of love through petting/stroking. Thus, we landed on our final solution for the problem statement: an ambient device that indicates both the message of anger and truce to strengthen the communication between couples separated by distance.
Components and User Experiences
Building from the solution we proposed, we wanted the material of the device to be soft enough to be squeezed and transparent enough to reflect the colored lights. To find the suitable material, we tried different containers to test their softness and transparency. The containers had to be big enough to enclose all the possible components and at the same time had to be aesthetically pleasing. The baby feeding bottles seemed to fit all our criteria perfectly.
Additionally, we felt that couples needed to express their emotion of anger and conflict at the right time to be able to resolve it. People usually refrain from expressing such emotions to avoid discomfort. This leads to them bottling up their feelings which then pent up gradually over time.
Building the Prototype
We first determined that it would be intuitive to express the message of anger by squeezing something which can be identified using a distance sensor. The material we found for containers are two bottles with soft silicone that would be squeezed. After the building the final prototype and the circuit, the code was implemented. For the final model, we realized that when the distance in the container (Device-1) changed while squeezing, the sensor published an event named “DIOT2018-DARAGH-TEAMNINE-SQUEEZE” with its own UUID in the database. Device-2 subscribed to the same event and the Neopixel inside the device flashed orange lights to indicate anger. For instances where the emotions of love or truce are reciprocated, the touch sensor, when touched, triggered the Neopixel inside Device-1 which then flashed breathing pink light to indicate love/truce.
1. When User -1 is angry or stressed, he/she squeezes LoveLIT to express anger to his/her partner. The Ultrasonic Distance Sensor detects the motion and User - 2 experiences intense fluctuation of orange light in his/her device
2. When User - 2 notices the fluctuation, he/she has the option of reciprocating by squeezing back the device (to reciprocate anger) or softly touch the heart on the top of LoveLIT (to express love/truce)
3. The touch cap sensor senses the touch and then User - 1’s device reflects a fluctuating orange (for anger) and a breathing pink (for truce)
The device has the following for scenarios -
User 1 - Anger ---- User 2 - Love
User 1 - Anger ---- User 2 - Anger
User 1 - Love ---- User 2 - Love
User 1 - Love ---- User 2 - Anger
Our team was able to successfully build a working prototype of the device. Following is a list of the parts used, the physical products, the circuit diagram and the code.
Bill of Materials (Circuit):
1. Ultrasonic Distance Sensor X 2
2. Touch Cap Senso (AT42QT1010) X 2
3. Particle Photon X 2
4. Neopixel Ring 24 ct X 2
5. Breadboard X 2
6. Jumper wires
Bill of Materials (Physical Prototype):
1. Squeezable Baby Bottles X 2
// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>
#include <math.h>
#define PIXEL_COUNT 24
#define PIXEL_PIN D6
#define PIXEL_TYPE WS2812B
#define ActiveDot 8 ///actived dot number
const int dotInterv = PIXEL_COUNT/ActiveDot;
#define HEART 239,74,134
#define ANGER 229,42,9
#define USTrig D1
#define USEcho D2
#define TouchPin D4
int SqsTime = 0;
int SqeTime = 0;
float AngerRate = 1;
float HeartRate = 1;
int TosTime = 0;
int ToeTime = 0;
const String prefixEvent = "DIOT-2018-DARA-TEAMNINE";
String SqEvent = prefixEvent + "-SQUEEZE";
String ToEvent = prefixEvent + "-TOUCH";
const String UUID1 = "78a4530b-5553-42eb-b078-42b6b027bb7c";
const String UUID2 = "8ea39ad8-8112-43cf-bbae-3d1595beca9c";
const String SELFID = UUID1;
const String TARGETID = UUID2;
long lastDist = 0;
const int AngerDuration = 36000; //12s
const int HeartDuration = 36000;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
double Cos(String cmd) {
// int cTime = Time.now();
float iCos = cmd.toFloat();
return cos(iCos)*100;
}
int TriggerSQ(String cmd) {
// int cTime = Time.now();
int cTime = millis();
if (ToeTime > cTime){
TosTime = 0;
ToeTime = 0;
}
SqsTime = cTime;
SqeTime = cTime + AngerDuration;
AngerRate = cmd.toInt() * 0.1;
return 1;
}
int TriggerTO(String cmd) {
// int cTime = Time.now();
int cTime = millis();
if (SqeTime > cTime){
SqsTime = 0;
SqeTime = 0;
}
TosTime = cTime;
ToeTime = cTime + HeartDuration;
HeartRate = cmd.toInt() * 0.1;
return 1;
}
int dolight(int R, int G, int B, int sTime, int eTime, float emotionRate, float amp, int lBr, int hBr){
if (sTime == 0 || eTime == 0) { // s or e time undefined
return -2;
}
// int cTime = Time.now();
int cTime = millis();
if (eTime < cTime || sTime > cTime) { // finished or not yet
return -1;
}
float breathCount = ((cTime-sTime) * 0.0001 * amp); //360s = 1 round
// Particle.publish("IOT-PROJECT3-LOG", "BrCount: "+String(breathCount));
float cosCount = cos(breathCount + 3.1415926) * 100.00;
float breathBr = map(cosCount,-100,100,lBr,hBr) * emotionRate;
// Particle.publish("IOT-PROJECT3-LOG", "Br: "+String(breathBr));
strip.setBrightness(breathBr);
for (int i=0;i<PIXEL_COUNT;i+=dotInterv){
strip.setPixelColor(i, R,G,B);
}
strip.show();
return breathCount;
}
void SqHandler(const char *event, const char *data)
{
// int cTime = Time.now();
int cTime = millis();
String sData = String(data);
if (cTime > (SqeTime - 2000)) {
if (sData == TARGETID){
if (ToeTime > cTime){
TosTime = 0;
ToeTime = 0;
}
SqsTime = cTime;
SqeTime = cTime + AngerDuration;
AngerRate = 1;
}
else { //if (sData == SELFID)
if (ToeTime > cTime){
TosTime = 0;
ToeTime = 0;
}
SqsTime = cTime;
SqeTime = cTime + AngerDuration;
AngerRate = 0.1;
}
} else{
Particle.publish("IOT-PROJECT3-LOG", "EVENT-OMITTED-SQ"+sData);
}
}
void ToHandler(const char *event, const char *data)
{
// int cTime = Time.now();
int cTime = millis();
String sData = String(data);
if (cTime > (ToeTime - 2000)) {
if (sData == TARGETID){
if (SqeTime > cTime){
SqsTime = 0;
SqeTime = 0;
}
TosTime = cTime;
ToeTime = cTime + HeartDuration;
HeartRate = 1;
}
else {
if (SqeTime > cTime){
SqsTime = 0;
SqeTime = 0;
}
TosTime = cTime;
ToeTime = cTime + HeartDuration;
HeartRate = 0.1;
}
} else{
Particle.publish("IOT-PROJECT3-LOG", "EVENT-OMITTED-TO"+sData);
}
}
long ReadUS() {
long duration, distance;
digitalWrite(USTrig, LOW); // Added this line
delayMicroseconds(2); // Added this line
digitalWrite(USTrig, HIGH);
delayMicroseconds(10); // Added this line
digitalWrite(USTrig, LOW);
duration = pulseIn(USEcho, HIGH);
distance = (duration/2) / 29.1;
return distance;
}
bool isSqueeze(){
long cDist = ReadUS();
if (lastDist == 0) {
lastDist = cDist;
return FALSE;
}
if (abs(cDist - lastDist) > (max(cDist,lastDist)*0.2)) { //or 2
lastDist = cDist;
return TRUE;
} else {
lastDist = cDist;
return FALSE;
}
return FALSE;
}
bool isTouch(){
if (digitalRead(TouchPin) == HIGH){
delay(200);
if (digitalRead(TouchPin) == HIGH){
return TRUE;
}
}
return FALSE;
}
void setup() {
strip.begin();
strip.setPixelColor(0, 0,100,255);
strip.show();
Particle.function("TriggerSQ", TriggerSQ);
Particle.function("TriggerTO", TriggerTO);
Particle.function("Cos", Cos);
Particle.subscribe(SqEvent, SqHandler);
Particle.subscribe(ToEvent, ToHandler);
pinMode(USTrig, OUTPUT);
pinMode(USEcho, INPUT);
// pinMode(TouchPin, INPUT_PULLUP);
pinMode(TouchPin, INPUT);
}
void loop() {
// int cTime = Time.now();
int cTime = millis();
if (min(SqsTime,TosTime)>cTime || max(SqeTime,ToeTime)<cTime){ // finished or not yet
strip.setBrightness(0);
strip.show();
}
if (SqsTime < cTime && SqeTime > cTime) {
dolight(ANGER,SqsTime,SqeTime,AngerRate,24,5,255);
}
if (TosTime < cTime && ToeTime > cTime) {
dolight(HEART,TosTime,ToeTime,HeartRate,6,5,255);
}
if (isSqueeze()){
Particle.publish(SqEvent,SELFID);
}
if (isTouch()){
Particle.publish(ToEvent,SELFID);
}
delay(100);
}
Click to Expand
As a team, working on a project like LoveLIT was extremely enriching and insightful. We were posed by various challenges and roadblocks and we decided to get over them one by one by exploring various options. Additionally, building a connected intimacy device helped us look further into the range of emotions experienced by couples separated by distance. All in all it has been a very valuable experience for all team members with the following points summarizing the entire journey.
Learnings -
Challenges
Future Scope
A hands-on introductory course exploring the Internet of Things and connected product experiences.
An ambient device that enables couples separated by distance to effectively express their emotions and resolve conflicts well in time
February 12th, 2018