Project tutorial

Arduino Soap/Sanitizer Dispenser (overkill version) © GPL3+

Basically an overkill soap dispenser made from CNC linear rail

  • 1,864 views
  • 0 comments
  • 11 respects

Components and supplies

12859 01
SparkFun Stepper motor driver board A4988
×1
nema 17 stepper motor
×1
12V lithium ion battery pack
×1
13959 01a
SparkFun Ultrasonic Sensor - HC-SR04
×1
Logo jycgurodtz
UTSOURCE Electronic Parts
everything above can be found here for a low price
×1
Arduino uno rev3 a000066 aaf xlzfmaw5ga
JLCPCB Arduino Uno
×1
29425990 844294485757334 4135592617402433536 o 4wf7ylby4k
JLCPCB Customized PCB
×1

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

watch the video first

so the goal here was to build a Soap/Sanitiser without using the "servo motor method" instead go with another approach.

this is actually pretty straightforward built,

first, you need to print these parts and gather all the electronics components that we need.

Thanks UTSOURCE.net to offer electronic components for this project!

you can check UTSOURCE.net, they deal in all kinds of electronics components like for example ultrasonic sensor which I'm using in this project and many more.

Parts that you need to 3D print for CNC rail -

1. END x1

2. Motor End x1

for rest of the built

3. Upper x1

4. LOWER x1

5. Lid x1

6. backbone bracket x1

7. Front support x1

8. back support x1

9. base x1 (or just use any plywood as the base)

for the CNC rail built instruction, watch this video

(I've just changed the carriage of the linear rail with a different one which has two holes on it for attaching the lever )

also, you might need to make a custom soap bottle holder as these bottles are not really universal.

also, this is not really a LOW-COST sanitizer dispenser and is hard to remake if you don't have a 3D printer, so here's an alternative which I've been working on recently.

https://www.hackster.io/Oniichan_is_ded/yet-another-solenoid-valve-based-sanitizer-dispenser-ecec7a



Code

codeC/C++
int trigPin = 11; 
int echoPin = 10; 

const int stepPin = 13; 
const int dirPin = 12; 

void setup()
{  
pinMode(trigPin, OUTPUT); //Sensor
pinMode(echoPin, INPUT); //Sensor  
pinMode(stepPin,OUTPUT); // Step
pinMode(dirPin,OUTPUT); // Dir
Serial.begin(9600);
} 

void loop(){
  

long duration, distance;
 digitalWrite(trigPin, LOW);
 delayMicroseconds(2);
 digitalWrite(trigPin, HIGH);
 delayMicroseconds(5);
 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 distance = (duration/2) / 29.1;
 Serial.print ("cm ");
 Serial.print (distance);



if (distance < 30)
{
digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 300 pulses for making one full cycle rotation
  for(int x = 0; x < 250; x++) {
    digitalWrite(stepPin,HIGH); 
    delayMicroseconds(600); 
    digitalWrite(stepPin,LOW); 
    delayMicroseconds(600); 
  }
delay(1000); // One second delay
  
  digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 300 pulses for making two full cycle rotation
  for(int x = 0; x < 250; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(600);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(600);
  }
}
}

Custom parts and enclosures

Schematics

Comments

Similar projects you might like

IoT Treat Dispenser For Pets

Project tutorial by Arduino “having11” Guy

  • 17,128 views
  • 0 comments
  • 55 respects

Raspberry Pi - Powered Candy Dispenser

Project tutorial by Arduino “having11” Guy

  • 8,752 views
  • 1 comment
  • 15 respects

Candy Dispenser with Google Assistant

Project tutorial by Arduino “having11” Guy

  • 18,243 views
  • 1 comment
  • 63 respects

Arduino Mate Dispenser

Project in progress by Roni Bandini

  • 6,528 views
  • 7 comments
  • 46 respects

Automatic Button Dispenser

Project tutorial by Jeremy S. Cook

  • 3,387 views
  • 6 comments
  • 20 respects

Hands-Free Soap, Water and Paper Towel Dispenser

Project in progress by Samuel Adranyi

  • 2,927 views
  • 2 comments
  • 18 respects
Add projectSign up / Login