Jarvis Trashcan
This Instructables will walk you through the creation of the Jarvis Trashcan. This trashcan is designed to automatically open and close at the wave of the hand using a distance sensor.
Supplies
- Cardboard
- Box cutter
- Duct tape, Electrical Tape, and/or Hot glue
- Arduino Sparkfun Kit
- Male to Female wire extenders (if sparkfun kit did not include)
- Servo x 2
Gathering and Measuring
Hello hello, welcome to How to Put Together Your Very Own Jarvis Can. The first step in creating this wonderous and intricate trash can is to collect some cardboard. The cardboard can come from anywhere. You will need to measure out:
- Two 20” x 14” pieces for the walls
- This will need to be folded about one third of the way from both sides. This will allow the folds to glue together for more sturdiness.
- Two 7” x 7” squares, one for the base, the other for the lid
- Two 7” x 2” strips for the sides of the lid
Cutting Out the Pieces
Grab a box cutter and slice away. Keep a steady hold on the knife and hold down the cardboard with the other hand. Remember to keep your other arm out of the cutting path when you are cutting the cardboard.
You will also need to cut out a corner on both the walls where they meet, as that is where the cord from the Arduino to the device will enter through. The little slot’s size is dependent on the cord, but it is made out to be around 1”x ½".
Putting the Can Together
- First, take the two 20”x14” side walls and fold them into thirds. Fold each one into a sort of U shape and link them together.
- Then, use hot glue to glue the flaps together to form a rectangular shape.
- Using either tape and/or hot glue, attach the base to the now held-together walls of the trash can.
- For the lid, use hot glue to glue the two strips to the other 7” x 7” square
Wiring
From the Arduino Sparkfun Kit(s), collect the Arduino UNO board, male wires, male to female wires, two servos, and an ultrasonic distance sensor. To wire:
- Wire the breadboard and the UNO board together ground to ground and 5V to 5V.
- You will need the male to female wires for extension. Connect those to the potentiometer pins. Then, connect ground to ground, trigpin to pin 6, echopin to pin 5, and vcc to 5V.
- With the potentiometer wired, grab a servo. This will be Servo 1. Looking at the Arduino Board from above with the breadboard on top, this will be the servo on the right. From the servo, wire the black wire to ground, the red wire to the 5V, and the other colored wire to the breadboard, then to pin 9. Do the same with the left servo (Servo 2), but instead of pin 9, wire it to pin 10.
- The board should be wired and ready to go
The Code
With the board wired and ready to go, download the code provided. Connect the UNO Board to a device, and using the Arduino program or Arduino Online, upload the code to the board.
Downloads
Putting It All Together
- Now the hard part: Putting it all together. Depending on the size of the servo, you will need to cut slots for the servo to fit in and have the rotational part stick outwards from the wall.
- The location of the servo holes is somewhat arbitrary, but it should be in the top corners. One side should have it in the right corner, the other should have it in the left corner. For some universal measurements, the holes should be 1” away from the side and the top.
- Put the wiring component into the bottom of the can carefully. Take care to not have any wires come loose. Take the servos and slip them into each slot. Keep track of which way each servo rotates. The top right slot should be clockwise, and vise versa.
- If needed, add a dab of glue to keep the servos in place or use screws provided in the Arduino kit. Make sure to have the servos are in the correct place before doing this.
- Attach the rotational component (any will do) to the servos. Then, using glue, glue the sides of the lid onto both of the servos. The lid should sit relatively flush to the top of the can.
- Do a test rotation of the lid opening before glueing. Make sure the lid will open smoothly where it is placed.
- Now the Jarvis Can should be completely built.
- Connect the UNO Board to a device, and using the Arduino program or Arduino Online, upload the code to the board.
- Test and make sure everything is working. If it does not work, make sure the servos are rotating in the right direction, the wires are all connected, and/or the wires are connected to the correct spots.
Decoration
Now that you have completed the construction of your trashcan it is time to decorate.
Feel free to decorate in anyway you feel will best suit your use case.
Included below is a complete demonstration of a decorated and working trashcan.