Introduction: The GOB
This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
Background on The GOB
The GOB stands for Gear Operated Box and is a box that operates via a series of gears. This project was created as mentioned above for the Makercourse at the University of South Florida and this instructable will show exactly what is needed to replicate this project in other boxes as well. The picture to the right the first picture above is the latest version of the GOB. The box can be locked and unlocked depending on which key the RFID sensor “sees” and also turns on the side LEDs depending on if the box is locking or unlocking. Check out the attached video to see the latest features of the box.
Step 1: Supplies/Hardware
You will need the following to recreate this project.
1. Arduino Uno Board
2. Arduino RFID Sensor (MFRC522)
3. Gears - See below for specifications
4. A Large Spring
5. 5v Stepper Motor
6. Various LEDs
7. Portable USB Charger
8. Box - See below for specifications
9. Any decorations you could want for your box, I used the following:
- Spray paint (Brown, gold, rose gold/ copper)
- Keychain lightbulbs
- Various 3D printed gears, bolts, and piping
The gears used for the mechanical portion of this design I designed in fusion 360 using their gear script and then 3D printed them. The first image attached here shows the specifications I used to generate all my gears and only had to change the number of teeth on each. The second image shows the gears used in this box. There were 3 round gears used and then a rectangular gear used as the actual locking mechanism, the .stl files for these gear are attached as well. The third image shows the gears placement, as you can see the top gear needs guides to keep it in place and the largest gear is glued to a smaller gear that allows the stepper motor to rotate all of the internal gears at once.
The box used for my project was made out of 7in. x 7 in. sheets of cardboard. Two thin strips of cardboard were used to connect the lid to the base of the box and then a small strip was used to construct the hook on the lid to allow for the box to be locked. You can make your box out of whatever material you prefer or use one with a lid already connected on one side, either way the lid must have a hook on the inside in order for the box to be locked by the internal gears. Look at the last two images for a more details.
Step 2: Assembly
1. Gather all materials listed in Step 1: Supplies/ Hardware
2. Construct the box, as mentioned previously you can make your box out of any material or have it any size with the only specification being it must have an internal hook that is big enough to allow the internal gears to lock the box.
3. Once the box is constructed you need to wire up the circuit. Follow the schematic attached. Remember the more clean and compact you make your circuit the better it will fit in your box. Once assembled program and test your circuit to 1) verify all your hardware is working and 2) check it does what you want it to.
4. Next design and print the gears needed for your box. This may take a few prints depending on the size of your box and the size of your circuit. The first gear you should start with is the one for the stepper motor, this will help you gauge the height size of your gears inside the box. There are varying dowel sizes attached in the .stl files that should help with figuring out the best height for your box. You will need to drill a hole in the bottom of the dowel and glue it onto the stepper motor to secure the gear to the stepper motor.
5. Once you have all gears printed and the circuit assembled, attach the gears to the inside of the box. I used hot glue for easy assembly. Other types of glue or screws can also be used. Add guide rails as needed to keep gears in place. As you can see in the images the placement of the gears needs to line up directly underneath the lid of the box where the hook rests. The spring needs to sit directly beneath the hook so that the lid pops up when the box is unlocked and the rectangular gear has room slide into the hook when the box is to be locked.
6. Once the gears are in place secure your circuit inside the box. I used tape, blue tape in pictures, for this as it allowed me to make easy adjustments as needed.
7. Finally decorate your box! I chose to use the LEDs originally used to signify the rotation of the gears as part of the decor for the left side of the box. The best part of this project is that the simple concept allows you to customize this project for your own needs. The next three steps show how I decorated this box.
8. Print a variety of different gears. Then spray paint the box and gears to match whatever theme you are aiming for. I used some gears as stencils to add designs to the sides or glued them on for texture see the pictures attached for details.
9. For the lightbulbs on the side I used keychain lightbulbs that I could unscrew and take the LEDs out. From there I could make two holes in the side of the box to thread the LEDs I had connected to the circuit into the lightbulbs on the I had glue to the outside of the box.
10. Once your finished make sure there is still enough room to put an object in your box. I chose to hide the inner circuitry with felt so that nothing would get snagged.
Have fun decorating the box however you want, that is the best part about inventing! Happy Making!
Step 3: Code
The .ino file attached is the program code for the GOB. In order to properly run this on your arduino you will also need to install the two libraries that are also attached into your arduino libraries folder. The program is well commented but there is also a description provided below for further clarification. This codes requires a basic understanding of arduino programming.
There are three libraries used in this program SPI, MFRC522, and the Stepper Library. Since SPI is a default arduino library so there is no need to install that one in your arduino libraries folder. SPI stands for Serial Peripheral Interface and it is a serial communication protocol that the arduino uses to talk to the RFID sensor. With this library we use the MFRC522 library to read the data from the RFID sensor. This library is specific to the sensor and allows us to use the information the sensor "reads" from the RFID keys used to lock and unlock the box. The stepper library does exactly as it sounds, it helps the arduino talk to the stepper motor.
2. Defining Variables/ Setup
After including the necessary libraries for the required hardware the pins of said hardware need to be defined. Essentially the arduino needs to know which pins are talking to which pieces of hardware.
3. Main Loop
First off, the first two if statements are used to make sure the RFID sensor is reading an RFID key. Then we need to grab the code or UID of the RFID key being "read", this is what is happening in the first for loop of the Loop() function. Once the UID is read in we need to check to see if the key is going to lock or unlock the box. Here, using an if else statement I have set one key to lock the box and any other to unlock the box. For example, if the UID is equal to a UID I want then call the spinRight() function or lock the box else call the spinLeft() function and unlock the box.
4. Spin Functions
The spinLeft() and spinRight() functions are used to spin the stepper motor either left or right. The key thing here is that in order to reverse directions of the stepper motor the pins for the stepper motor are being reversed.