Underwater Treasure Chest
by group6ecet380 in Workshop > Home Theater
428 Views, 0 Favorites, 0 Comments
Underwater Treasure Chest
Problem: to choose a theme and create a prop or object that would fit and better that theme.
Importance: To prove we can take any form of art, and create an object or prop that can fit or be seen within said form of art.
Scope: Chest can be built by a person with basic mechanical and electrical high school knowledge, materials under $100, and only home tools are needed.
Deliverable: The final project will be a stone chest that can open and close with the press of a button with infinity mirrors and aquatic figures inside.
Supplies
MATERIALS
Plywood
- 5 pieces
- Front, Back, Sides and Bottom
- 2 Piano hinges
Styrofoam
20%VCT Window Tint Film
Reflective film
Plexiglass
Squeegee
Utility knife
Lint-free cloth
LED strip lights
Microcontroller
Push Button
USB Cable
Stepper Motor
String
Wiring
Piano Hinges
TOOLS
Scissors
Tape
Screwdriver
Power drill
CUT WOOD PIECES
Use the following drawing to help cut out the necessary wood pieces
ASSEMBLE PIECES
MATERIALS NEEDED:
- 2 PIANO HINGES
- 22 SCREWS
- POWER DRILL
2a: Drill 10 holes on the bottom for the sides to be attached
2b: Drill 12 holes on the front of the chest frame. 6 on the front side and 6 on the bottom side. This will allow the front side to be lowered like a drawbridge so the user can place the electronics and infinity mirror
2c: Drill 2 holes into the backside with a diameter of 1 inch for the motor to be placed and for the infinity mirror power cord to be pulled through. This hole needs to be centered and on towards the bottom of the frame
CUT CHEST LID
MATERIALS NEEDED:
- STYROFOAM BLOCK
- ANY CUTTING TOOL (SAW OR FILE)
3a: Take a Styrofoam block and cut it into a semicircular cylinder with the following dimensions
ASSEMBLE LID TO FRAME
MATERIALS NEEDED
- ANY ADHESIVE AVAILABLE (TAPE OR GLUE)
- 2 PIANO HINGES
- HOT GLUE GUN OR SCISSORS
- 4 SCREWS
4a: Attach the 2 piano hinges to the chest frame on either side of the back side
4b: Attach the lid to the piano hinges using tape or glue
This is what the base frame should look like
EXTRA MATERIAL
MATERIALS NEEDED:
- ANY EXTRA STYROFOAM
6a: This step is only if you would like to add any extra material to your chest
PAINT
MATERIALS NEEDED
- ANY COLOR OF SPRAY PAINT
5a: For this step, take any color you want your chest to look like, and go to town!
Electronic Configuration
For the hardware connections, we will use the ATMega 2560 and a USB cable to connect our hardware and perform the code. We will be using a push button to control the actions of the stepper motor which then in return will drive our styrofoam lid to a 90 degree angle. We will be using two ports on the microcontroller, one for the push button and one for the stepper motor (PORTA and PORTK). The code presented is what we will use to drive the stepper motor and perform this operation.
STEP 7: How to download code
First, downloading the software called Microchip Studio is a must in this case since we have used special libraries. Once that is downloaded you can copy this code below into your program by following basic steps of setting up this software here.
Step 8: Uploading the code
For uploading the code, we will be using the ATMega Uploader that will upload the code labeled here. Basic instructions on how to perform this should be explained in the video.
#define F_CPU 16000000UL
#include <avr/io.h>
#include <stdint.h>
#include <util/delay.h>
#include "stepper_motor.h"
// Define
#define Wave_Step 0x01
#define Full_Step 0x02
#define Half_Step 0x04
#define Angle 0x08
uint8_t PushButton; // 8 bit unsigned variable named PushButton
void io_init(void); // function prototype
int main(void) // main function
{
io_init(); // io function
uint8_t num = 2; // 8 bit unsigned variable named num
uint16_t degrees = 45; //16 bit unsigned variable named degrees set to 45
while(1) // infinite loop
{
PushButton = PINA & ((1<<PINA0) | (1<<PINA1) | (1<<PINA2) | (1<<PINA3)); // shifting bit values
switch (PushButton) // switch case statement
{
case Wave_Step: // wave step case
{
Stepper_Drive('W', num); // retrieves values
break;
}
case Full_Step: // full step case
{
Stepper_Drive('F', num); // retrieves values
break;
}
case Half_Step: // half step case
{
Stepper_Drive('H', num); // retrieves values
break;
}
case Angle: // angle case
{
Stepper_Angle(degrees); // retrieves values
break;
}
}
PushButton = PINA & ((1<<PINA0) | (1<<PINA1) | (1<<PINA2) | (1<<PINA3)); // shifting bit values
PORTC = 0x00; // sets portc off
}
}
void io_init(void)
{
DDRA = 0x00; // pull up resistors off
PORTA = 0xFF; // porta on
DDRC = 0xFF; // pull up resistors on
PORTC = 0x00; // portc off
}
/* stepper_motor.c */
// Include files
#define F_CPU 16000000UL
#include <avr/io.h>
#include <stdint.h>
#include <util/delay.h>
#include "stepper_motor.h"
// 8 bit unsigned variables that sets their elements
uint8_t Wave[4] = { 0x01, 0x02, 0x04, 0x08 };
uint8_t Full[4] = { 0x03, 0x06, 0x0C, 0x09 };
uint8_t Half[8] = { 0x09, 0x01, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08 };
int degrees = 0; // integer variable degrees set to 0
void Stepper_Drive(char mode, uint8_t revolutions) // Stepper Drive function
{
uint16_t steps; // 16 bit unsigned variable named steps
switch (mode) // switch case statement
{
case 'W': // wave step case
steps = (2048UL / 4) * revolutions; // steps calculation
for (uint16_t i = 0; i < steps; i++) // for loop sets i to 0, i < steps, and increments i
{
for (uint16_t j = 0; j < 4; j++) // for loop sets j to 0, j < 4, and increments j
{
PORTC = Wave[j]; // sets portc to wave with variable j
_delay_ms(3); // delay 3 ms
}
}
break;
case 'F': // full step case
steps = (2048UL / 4) * revolutions; // steps calculation
for (uint16_t i = 0; i < steps; i++) // for loop sets i to 0, i < steps, and increments i
{
for (uint16_t j = 0; j < 4; j++) // for loop sets j to 0, j < 4, and increments j
{
PORTC = Full[j]; // sets portc to full with variable j
_delay_ms(3); // delay 3 ms
}
}
break;
case 'H':
#include <util/delay.h>
#define Angle 0x08
//function prototypes
void Stepper_Angle(uint32_t degrees);
void Stepper_Drive(char mode, uint8_t revolutions);
#endif STEPPER_MOTOR_H_ // end
Electrical Drawing:
Building the Infinity Mirror
- Make sure the panel and film surface is as clean as possible
- Separate the film from the protective layer and spray the adhesive side with the solution
- Spray the panel evenly with solution and place the wet adhesive part on top of the panel
- Wet the top slightly and use a squeegee smooth out the contact between the panel and the film
- Make sure there is no bubbles or inconsistencies and next you have two options:
- You can cut out the film roughly around the panel, wait for it to set for an hour or so and then cut the film sticking out
- or
- You can cut all of the film sticking out and let it set for an hour or two
- Cut cardboard to the dimensions of 40’’ x 2’’.
- Fold the cardboard into an 8” by 12” rectangle.
- Tape the two loose ends together.
- Make sure the panel and film surface is as clean as possible
- Cut cardboard to the dimensions of 40’’ x 2’’.
- Fold the cardboard into an 8” by 12” rectangle.
- Tape the two loose ends together.
- Tape one of the reflective panels you just made on the top of the cardboard rectangle with the reflective side facing the cardboard.
- Around the inside of the cardboard, adhere the LED strip.
- Cut a hole for the wire of the LED strip to exit out of the cardboard.
- On the open side of the assembly you have created, tape the other reflective panel you just made with the reflective side facing the cardboard.
FINAL TOUCHES
Add motor and electronics to the back of the chest frame
Add infinity mirror to fit within the chest lid