A 3D Printed project that contains some tools that you will need when travelling outside in this times -gripper, sanitizer, and mask chamber- in one packing.
Step One : The 3D PrintingsThe design was made with Autodesk Fusion360. The main part will take form of a box. There are handle, gripper, mask chamber, and a key to lock gripper position without electrical power.
We do some modifications on the design because there are some miscalculations of dimensions post-printing. The size of holes for button, USB port, and pump holes were scaled up compared to the printed product.
Step Two : The ElectronicsKeeping things simple and small is the top priority, so there can be not much room used for electronics. Therefore there are not much electronics used.
Here is the schematic of the electronics created on EasyEDA software.
The Arduino MKR1010 as the main microcontroller will provide Wi-Fi connection to the mobile phone and Firebase.
Two Mini 5V DC Pump will dispense sanitizer to hand and to mask chamber.
One stepper motor + ULN2003 driver will control the movement of the gripper.
Four tactile switches will provide following controls :
- Two switches for turning the gripper CW / CCW
- Two switches to dispense each sanitizer ( to hand and to mask chamber )
- All of the switches will act as external interrupt to wake the MKR1010 from sleep mode to conserve power.
The PC817 Photocouplers will act as a switch to shift signals from Arduino (3.3 V) to motor and pump (5V).
Step-UpModule to shift 3.3 V to 5 V.
Resistors for pulling down signals and voltage divider from battery to scale down the voltage so it can be compatible with MKR1010.
3.7 V Li-Po Battery for the main power source. It should be connected to the MKR1010 JST connector, and can be charged by plugging in a USB to the MKR1010.
Step Three : The Arduino CodeWe used 3 libraries : FirebaseArduino to connect the arduino with firebase, ArduinoLowPower to preserve battery life, and Stepper to control the stepper motor.
//Libraries
#include "Firebase_Arduino_WiFiNINA.h"
#include "ArduinoLowPower.h"
#include "Stepper.h"
Replace the "XXX" your Firebase and WiFi credentials.
//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
On the pins declaration, it doesn't necessarily should be the same. The point is pins for buttons (sw's) have to be external interrupt pins.
//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
We will use internal pull-up resistors from the MKR1010, and assign an interrupt function for each switches.
//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);
LowPower.attachInterruptWakeup(sw2, openGripper, LOW);
LowPower.attachInterruptWakeup(sw3, sanit_hand, FALLING);
LowPower.attachInterruptWakeup(sw4, sanit_chamber, FALLING);
Inside the loop is pretty straightforward, it just uploads data to the Firebase Server, and turn off the motor if it's not used. Also, the time needed to wait for the sanitizer in the chamber to dry out is estimated around 2000 ms * 100 = 200 seconds, or around 3 minutes.
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);
}
For the pump function, it is have been tested that every dispensing process consumes roughly 10% of the total capacity (for hand) and 30% (for the chamber). The reason that specific time (2 seconds and 5 seconds) is used because the pump needs some time before it can get the liquid out from a container to outside, and not instantaneously.
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;
}
The Firebase data upload will be done with single FirebaseData object to change values of 4 paths with 4 values contained in the array.
//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();
}
}
}
The tutorial for creating a Firebase Database can be seen on our other project : https://www.hackster.io/ferozfernando56/low-budget-carriage-robot-9b29d1
Step Four (Optional) : The Mobile ApplicationThe mobile application utilizes the Wi-Fi connectivity of the MKR1010. Its purpose is to show conditions of the travel pack.
As shown above, it is capable of showing the remaining percentage of the sanitizer for hand and the mask chamber. Also, it shows the ongoing process for sanitizing and drying mask inside the chamber.
The app is provided as attachment.
The ResultsBelow is the picture of 3D printed parts and how we assembled it together.
This picture show how the bottom parts of the bottom casing are arranged. Using two small bottles to contain the liquids, and a stepper motor to control the claw.
All electronics are attached with hot glue at the upper casing and with a small dot PCB.
The pack can be used as a handle in public transportations (such as trains, or bus, where we have to stand and hold into something) to avoid touching public handles.
There is also a hand sanitizer dispenser that can be used by pressing button.
Also there is a mask chamber that can be used to store some masks.
Inside the chamber, there is also a process to sanitize the mask using liquid sanitizer. By utilizing the capillarity property of the mask, the sanitizer can be spread throughout the whole mask.
After the liquid sanitizer inside the chamber is released, the user have to wait around 2-3 minutes to wait the sanitizer's alcohol to dry.
The gripper can be used to open doors, and press buttons. It can be opened/closed by pressing the button on the casing.
We hope this simple project can help people to get outside more safely by reducing the touching activity as much as possible. We would very appreciate inputs from the community !
Comments