49713 Designing for the Internet of Things
· 18 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
How might we create a smart prayer mat that can inform all users (including those that are visually impaired) to find their Qibla direction anywhere in the world?
Write about the big ideas behind your project? What are the goals? Why did you make it? What are your motivations?
I wanted to take on the challenge of designing an IoT object that did not just solve an efficiency need, but played a more significant, albeit nuanced role in the world. As Nansen and Bjorn mention in their article An Internet of Social Things, "It is important to note that objects are part of socio-material networks that impact on human relations- without humans in their networks, their impact is inconsequential, at least to us humans"[1]. I also wanted to design for a social network that is familiar to me that is not usually designed for. My motivation was to bring relevant information to a user in a way that current tactics are either too cumbersome or involve an app. How might we create IoT devices that play a role in spiritual contexts and spaces?
You should be able to clearly what kind of solution are you trying to create and why? How does it address the problem. Explain in as few words as possible.
I am trying to create a smart prayer mat that would notify its user where the Qibla is (direction of the Kaaba in Mecca) so that they could find their direction for prayer wherever they were in the world. Current methods include using an app on your phone to find the Qibla. While this works perfectly, it does take away from the solitude and focus required during prayer by having your phone close by. By designing a prayer may with this functionality embedded, the user could enter the room after abolition and pray without the distractions possible from their phones.
Outline your approach to the project? What ideas did you generate and how did you refine or reject them? What did you research and explore? what were the design choices? What challenges were encountered and how did you resolve them?
I knew I needed a sensor that could mimic a compass for my object. I set out to find one and was recommended the BNO055, which does a lot more than that, it has a " MEMS accelerometer, magnetometer and gyroscope". This enables the sensor to not only give readings of the xyz coordinates relative to the space, but also using the magnetometer enable it to give readings of the direction of the senor relative to Earth, i.e. a compass!
Initially, I had a hard time getting the sensor's output to work on the Particle Console. To resolve the issue, I create a dummy variable to see if the issue was with the code or with the LED light (output). This helped myself and Robbert to figure out where the issue was, and debug it.
After figuring out the sensor, I needed to showcase the putput of when the sensor was in the right direction (Qibla). I decided to use both an LED and a vibration motor to do that. This was done so that people that were also visually impaired could use this device as it would vibrate when they are in the direction of Qibla.
In order to figure out where the Qibla was, I used my phone's Qibla app to figure that out with the sensor right behind it. This enabled me to get the sensor's x variable reading for where the Qibla is exactly. Then, I configured the code to turn on the LED and vibration motor when the x variable is at the Qibla reading (+- 10 degrees).
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_BNO055_Photon.h>
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_Sensor.h>
// This #include statement was automatically added by the Particle IDE.
#include <OneWire.h>
/*************************
Wiring:
BNO055 -> Particle
VIN -> VIN
GND -> GND
SDA -> D0
SCL -> D1
Ported to Particle devices by Nathan Robinson
https://github.com/nrobinson2000
On 2017-1-21
*************************/
//SYSTEM_MODE(MANUAL);
SYSTEM_THREAD(ENABLED);
Adafruit_BNO055 bno = Adafruit_BNO055(55);
uint8_t gyro = 0;
uint8_t accel = 0;
uint8_t mag = 0;
uint8_t sys_val;
int gyro_cloud = 0;
int accel_cloud = 0;
int mag_cloud = 0;
int led = D6;
int A=0;
int vibrator = D4;
double acc_x = 0;
double acc_y = 0;
double acc_z = 0;
void setup()
{
Serial.begin(9600);
Serial.println("Orientation Sensor Test");
Serial.println("");
Particle.variable("Gyro",gyro_cloud);
Particle.variable("Accel",accel_cloud);
Particle.variable("Mag",mag_cloud);
Particle.variable("X", acc_x ); //euler.x());
Particle.variable("Y", acc_y );//euler.y());
Particle.variable("Z", acc_z );//euler.z());
Particle.variable("A",A);
digitalWrite (led,LOW);
digitalWrite (vibrator,LOW);
pinMode (led, OUTPUT);
pinMode (vibrator, OUTPUT);
/* Initialize the sensor */
if(!bno.begin())
{
/* There was a problem detecting the BNO055 ... check your connections */
Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
while(1) ;
}
delay(1000);
bno.setExtCrystalUse(true);
}
void loop()
{
/* Get a new sensor event */
/*sensors_event_t event;
bno.getEvent(&event);
/* Display the floating point data */
/*Serial.print("X: ");
Serial.print(event.orientation.x, 4);
Particle.variable("X", event.orientation.x, INT);
Serial.print("\tY: ");
Serial.print(event.orientation.y, 4);
Serial.print("\tZ: ");
Serial.print(event.orientation.z, 4);
Serial.println("");
/* Display calibration status for each sensor. */
//uint8_t system, gyro, accel, mag = 0;
bno.getCalibration(&sys_val, &gyro, &accel, &mag);
Serial.print("CALIBRATION: Sys=");
Serial.print(sys_val, DEC);
/* Gryo, Accel, Mag Data */
Serial.print(" Gyro=");
Serial.print(gyro, DEC);
//Particle.variable(" Gyro=", gyro, INT);
Serial.print(" Accel=");
Serial.print(accel, DEC);
//Particle.variable(" Accel=", accel, INT);
Serial.print(" Mag=");
Serial.println(mag, DEC);
// Particle.variable(" Mag=", MAG, INT);
if(acc_x < 260 && acc_x >230){
digitalWrite (led,HIGH);
digitalWrite (vibrator, HIGH);
A=1;
}
else
{
digitalWrite (led,LOW);
digitalWrite (vibrator, LOW);
A=2;
}
gyro_cloud = (int)(gyro);
mag_cloud = (int)(mag);
accel_cloud = (int)(accel);
imu::Vector<3> euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);
acc_x = (double) euler.x();
acc_y = (double) euler.y();
acc_z = (double) euler.z();
/* Display the floating point data */
Serial.print("X: ");
Serial.print(euler.x());
//Particle.variable(" X:", euler.x(), INT);
Serial.print(" Y: ");
Serial.print(euler.y());
//Particle.variable(" Y:", euler.y(), INT);
Serial.print(" Z: ");
Serial.print(euler.z());
//Particle.variable(" Z:", euler.z(), INT);
Serial.print("\t\t");
Serial.println();
Serial.println();
delay(500);
}
Click to Expand
Detail what you created. Explain how complete the prototypes is and how it works. Include images, code and/or video.
Circuit components:
- Argon
- BNO055
- LED
- Vibration Motor
- S9015 transistor
- 2 breadboards
- Resistors
- Jumper cables
End result:
I re-purposed a portable prayer mat case to fit in my circuit. When the user turns the case around and reaches the point of Qibla (+-10 degrees), the case lights up and vibrates. The user would then place down the case, and roll out his/her prayer mat in that direction.
What would you do if you took this project forward and why?
My next steps would be to solder all the parts together in a way where they can seamlessly attach to any prayer mat, or integrate it to an existing prayer mat. Furthermore, i would at a location sensor and use the Argon's cloud ability to locate the mat and adjust the Qibla's coordinates so that it gives the right Qibla where ever the user was.
Reflect on the challenges you encountered and the process as a whole. Did you get where you wanted to? If so, great. If not, why not? What do you need to get there, etc?
As my first IoT project, I am quite proud of where the device is at this point. I would have liked to solder the parts and clean up the circuit more so that it wasn't so fragile. I also would have liked to add the location sensor to enable the Qibla to adjust based on location.
Cite any sources, precedents or code that you've used as part of this project or have informed the outcome. References should be integrated into the text above.
BNO055: https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/overview
Initial code for sensor: Ported to Particle devices by Nathan Robinson https://github.com/nrobinson2000
I really could not have executed this project without the help of Professor Daragh Byrne, TAs Taylor, Robbert and Dylan, as well as my neighbor and friend Sisi.
A hands-on introductory course exploring the Internet of Things and connected product experiences.
How might we create a smart prayer mat that can inform all users (including those that are visually impaired) to find their Qibla direction anywhere in the world?
January 30th, 2019