Automatic Liquid Dispenser

8,566

136

11

Introduction: Automatic Liquid Dispenser

An automated dispenser is a super helpful addition for everyday use. With sanitation becoming ever more important, this device can be utilized to safely deliver soap or hand sanitizer. This particular creation employs a peristaltic pump which can handle substances that are generally harmful to standard pumps. Peristaltic pumps also offer a unique advantage allowing 100% of the internal plumbing to be replaced in case there is a need to repurpose the pump's use.

My goal was to make this project as easy to replicate as possible. Most of the electronic components can be substituted with similarly performing parts.

Please be sure to watch the gifs that are included with most steps for assembly clarification.

Everything was modeled, rendered, and animated using Fusion 360.

Step 1: Parts

  1. PCB board (2): 80mm X 20mm X 1.6mm
  2. Peristaltic pump and motor: I used this one
  3. Bottle to hold liquid: Dimensions are included in the image above.
    • It is not crucial to find the exact dimensions listed in the photo above. As long as the bottle can fit in the designated space, screws will be used to attach the lid to the main body.
  4. Arduino Nano board
  5. Ultrasonic sensor
  6. Relay switch
  7. PCB Screw Terminal Block Connectors: Similar to this
  8. 12v 1A DC power source
  9. Screws (12): 6-32x3/8
  10. Silicone tubing: 2mm ID x 4mm OD
  11. Assorted wiring

Most of these components can be substituted with readily available parts found in your area.

Please notify me if you have problems with the vendors/products linked in this project, so I can make adjustments.

Step 2: 3D Printing

All of these parts were designed while taking into consideration standard printing dimensions.

Everything was designed using Fusion 360 and printed on both the Creality CR10 and Ender 3 Pro.

The Fusion 360 Cad software is a great option when designing parts for 3d printing. Everything is simplified and very easy to learn.

The pump was prototyped while using a 0.02mm layer height, although it is not required.

For some of the more intricate pieces, the use of supports will yield a better result.

Since I was using the Cura print slicer, I found the tree support feature to perform well when supports were required.

Step 3: Getting Started

Use the 3d printed jig to mark and cut the designated holes needed on the bottle lid. The lid can then be attached to the electronics base using two screws.

Step 4: Lower Cylinder

Before soldering the electronics together, attach the lower cylinder using four more screws.

Step 5: PCB Design

For this project, I wanted to make parts as interchangeable as possible, so I created a slot system that allows for the electronic components to be replaced with alternate pieces without compromising the plastic parts. With this system, a PCB containing the desired circuitry can be slotted into the model, eliminating the need for adhesive or specific fastening constraints. This system will make the process of sourcing materials easier and more cost-friendly.

Step 6: Core Electronics

First, we will solder the power PCB board. This board uses screw terminal block connectors to connect the Arduino and its main circuit to the power source and ultrasonic sensor while still allowing for disassembly and modifications in the future.

Secondly, installed all components into their respective places on the electronics base. This made it easy to measure the necessary wire lengths and ensure everything will fit into the final assembly. Following the wiring diagram, I soldered the components together.

Step 7: Tube Install

Once the electronics are in place, it is time to install the liquid tubing. The two smaller lengths will travel from the bottle to the lower cylinder to prevent a vacuum from occurring, while also protecting the electronics from leaks. The longer length travels from the bottle to the pump housing and eventually the spout.

Depending on how snugly the tubing is secured in the 3d printed base, it may be a good idea to use glue to create a stronger watertight seal.

I discussed this step with more detail in the comments below.

Step 8: Top Housing

Now that all of the core electronics have been installed in their designated places, attach the motor cap using the two screws provided. The pump with its pre-installed tube is then placed on top. Once the motor and pump are secure, install the middle ring. The ring has a grove on the back which should line up with the power exhaust on the electronics board. The main 12v power source can then be attached to the power board and positioned in the designated location. Finally, slide the top cylinder into the designated slots and attach them with four more screws.

Step 9: Sensor/Spout Preparation

My original design for the spout used an infrared sensor. This worked well and had a small form factor that allowed me to squeeze in an RGB diode as an indicator. The design worked great, but it was necessary to tune the infrared trigger frequency to cooperate with the varying light sources experienced. Due to complications in the final testing phases, I decided that it would be best to pivot to an ultrasonic sensor. I already had one of these sensors on hand and it works great, but it is a little bit of overkill for this application. Not wanting to disrupt the form factor I was previously using, I managed to squeeze the sensor by removing the LED and replacing the fasteners with a simple press fit. I suspect there are better sensor solutions available, so I am open to hearing suggestions about any small alternatives that I should consider.

To fit the sensor into the tight form factor, I first desoldered the preinstalled breadboard pins and replaced them with my own wires. To achieve the exact size required for the PCB board, it was necessary to slightly trim the corners. While adjusting the board size, it is crucial to ensure that no circuitry is damaged in the process. Once modifications are carefully made, the ultrasonic sensor should snugly fit into the designated holes allowing the lid to snap on top.

Once the sensor has been modified, it is important to test its features before continuing with the build.

Step 10: Installing Spout

