Introduction: Automatic Hand Cream Machine

Covid-19 known as a serious pandemic that spread over the globe right now. During the epidemic prevention period, people should wear the face mask and clean their hands constantly with water and soap or alcoholic-rub in order to prevent the infections of the virus. Since we wash our hands too often, your skin may dry out or damage. As a result, we should take some moisturizing lotion (hand cream) to reduce the possibility of getting too dry. This machine has the function to remind people to take some hand cream after washing hand. It will remind by using the alarm red light after it senses the hands to take a tissue paper for wipe dry. Also, when your hands get closer to the lotion, it can automatically press the right amount of lotion for you to The details of the machine will be explained below.

How does it works:

This machine can be divided into two parts: Reminders and Auto induction hand cream machine. Since this machine can remind people to get hand cream after washing hands. The induction will be located near the box of tissues paper so that whenever people get one tissue paper to dry out their hands the machine will remind the person to get some hand cream after that. It involves the ultrasonic sensor that can measure the distance of an object. When the object (hands) are close to the sensors, the sensors will generate the red LED bulbs which can remind the person to get some hand cream.

The part of the automatic induction machine involves ultrasonic sensor to measure the distance of hands. When the hands are close to the sensors, it will generate the servo motor, which presses the bottom of the hand cream bottle and give the right amount of hand cream on hands.

If you are not sure about the description above, please watch the video to make sure you understand how the machine functions. Further, the required materials and procedure will be explained in the next steps.

Step 1: Materials

Circuit

  • Arduino Leonardo or equivalent *1
  • Bread Board *1
  • USB cable *1
  • LED Light bulb *2 (red *1 and green *1)
  • 220-ohm Resistor *2
  • Wires
  • Alligator clips with wires *4 (Buy Here!)
  • Servo Motor *1 (Buy Here!)
  • Ultrasonic sensor *2 (Buy Here!)

Machine

  • Iron wires or riband ( any lines that can support strong pulling strength and without elasticity)
  • Cardboards for cover the pump of the bottle (size would be customized since each bottle has different size)
  • A base for the bottle and motor to stick on (size should be customized since each bottle has different size) (I used the laptop suitcase for my base since it already has the holes on it)
  • Small cardboard (the part that used to press the pump that squeezes the hand cream)
  • Tape (stick the bottle, iron wires, and motor stably)
  • A hand cream bottle with a pump

Container and tools

  • Cardboard (make the container) (the size should be customized since the size of the bottle are different)
  • A half of shoebox (half of the container) (look at the image above to have a clear understanding)
  • Scissor and utility knife
  • Ruler
  • Pencil
  • Cutting mat
  • Paints (any color you want)
  • Painting brushes (a big and small one for coloring different area)
  • Tape
  • Hot-melt adhesive

Most of the circuit materials can buy from:

Reminders: The size of the cardboard, base, and shoebox will be given in further steps. However, the size of each cardboard, shoebox, and base should be customized since the height, width, and length of the bottle are different (using different types of the bottle) As long as the cardboard fits the size of the bottle then it is fine to use.

Step 2: Arduino Code

Copy the code here.

The code can slipt into three portions: set up, reminder, and automatic induction hand cream.

Set up

The code from these sequences should not be modified since it set up the information of each tool that is given including servo motor, ultrasonic sensor, and LED.

The only part that can be changed with reason is in line 21. The pin of the servo motor can be modified with the circuit that you use. As long as the circuit and the code have the same pin, the code will work.

#include <Servo.h>

int UltrasonicSensorCM(int trigPin, int echoPin) // Ultrasonic Sensor
{
  long duration; 
  pinMode(trigPin, OUTPUT); // set up trigPin and echoPin of ultrasonic sensor
  pinMode(echoPin, INPUT);  
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(20);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  duration = duration / 59;

  if ((duration < 2) || (duration > 200)) return false;
  return duration;
  // maximum of ultransonic sensor
}

Servo servo_pin_3; // set up servo for pin 3

// Anything above this line should not be modify since it 
// sets up the basic info for servo motor, ultransonic sensor, and other tools
////////////////////////////////////////////////////

void setup() { 
  digitalWrite( 6 , LOW );
  digitalWrite( 7 , LOW );
  digitalWrite( 8 , LOW );
  digitalWrite( 9 , LOW ); 
  //set up trigPin and echoPin of the two ultrasonic sensor
  // pin 6, 7 --> first sensor (sensor the hands that get tissues)
  // pin 8, 9 --> second sesor (sensor the hands for the hand cream)
  
  pinMode( 12 , OUTPUT);   // sets the digital pin as output (for servo motor)
  pinMode( 11 , OUTPUT);   // sets the digital pin as output (for servo motor)
  servo_pin_3.attach ( 3 );   // servo pin is attach to pin 3

}<br>

Reminder

