Scanitizer (Hand Sanitizer With a Card Reader)
by fengz2 in Workshop > Home Improvement
191 Views, 1 Favorites, 0 Comments
Scanitizer (Hand Sanitizer With a Card Reader)
Have you ever wanted an automatic hand sanitizer for your own home? Now you can build your own with this simple guide!
We created this scanitizer for our group project because we wanted to help make the school gym environment cleaner. The card scanner is to register the user to a raffle for potential prices like free meals, food, and blocked equipment time. But the database part was out of our scope, so this instructable only covers the making of the box and the scanning/dispensing mechanism.
Supplies
Main Materials:
- 8 oz Hand Sanitizer
- Raspberry Pi
- We used a RasPi 2
- Hitec HS-311 Servo Motor
- Any other standard servo motor may also work
- Card Swiper
Other materials:
- 3D printer and filament
- Plywood (for creating the box)
- Autodesk Fusion 360 (computer-aided design software)
Code for the Raspberry Pi
Sorry, we don't have the code in a more easy-to-read format. We don't have our raspi anymore.
This step was one of the most challenging parts of the project as we had since we had no prior experience.
The code we used for this project was written in Python. However, because the Pi runs on linux, you will need to route your python files to a shell script, so that it is executable. This can be done by simply creating a shell script, and calling the path to the python file within it. In order for these tasks to be scheduled together, crontab is the best solution. The following pictures demonstrate each of the things we have mentioned above in this paragraph.
Notes:
- Connect the card swiper to test for inputs
The first picture above demonstrates the key card scanner being swiped and registered by the system. Once this happens, the process to begin the motor movement can begin. Extra code in red is commented out but may be used in future updates or further innovation.
The second picture above represents the connection between the servo motor and the circuitry on the Raspberry Pi. A timer is used as a small delay between swiping and actually receiving the hand sanitizer so that the person who swiped has time to react.
The third picture above is the pathing to the python program inside of a scripting shell file. There is an input delay again for the same reasons mentioned above.
The fourth picture above are the commands used in the crontab scheduling software. The “@reboot” is a command that proceeds to help the motor function as soon as it is plugged into power. To install crontab, on your console command line, type in “sudo apt-get install cron”. Once it is installed, type the command “crontab -e” with a single space between the b and the dash. From there, you can scroll down and type in the commands listed above.
Sorry, we don't have the code in a more easy-to-read format. We don't have our raspi anymore.
The Box
1.Designing the Box
There are many resources online that generate simple box designs for you. For example, we used boxes.py to generate a simple box as the foundation for our design. It is not necessary to use. It just makes the process easier. Just remember to measure the size of your hand sanitizer to adjust the box accordingly.
2.Adjusting the Box (We will not attach the 2D file for our design, explore around a little. It is a fun process)
With the simple box generated, it is time to add features that are unique to the product.
Adjustment Needed:
- A hole in the front to host the motor.
- A platform inside the hole to stabilize the motor.
- An extension on the bottom of the box to host the sanitizer
- A hole in the back of the box for connectivity
- A smaller box around the hand sanitizer
- Adjustments for Cosmetic reasons
Attached are the iterations we went through. The first was made out of cardboard, the second with scrap wood. The third was our final assembly.
3.Assembling the Box
If your box was designed correctly, it should be a tight fit. Just remember to have a rubber hammer to assist the assembling process. Be careful with the hammer so you don’t break the box.
The CAM
When creating the CAM, you will need to use CAD software. We used Autodesk Fusion 360 for our project. Within Fusion, we made many different shapes, but the one that worked the best was a large rounded CAM shape, as seen in the image above.
First, you need to create a sketch of a circle. The center of this circle will be attached to the servo motor. Next, create another circle with the center point a few millimeters above the original circle. You can decide the distance depending on your needs or what you believe to be best. We made our second circle (center point) about 5 millimeters above the original circle. We also decided to make the second circle be a little larger in diameter than the first because we believed that it would better push down on the hand sanitizer pump.
Next, use the extrude tool to make the shape into a 3D CAM shape as seen in the previous pictures. Our CAM has a cylinder with a rectangular shape because originally, we were going to attach it to another type of motor. However, this is not needed, so you may ignore this. Your CAM should be a solid piece with no hole or protruding plastic as it can simply be super-glued to the included arm on the servo motor, as seen in the images below.
If you do not have access to a 3D printer, one other solution would be to carve wood down into a similarly rounded shape. Ensure that one side or part is flat to make it easier to attach to the servo motor.
The second picture is what it looks like for our prototype. You can ignore the blue CAM as it did not pass our tests for strength and length.
Putting It All Together
Our Motor to Pi wiring is shown in the diagram
However, your wiring may differ depending on which Pi you have. Make sure to check online to see which pins are which on your Pi model as they differ from version to version.
The general idea is that the red (positive wire) goes into the 3.3V pin on the PI. The black (ground or negative wire) goes in the ground pin on the Pi. The yellow wire goes into whichever pin you want other than a ground pin or 5V pin.
Assemble your box similar to puzzle pieces. Then, place the hand sanitizer and motors in their respective holes, as seen in the image above. You can adjust the motor by sliding it within the top hole depending on your hand sanitizer bottle.
You can also decorate your box in any way you see fit. For our group, we made the Block-I logo for UIUC and a “Scanitizer” title on the front.
Tips:
You may find it useful to use rubber bands on your hand sanitizer bottle if the pump is too strong for your motor.
Conclusion
Ultimately, looking back at the journey of this project has been quite rewarding. Our team has little coding experience, so diving into the deep end and taking the time to teach ourselves how to make a functional sanitizer dispenser was a little daunting, to say the least. However, it has been a very beneficial learning experience being a part of such a hands-on project. If we were to implement this project at the ARC, we would continue to work on creating the rewards tracking system after a student swipes their iCard. Thank you so much for reading through our instructable, we hope you try creating this scanitizer yourself!