mostafa
Created July 15, 2020 © MIT

Unoov: Far UVC led based bracelet to fight covid-19

UnooV is a wrist wearable device that uses far UVC leds, that are proven to be safe for human skin, to kill COVID-19.

IntermediateFull instructions provided24
Unoov: Far UVC led based bracelet to fight covid-19

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Far UVC LED
×5
6 DOF Sensor - MPU6050
DFRobot 6 DOF Sensor - MPU6050
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1
anet a8 3d printer
×1

Software apps and online services

Arduino IDE
Arduino IDE
3d builder

Story

Read more

Custom parts and enclosures

3d parts

3d printed parts

3d parts

bracelet

Schematics

UnooV electronic circuit

circuit describing the relationship between the IMU, Arduino and the leds.

Code

UnooV code

Arduino
detecting hand movement and alerting the user with blinking red leds.
#include <Wire.h>

long accelX, accelY, accelZ;
float gForceX, gForceY, gForceZ;
long gyroX, gyroY, gyroZ;
float rotX, rotY, rotZ;

//previous values 
float oldForceX, oldForceY, oldForceZ;
float oldRotX, oldRotY, oldRotZ;
//comparison vars
float valFX, valFY, valFZ;
float valRotx, valRoty, valRotz;
//RGb leds
int red = 3;
int blue = 6;

void setup() {
  pinMode(red, OUTPUT);
  pinMode(blue, OUTPUT);
  Serial.begin(9600);
  Wire.begin();
  setupMPU();
}

void loop() {
    //calibrate: in the following functions store the old data as proccessed 
    recordAccelRegisters();
    recordGyroRegisters();
    processAll();
    //printData();
    //faceAlert();
    delay(500);
}

void setupMPU(){
  Wire.beginTransmission(0b1101000); //This is the I2C address of the MPU (b1101000/b1101001 for AC0 low/high datasheet sec. 9.2)
  Wire.write(0x6B); //Accessing the register 6B - Power Management (Sec. 4.28)
  Wire.write(0b00000000); //Setting SLEEP register to 0. (Required; see Note on p. 9)
  Wire.endTransmission();  
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x1B); //Accessing the register 1B - Gyroscope Configuration (Sec. 4.4) 
  Wire.write(0x00000000); //Setting the gyro to full scale +/- 250deg./s 
  Wire.endTransmission(); 
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x1C); //Accessing the register 1C - Acccelerometer Configuration (Sec. 4.5) 
  Wire.write(0b00000000); //Setting the accel to +/- 2g
  Wire.endTransmission(); 
}

void recordAccelRegisters() {
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x3B); //Starting register for Accel Readings
  Wire.endTransmission();
  Wire.requestFrom(0b1101000,6); //Request Accel Registers (3B - 40)
  while(Wire.available() < 6);
  accelX = Wire.read()<<8|Wire.read(); //Store first two bytes into accelX
  accelY = Wire.read()<<8|Wire.read(); //Store middle two bytes into accelY
  accelZ = Wire.read()<<8|Wire.read(); //Store last two bytes into accelZ
  processAccelData();
}

void processAccelData(){
  oldForceX = accelX / 16384.0;
  oldForceY = accelY / 16384.0; 
  oldForceZ = accelZ / 16384.0;
}

void recordGyroRegisters() {
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x43); //Starting register for Gyro Readings
  Wire.endTransmission();
  Wire.requestFrom(0b1101000,6); //Request Gyro Registers (43 - 48)
  while(Wire.available() < 6);
  gyroX = Wire.read()<<8|Wire.read(); //Store first two bytes into accelX
  gyroY = Wire.read()<<8|Wire.read(); //Store middle two bytes into accelY
  gyroZ = Wire.read()<<8|Wire.read(); //Store last two bytes into accelZ
  processGyroData();
}

void processGyroData() {
  oldRotX = gyroX / 131.0;
  oldRotY = gyroY / 131.0; 
  oldRotZ = gyroZ / 131.0;
}

void printData() {
  /*
  Serial.print("Gyro (deg)");
  Serial.print(" X=");
  Serial.print(oldRotX);
  Serial.print(" Y=");
  Serial.print(oldRotY);
  Serial.print(" Z=");
  Serial.print(oldRotZ);
  Serial.print(" Accel (g)");
  Serial.print(" X=");
  Serial.print(oldForceX);
  Serial.print(" Y=");
  Serial.print(oldForceY);
  Serial.print(" Z=");
  Serial.println(oldForceZ);*/
}

void processAll(){
    //current g force values
    gForceX = accelX / 16384.0;
    gForceY = accelY / 16384.0; 
    gForceZ = accelZ / 16384.0;

    //current rot values
    rotX = gyroX / 131.0;
    rotY = gyroY / 131.0; 
    rotZ = gyroZ / 131.0;
    
    //comparing the two values
    valFX = abs(oldForceX - gForceX);
    /*Serial.print("oldForceX");
    Serial.println(oldForceX);
    Serial.print("gForceX");
    Serial.println(gForceX);
    Serial.println("valx");
    Serial.println(valFX);*/
    
    valFY = abs(oldForceY - gForceY);
    valFZ = abs(oldForceZ - gForceZ);

    valRotx = abs(oldRotX - rotX);
    valRoty = abs(oldRotY - rotY);
    valRotz = abs(oldRotZ - rotZ);
    // array containing the vals  
    int valArray[] = {valFX, valFY, valFZ, valRotx, valRoty, valRotz};
    
    //loop trough them and print the value that has increased by 10 or 20
    /*for(int i =0; i < 6; i++){
      if(valArray[i] > 10){
        Serial.println(valArray[i]);
      }
    }*/
    Serial.print(" Z=");
    Serial.println(oldForceZ);
    if(oldForceZ <= 0.80 && oldForceZ > 0.50){
      faceAlert();
    }else{
      normalRoutine();
    }
}

void faceAlert(){
  Serial.println("face Alert !!!");
  Serial.print(" Z=");
  Serial.println(oldForceZ);
  for (int i = 0; i<6; i++){
    analogWrite(red, 100);
    analogWrite(blue, 0);  
    delay(150);
    digitalWrite(red,HIGH);
    //analogWrite(blue, 0);  
    delay(150);
  }
}
void normalRoutine(){
  analogWrite(red, 100);
  analogWrite(blue, 100);
}

Credits

mostafa

mostafa

1 project • 0 followers

Comments