The part of the reminder includes the first ultrasonic sensor and the red blinking LED. From line 43 to line 67, it shows how ultrasonic sensor and LED work together to create the reminders. The ultrasonic sensor is connected to pin 5 and pin 6 (Pin 5 for echo and Pin 6 for trig). When the distance it sensors is lower than 8 cm, the red LED will blink 5 times to remind the person who takes a tissue after washing hand to get some hand cream after it. The distance "8 cm" can be modified with the distance that you prefer between the hand and sensor. It is free to adjust, however, the greater the number the higher the possibility that it detects the wrong object. For instance, when the distance it detects is more than 20 cm, it can detect the person that passes by 20 centimetres around it. Therefore, the maximum of the distance should not be greater than 10 cm.

The repetition of LED blink can also be adjusted through line 53.

  if (  UltrasonicSensorCM( 6 , 7 ) < 8 ) {
    delay( 3000 );
  // the first ultrasonic sensor
  // the number "8" can be modified to change the sensitivity of the ultrasonic sensor
  // the lower the numbers, the closer the object should be to the sensor for it to sensor it
  // the numbers for "delay" can also be modified which can change the speed of the machine 
  // that it reacts when the object get close to the sensor
  
    for (int i = 0 ; i < 5  ; ++i ) { // repeat the LED blink five times
  // repetition of the set of code below (blinking LED)
  
      digitalWrite( 11 , HIGH );  // sets the digital pin ( red LED ) ON
      delay( 400 ); 
      digitalWrite( 11 , LOW );  // sets the digital pin ( red LED ) OFF
      delay( 400 );
    }
    delay(1000);
    }

  else  {
    digitalWrite( 11 , LOW );  // sets the digital pin ( red LED ) OFF
    delay( 100 ); 
    }<br>

Automatic induction hand cream

The portions of automatic induction hand cream include the second ultrasonic sensor, servo motor, and green LED. From line 69 to line 100 it shows how does the ultrasonic sensor activate the servo motor and the LED. The ultrasonic sensor in this portion is used to detect the distance of hands with the bottle. When the distance is lower than 4 cm, the sensor will activate the servo motor that use the iron wires to pull down the bottom of the bottle which squeeze the hand cream out. After the motor activated, the green LED blinks which means the procedure is done. This portion is similar to the previous portion, the distance that the ultrasonic sensor detects and the speed that the machine operated can be altered. The number of times the LED blink can also be modified.

  if (  UltrasonicSensorCM( 8 , 9 ) < 4 ) {
    delay( 1000 );
  // second ultrasonic sensor
  // the numbers after "<" which is 4 can be modified to change 
  // the strength of the sensitivity of the ultrasonic sensor
  // the lower the numbers, the closer the object should be to the sensor for it to sensor it
  // the numbers for "delay" can also be modified which can change the speed of the machine 
  // that it reacts when the object get close to the sensor

    servo_pin_3.write( -110 ); // tell servo to turn 110˚ clockwise
    delay( 1000 ); // the time of delay can be modified to change the speed of the machine
    servo_pin_3.write( 110 ); // tell servo to turn 110˚ anticlockwise
    delay( 1000 ); // the time of delay can be modified to change the speed of the machine
    
    // the part for servo motor to press the bottom
    // the angles the motor turn can be modified to change the strength of the motor
    // the larger the angles, the greater the strength it has
    // the greater the strength, the greater the amount of hand cream will be squeezed out
    
    // the angles should not be more than 180˚ since it could cause problem to the motor
    // and the iron wires that are connected on the servo motor
    ///////////////////////////////////////////////////////////
    
    digitalWrite( 12 , HIGH ); // sets the digital pin (green LED) ON
    delay( 400 );
    digitalWrite( 12 , LOW ); // sets the digital pin (green LED) OFF
    delay( 400 );
    digitalWrite( 12 , HIGH ); // sets the digital pin (green LED) ON                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      V
    delay( 3000 );
    digitalWrite( 12 , LOW ); // sets the digital pin (green LED) OFF
    delay( 2000 ); // the time of delay can be modified to change the time that the LED blink
  }<br>

Reminders: You should verify the code first every time before you upload your code to the board. Otherwise, it may cause some serious consequences to your board, laptop (or power source), servo motor, and ultrasonic sensors.

Step 3: Circuit

After the code is done, the circuit should be build up. Make sure the pin of each wire is the same as the pin that is written in the code. The circuit can be divided into 3 portions: ultrasonic sensors, red and green LED light bulbs, and servo motor.

Ultrasonic sensors

First ultrasonic sensor

  • UCC --> Positive pole (+)
  • Trig --> DPin 5
  • Echo --> DPin 6
  • GND --> Negative (-)

Second sensors

  • UCC --> Positive (+)
  • Trig --> DPin 7
  • Echo --> DPin 8
  • GND --> Negative (-)

LED light Bulbs

Red LED

  • Positive --> DPin 12
  • Negative --> resistor --> negative