Once the sensor is prepared for installation, the lower half of the spout can be attached with screws that pass through the top cylinder and are fastened to the backplate. The backplate has a designated location for the silicone tube as well as an opening for the required wiring to pass through. Once the spout is secure, the tube can be installed followed by the ultrasonic sensor and lid. The wires can then be attached to their respective connectors that were installed on the PCB board.

Step 11: End Caps

The last and easiest step of the installation process is to install the end caps. These should both achieve a secure press-fit with their respective pieces. Connect the bottom of the bottle to the lower cap. This assembly can be screwed into the lid creating a tight attachment. The top cap can then be pressed into the upper cylinder creating a finished product.

Step 12: Final Result

This project has definitely taken a lot longer than I imagined to develop, but I feel the final result was worth the effort. I would appreciate any suggestions you have on how I could improve my project or presentation form.

Step 13: Code

Here is a quick glimpse of the code I wrote for the process. You can access my Github for a downloadable version here.

I wanted to keep this code as simple as I could while still achieving full functionality. I highly recommend tweaking this code to fit your personal needs. Personally, I am going to replace my if statement found on line 30 for a switch case. This case will be coded to allow my dispenser to deploy different amounts of liquid depending on where my hand is in relation to the sensor.

Step 14: Files

Attached are all of the STL files used for this project. All of these parts were designed to fit small printing areas. I designed the pump using a 0.02mm layer height, although any reasonable settings will work. For some of the more intricate pieces, the use of supports will be necessary.

I have attached the full animation for the assembly below. Unfortunately, due to a recent update, the Fusion 360 animation workspace has a few glitches rendering the application temporary unusable. The animation is from an outdated version that is virtually similar barring one piece used in the spout.

3D Printed Contest

Second Prize in the
3D Printed Contest

Be the First to Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Barbecue Speed Challenge

      Barbecue Speed Challenge
    • Arduino Contest

      Arduino Contest

    11 Comments

    0
    dani78112
    dani78112

    Question 6 months ago on Introduction

    Hello,
    Could you please help me with the connection on the nano board where I connect the echo trig from the sensor to the nano?

    1
    Léobaillard
    Léobaillard

    1 year ago

    I can't get the right dimensions of the parts when opening them with Cura, any idea how I could solve this? Thanks for this project!

    0
    WhyyNot
    WhyyNot

    Reply 1 year ago

    If the parts are too small, Cura is probably converting the stl files from inches to millimeters. Using the scale feature with uniform scaling enabled, convert the numbers shown (probably in inches) with their metric equivalent (i.e. replace inches with the same measurement in milimeters). It looks like scaling the parts 2540% may also work.
    Let me know if this helps!

    0
    Léobaillard
    Léobaillard

    Reply 1 year ago

    Hi! Thanks a lot! I think you're exactly right. I tried 2000% randomly and it seemed closer. I'll try with 2540%. Thanks again for your work and your answer!

    0
    WhyyNot
    WhyyNot

    Reply 1 year ago

    I'm glad it worked! Cura seems to automatically assume all files are in mm and I haven't found a way to change that yet. You might want to fact check my scaling but 1in is 25.4mm so 2540% (100% x 25.4) seems to check out. Let me know if you have any more questions!

    0
    mrsarkar
    mrsarkar

    1 year ago on Step 14

    Nicely detailed, nicely posted. Thanks for sharing this.

    0
    WhyyNot
    WhyyNot

    Reply 1 year ago

    Thank you!

    0
    makendo
    makendo

    1 year ago

    Great job and very topical. Thanks for open-sourcing all this

    0
    WhyyNot
    WhyyNot

    Reply 1 year ago

    Thanks Scott! Limiting contact is more important now than ever before. Hopefully this project can help make everyone's daily lives a little safer.

    1
    ChrisWx
    ChrisWx

    1 year ago

    Can you please be more clear about where the two 'venting' tubes go? The description is a bit sparse on detail, and the only two pictures have the tubes going in different holes!

    0
    WhyyNot
    WhyyNot

    Reply 1 year ago

    Hi Chris! I apologize for the confusion. In hindsight I should've made sure that all of my assembly pictures were uniform.
    The following is an elaboration to step 7:
    To allow a consistent flow of liquid I needed to ensure that there was an access point to safely allow air into the bottle. The air replaces the pumped liquid and prevents a vacuum from developing. To protect the electronic components from any accidental liquid damage, I wanted to maintain a level of separation between the top(with the electronics) and bottom(holding the liquid) housings. This meant that simply extruding holes through the bottle's lid was out of the question for me. To prevent damage, I used the tubing to allow the bottle to properly vent through the lid while still maintaining a level of separation. If the pump ever gets knocked over or flipped upside down, any substance that leaks out of the vent will end up in the lower cylinder away from the electronics.
    Both tube configurations shown in the instructions above are a correct solution. Three of the holes lead to the bottle while two more lead to the lower cylinder housing. The vent tubes must each bridge the gap between the cylinder and the bottle. This leaves the third hole available for the pump exhaust. As long as these guidelines are followed, you can use any hole combination that works best for you. In the attached photo I marked each of the designated holes that are used for the tubes. I also drew a possible layout that is shown in the second photo of step 7.
    Hopefully this will help!

    PumpVenting2.png