r/ArduinoProjects • • Nov 07 '20

Automatic soap dispenser using Arduino.

165 Upvotes

16 comments sorted by

5

u/Lofiuren Nov 07 '20

That's dope! how did you do it??

9

u/[deleted] Nov 07 '20

Thanks! I used the HC-SR04 ultrasonic sensor to register a hand getting close. A small dc pump is then activated to pump the soap.

2

u/cesaarta Nov 07 '20

Awesome, seems very easy to do if you've got the hardware for it. How's the code, difficult wise?

3

u/aigtImmaHeadOut Nov 08 '20

I did one like this, but for rubbing alcohol

The code is basically: If (sensorvalue < handdistance) Delay (300) digitalWrite (pump, high) Delay (700) digitalWrite (pump, low) Delay (3000)

Play around with the delays to achieve the length of actions and the handdistance variable is whatever the maximum distance you want your hand from the sensor in order to activate it

1

u/[deleted] Nov 08 '20

This is indeed basically what i did as well. It's pretty simple, but effective.

3

u/MainRotorGearbox Nov 08 '20

You could probably add a cheap pot that controls the delay values which would let you adjust the amount of soap dispensed with just a knob

1

u/[deleted] Nov 08 '20

That's a really good idea

1

u/cesaarta Nov 08 '20

Awesome, thank you

3

u/Loorens27 Nov 08 '20

Thats very cool, just wondering how do you prevent your pump output from leaking soap?

1

u/[deleted] Nov 08 '20

I made the bottle airtight, so the ambient air pressure prevents the soap from leaking. I may run into trouble when the bottle is more empty if the pump is not powerful enough though. But so far it works out fine.

2

u/elxdzekson Nov 08 '20

Good job. You have a picture from the inside ?

1

u/[deleted] Nov 08 '20

It's really simple, i just used an Arduino pro mini, a 5v regulator with capacitors, a mosfet, with pull down resistor and a small 12v pump. I run the whole thing with a 10v power supply.

2

u/bart59 Nov 08 '20

Great idea! Where did you find a pump that works with soap?

1

u/[deleted] Nov 08 '20

I used just a generic 12v water pump, which works fine. There are probably better solutions though. I used this one: https://www.budgetronics.com/nl/diversen/kleine-waterpomp-6v-12volt-met-flexibele-montage/a-23678-27

1

u/chewienick Feb 13 '21

Peristaltic pumps are really good for thicker fluids like soap and also very accurate and repeatable in use