Feroz FernandoAndre S. Manurung
Published © GPL3+

Covid Travel Pack

A travel pack that contains most of the tools for daily usage outside house.

IntermediateShowcase (no instructions)6 hours17

Things used in this project

Hardware components

Arduino MKR WiFi 1010
Arduino MKR WiFi 1010
×1
Optocoupler, Transistor Output
Optocoupler, Transistor Output
×3
Tactile Switch, Top Actuated
Tactile Switch, Top Actuated
×2
BOOSTXL-ULN2003 ULN2003A Dual Stepper Motor BoosterPack
Texas Instruments BOOSTXL-ULN2003 ULN2003A Dual Stepper Motor BoosterPack
×1
Stepper Motor
Digilent Stepper Motor
×1
Step-Up Voltage Regulator - 5V
SparkFun Step-Up Voltage Regulator - 5V
×1
Rechargeable Battery, 3.7 V
Rechargeable Battery, 3.7 V
×1
Submersible Mini 5V Pump
×2
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Firebase
Google Firebase
Android Studio
Android Studio
Fusion 360
Autodesk Fusion 360

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Drill / Driver, Cordless
Drill / Driver, Cordless
3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

3D Printed Parts

All files are .STL format and ready to be printed. Recommended setup is 20% infill and 0.2-0.3 mm layer height.

Schematics

Schematics

Schematics for the inside electronics. The arrangement is not strictly have to be the same.

EasyEDA Schematics

Open this using EasyEDA software

Mobile Application

The sample apk used for the projects. If you want to modify you can check the github page

Code

Main Arduino Code

C/C++
Firmware Code
//libraries
#include "Firebase_Arduino_WiFiNINA.h"
#include "ArduinoLowPower.h"
#include "Stepper.h"

//credentials
#define FIREBASE_HOST "XXX"  //your-database.firebaseio.com
#define FIREBASE_AUTH "XXX"  //Firebase Secret Key
#define WIFI_SSID "XXX" //Wi-Fi SSID
#define WIFI_PASSWORD "XXX" //Wi-Fi Password

//pins
#define sw1 0
#define sw2 6
#define sw3 7
#define sw4 8
#define EN 1
#define IN1 2
#define IN2 3
#define IN3 4
#define IN4 5
#define battPin A1
#define pump1 9
#define pump2 10
#define STEPS 2048

//objects
FirebaseData firebaseData;
Stepper stepper(STEPS, IN4, IN2, IN3, IN1);

//variables
bool chamber_start = 0;
int process, batt, hand_cap, chamber_cap;

void setup() {
  //Debugging
  Serial.begin(115200);
  delay(100);
  Serial.println();
  Serial.print("Connecting to Wi-Fi");
  int status = WL_IDLE_STATUS;
  
  //Connect to Wi-Fi
  while (status != WL_CONNECTED && millis() > 10000)
  {
    status = WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
    Serial.print(".");
    delay(300);
  }
  //Provide the authentication data
  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH, WIFI_SSID, WIFI_PASSWORD);
  Firebase.reconnectWiFi(true);
  stepper.setSpeed(10);

  //PinModes
  pinMode (sw1, INPUT_PULLUP);
  pinMode (sw2, INPUT_PULLUP);
  pinMode (sw3, INPUT_PULLUP);
  pinMode (sw4, INPUT_PULLUP);
  pinMode (battPin, INPUT);
  pinMode (pump1, OUTPUT);
  pinMode (pump2, OUTPUT);
  pinMode (EN, OUTPUT); //Motor power

  //Wake Up Functions
  LowPower.attachInterruptWakeup(sw1, closeGripper, LOW); //Trigger while button is pressed
  LowPower.attachInterruptWakeup(sw2, openGripper, LOW);
  LowPower.attachInterruptWakeup(sw3, sanit_hand, FALLING); //Trigger once every button press
  LowPower.attachInterruptWakeup(sw4, sanit_chamber, FALLING);
}

void loop() {
  //For battery readings, we use 2:3 voltage divider
  //Battery's max voltage = 4.2 V, scaled down to 2.8 V for Readings
  //Battery's min voltage = 3.7 V, scaled down to 2.46 V for Readings
  //Battery's max voltage translate to : 860 for 10 bits (2.8/3.3 * 1023)
  //Battery's min voltage translate to : 768 for 10 bits (2.46/3.3 * 1023)
  batt = map( analogRead (battPin), 768, 860, 0, 100 );
  
  if (chamber_start){
    process += 1;
    if (process >= 100){
      process = 0;
      chamber_start = 0;
    }
  }
  digitalWrite (EN,LOW); //Turn off motor if not used
  task();  //Comment this part if no app is used
  LowPower.sleep(2000);
}

//ISR(s)
void closeGripper(){
  digitalWrite (EN,HIGH); //Turn on motor
  stepper.step(-20);
}

void openGripper(){
  digitalWrite (EN,HIGH); //Turn on motor
  stepper.step(20);
}

void sanit_hand(){
  //Dispense for 2 seconds
  digitalWrite (pump1, HIGH);
  delay (2000);
  hand_cap -= 10;
}

void sanit_chamber(){
  //Dispense for 5 seconds
  chamber_start = 1;
  digitalWrite (pump2, HIGH);
  delay (5000);
  chamber_cap -= 30;
}

//Data upload function
void task(){
  String path[4] = {"/batt", "/sanitizer1", "/sanitizer2", "/process"};
  int data[4] = {batt, hand_cap, chamber_cap, process};
  for (uint8_t i = 0; i < 4; i++){
    if (Firebase.setInt(firebaseData, path[i] , data[i]))
    {
      Serial.println("----------Set result-----------");
      Serial.println("PATH: " + firebaseData.dataPath());
      Serial.println("TYPE: " + firebaseData.dataType());
      Serial.print("VALUE: ");
      Serial.println(firebaseData.intData());
    }
    else
    {
      Serial.println("----------Can't set data--------");
      Serial.println("REASON: " + firebaseData.errorReason());
      Serial.println("--------------------------------");
      Serial.println();
    }
  }
}

Mobile Application Source Code

Compile the code using Android Studio and generate an APK. Configure the Firebase credentials according to your database credentials.

Credits

Feroz Fernando

Feroz Fernando

3 projects • 1 follower
Electrical engineering student
Andre S. Manurung

Andre S. Manurung

1 project • 1 follower

Comments

Add projectSign up / Login