Green LED

  • Positive --> DPin 11
  • Negative --> Resistor --> negative

Servo motor

Black wire --> Negative

Red wire --> Positive

Yellow --> DPin 3

Other

  • Positive --> V5
  • Negative --> GND

Reminders: use the different colors of wires to show the different portions of the wires. For example, all GND or negative use black wires and all Positive uses red wires.

Step 4: Part 1: Hand Cream Machine

The hand cream machine is the most difficult part of this machine. The steps will be shown in below.

  1. Measure the length and width of the bottle. (Ex: 7 cm x 5 cm)
  2. Place the bottle in the middle of the cardboard and draw a rectangle on the cardboard with the edge of the bottle. (shown in figure 1)
  3. Cut the cardboard so the cardboard can surround the bottle. (Figure 1 and 2)
  4. Stick the bottle with cardboard on another cardboard that is bigger than the original (the size is not rigid) (Figure 3)
  5. Place the cardboard with the bottle in the middle of the base (Figure 4)
  6. Place the servo motor next to the bottle with some space between (at most 10 cm) (Figure 4)
  7. Use the riband to fix the motor on the base. (Figure 5)
  8. Measure the height of the bottle. (Figure 6)
  9. Before deciding the length of the iron wires, look at the last image and the video to make sure you understand how does it work.
  10. Cut the length of iron wires with similar length as the height of the bottle.
  11. Tie one side of the iron wire to the servo motor. (Figure 5)
  12. Take the small cardboard and poke two holes on the opposite sides of the cardboard. (Figure 7)
  13. Fix another end of the iron wire to the hole of the small cardboard. (Figure 7)
  14. Take another iron wires and fixed one side of it to the base and another side to the small cardboard.
  15. Place the small cardboard at the bottom of the bottle and use tape to stick it tightly. (Figure 8)
  16. Congratulations! You're done with the hand cream machine!

Step 5: Part 2: Container Design

The container design is shown in several steps below:

  1. Before starting to cut the cardboard, measure the length and width of the base and the height of the entire machine. (Mine is 33 cm x 23 cm x 28 cm :L x W x H)
  2. Cut 2 cardboard that has the same measurement. (Mine is 33 cm x 10 cm) (Shown in the middle of the first image) The two cardboards are going to build the red portion in figure 4.
  3. Cut 2 cardboard that has the same measurement but different than the second step. (Mine is 33 cm x 13 cm) (Shown in the right-hand side of the first image) The two cardboard is going to make the side of the larger part of the container.
  4. Cut 1 cardboard that will be the back of the container. (Mine is 33 cm x 18 cm)
  5. Stick the two cardboard from step two by using the hot glue gun (it will form a rectangular which is shown in figure 6)
  6. Wait for the glue to dry out otherwise the shape may be damaged.
  7. Stick the two cardboard that is cut in step three beside the two shorter sides of the rectangular that you create in the previous step.
  8. Wait for the glue to dry out.
  9. Stick the last cardboard (the cardboard from step 4) to the middle back of the container.
  10. To here, the shape of the container would be like the back part in figure 3.
  11. The shoebox will be the black portion that's shown in figure 4.
  12. The container that you made and the shoe box is shown in figure 3.
  13. Measure the size of the ultrasonic sensor (4cm x 2 cm), the two LED (1 cm x 1 cm), and the bottom of the bottle (3 cm x 1 cm).
  14. Draw the rectangles on the shoe box. Draw at the place that you would like it to be.
  15. Cut the rectangles out to become four holes. (Shown in figure 3) Also, cut the hole for the USB cable to go through at the smaller portion of the container. (Shown in figure 10)
  16. LED should be placed at the top of the box so it could be easier to see.
  17. Color the container (both shoebox and container).
  18. Congratulations! The container is done!

Step 6: Combine the Machine With the Container

The final few steps then you're done!

  1. Place the machine inside the container with the Arduino board in the smaller portion of the container and the bottle in the larger portion of the container.
  2. Stick the ultrasonic sensors, LED, and the bottom of the hand cream to the holes that you cut. (Make sure the size of the hole allows the bottom to press down)\
  3. Since the LED light bulb may be too short to reach the holes, use alligator clip with wires to extend the wires.
  4. Do not mess up the two sensors (one is for detecting hand for tissue and one is for detecting the hands for hand cream)
  5. Put the two half of the container together which unable to see the inside of the container and machine.
  6. Take out the USB cable to plunge in into the power source (from the laptop).
  7. Make sure the machine works well.
  8. Congratulation! you are done with the entire machine!!!

Step 7: Final Work

Put the machine with a tissue box or container next to the sink so everytime after you wash your hand you can use it without touching the bottom of the hand cream and protect your hands from dry out.

As you can see, the procedure for making this machine is quite complicated. Please share your work below if you made this machine and use it. Also, if you have any question about the machine, the comment is open for you guys!

Thank you for reading through the entire article to here, I appreciated it!