Automatic Doorknob Cleaner
My device is called automatic doorknob cleaner.
The idea is that the device will be attached to above the doorknob, and whenever there are people going in or out of the house, the device will clean the doorknob to ensure you can get a safe experience when you get back home.
The device will be controlled by two inputs:
+ One button on the circuit board to turn on/off the system. Press once to turn on, and one more time to turn off. (a green LED on means system on)
+ A vibration sensor working all the time when battery on, returning LOW signal to the board when a large enough vibration detected, like opening/closing door.
The Arduino will take the signal from the vibration sensor while the device is on (battery on, button pressed), and begin the cleaning.
First, the DC vertical pump in the cup will be turned on for about 1 second to pump a little amount of sanitizer from the cup through tubing onto the knob.
Then, the positional servo will quickly rotate 90 degrees, bringing the arm made from tongue stick with a 360-servo attached with a cut bottle to cover the knob. And after that, the 360 servo will spin, and sweep clean the knob. Image of device below. (sensor is attached far above the device)
Supplies
Total: $54.27
Scavenged cardboard and box can be flexible in size.
Building the Cleaning Cup
*The positions in my drawing are for my door, further measurement and testing can be done for other doors.
1, Measure the diameter of the doorknob, and find a plastic bottle with diameter larger than that of the knob, cut out the bottom part of the plastic bottle with height 5cm.
2, Cut a square cardboard piece with a side the same length with the diameter of the plastic bottle cut.
3, Glue the cardboard piece to the plastic bottle cut.
4, On the open side of the cardboard, find the center and tape the horn to the center, with 2 wings of the horn tightly taped to the cardboard.
5, Tape a tissue’s center to the center of the plastic bottle’s bottom with 2 sided tape, and 4 end of the tissue around the outer side of the plastic bottle. Test to see if the plastic bottle covers the whole knob and spinning can be performed without obstruction.
Set Up the Container and Pump
6, Take a plastic cup/ yogurt cup and tape it to position as described. Set the DC pump inside.
7, Attach tubing to pump like. Since the tube is long, it can be cut or in this case, I can revolve the tube 2 times around the cup and tape the tubing to the cup to reduce the length, then pull the tubing horizontally and vertically down so that its outlet is right above the doorknob. Tape a few times along the path to fix the tubing to the frame.
Make Servo Arm
8, Build the arm for 360 continuous servo. Take a tongue depressor, cut it to 10 cm long like. On one side of the depressor, tape the 360 servo to the end of the stick on all sides so that the main body of the servo stays on the stick. On the other side of the depressor, tape 2 wings of the horn to the other end of the stick as illustrated.
9, Attach the horn and thus, the arm+360 servo to the positional servo.
Make a Structure to Hold the Positional Servo
10, Build the structure to hold the positional servo. Take two tongue depressors, cut the round part on two ends. Set them parallel. On one end of the two sticks, set the positional servo to lay flat in the middle of two sticks. On the other end, fill between 2 sticks with 6 cardboard pieces with dimension 4x1.5x0.2 cm and tape around the pieces and stick.
11, Set the arm to be 90 degrees with the sticks heading downward vertically. While the other end of the stick touches the door, adjust the positional servo along the sticks and the sticks position as well until the bottle cut attached to the 360 servo can cover the doorknob. Fix the servo at that position by taping around the positional servo and the sticks on all sides.
12, Measure the position from the edge of the door to the sticks. Set the sticks to that distance from the frame edge. For example, the distance is 8 cm for my door.
13, Break a depressor into 2 halves, and set the two halves to position, and tape one end of the two sticks to the frame, and the other end together onto the bottom sticks.
Build Circuit
Build the circuit and connect to the Arduino as shown in diagram..
Assembling All Components
14, Set the breadboard, Arduino, and battery spaced out like illustrated, and taped them to the frame. The vibration sensor can be placed at a position above the frame, directly taped to the door for better vibration detection, and less vibration from the device working. (Vibration sensor ‘s sensitivity should be adjusted lower with the switch on the sensor).
15, Tape the whole frame onto the door so that the edge of the frame coincides with the door’s edge, and the plastic bottle cut can cover the knob. Focus is to tape a lot at the top of the frame and a few times on two side left/right of the frame.
Note: Position can be changed depending on size and placement of frame/components.
Upload Code to Arduino
//Press the button on breadboard to turn on/off the system.
//When system on, if vibration sensor detect vibration
//it will send signal to start the process including:
//Run the pump (here is motor) for a moment to pump sanitizer to
//the door handle, then the positional servo will move the arm and
//continous servo to door handle position, covering it with a tissue
//then spin the 360 servo to clean the door handle. Finally,
//reset to original position.
//Green LED on when system on.
const int buttonPin = 2;
int currentState=0; // Current state of the entire system
int buttonState = 0; // current state of the button
int lastButtonState = 1;// previous state of the button
// Include the servo library:
#include <Servo.h>
Servo myservo1;//positional servo
Servo myservo2;//continuous servo
void setup() {
Serial.begin(9600);
pinMode(buttonPin, INPUT);//set button pin 2 to be input
pinMode(9, OUTPUT);//Output to pump
pinMode(4, OUTPUT);//Output to green LED
pinMode(3, INPUT);//Input from vibration sensor
myservo1.attach(10);// attach positional servo to pin 10
myservo1.write(0);//set initial angle to 0
myservo2.attach(11);//attach continuous servo to pin 11
myservo2.writeMicroseconds(1500);//set initial speed to 0
}
void loop() {
// read the pushbutton input pin:
buttonState = digitalRead(buttonPin);
///turn on the loop when pressed and off when pressed once more
if (buttonState != lastButtonState)
{
if (buttonState == HIGH)
{
currentState=!currentState;
}
lastButtonState = buttonState;
}
Serial.println(currentState);
if (currentState == 1){
digitalWrite(4,HIGH);//Turn green LED on if system is on
if (digitalRead(3)== LOW){//Vibration sensor detects vibration
delay(1000); //delay a bit to allow time for closing door
analogWrite(9,150); //Run the pump at 3V
delay(900); // Pump a small amount of sanitixer onto the handle
digitalWrite(9, 0);//stop pump
delay(1000);
myservo1.write(100);//turn servo to 100 degree, bringing the
//arm and continuous servo to door handle position
delay(3000);
myservo2.write(180);//Run the continuous servo to sweep the handle
delay(1000);
myservo2.write(90); //stop servo
delay(1000);
myservo1.write(0);// return arm to original position
}else{
digitalWrite(4,LOW);//Turn green LED off when system off
}
}
}
Operation
- Once fully assembled, load the code to the Arduino.
- Turn on the battery. Check to see if the vibration sensor works by slamming near it to see if there is red light lit up.
- Fill the cup with sanitizing liquid like isopropyl alcohol.
- Press the button to start. If the green LED is on, then the device is on. Press once more time to see if it shut down.
- Keep the device on (green LED on), open then close the door.
- The device should work. If the pumping position or the bottle do not cover the knob, recheck the dimensions.
- If unused for long time, press button to turn off.