Introduction: The Fourth of July Celebration Box

Fourth of July is always a special day for me, the only difference this year would be the opportunity to work for CEL ROBOX and Circuit Specialists. This project is first to celebrate The Independent Day, second to show my appreciation for the people that I work with.

The project involved 3D printing, basic wiring, and basic programming. I will provide STL files, the code for the Arduino and the schematic for the wiring throughout the post so don’t be worry :)

Step 1: Part Required

  1. Arduino Uno
  2. OSEPP Sensor Shield
  3. Continuous Micro Servo (or a modify servo, click here if you want to know how to modify a servo)
  4. Get the parts 3D printer

You can get all of the electric components that needed at www.circuitspecialists.com

Step 2: The Main Mechanic

I got inspire by CEL ROBOX 3D printer while I design this project. The main mechanic of this project is the fundamental mechanic of a 3D printer. Let me explain it roughly, a platform with a nut imbedded will move up or down depend on the direction which the threat move. A 3D printer like CEL ROBOX would move up and down precise up to the 0.001 mm.

However, for the theme of this project is celebrating on of the most important day of our country. I want to archive the freedom feeling when you look at a waving flag, I then scale down the threat so that when the platform raising up the banner waving as it raises.

Step 3: Let Talk About the Code

The code works fairly simple, the Arduino read the stage of the button. If the button doesn’t press than the threat will keep the banner down. If the button press then the banner would raise.

#include

Servo myservo;

const int buttonPin = 2; int Dir ; int lastDir;

int buttonState = 0; int pos = 0;

void setup() { Serial.begin(9600); pinMode(buttonPin, INPUT); myservo.attach(9); }

void loop() { buttonState = digitalRead(buttonPin);

if (buttonState == HIGH)

{ Dir = 1 ;

if ( lastDir == 1)

{ lastDir=0; } Serial.print("Dir= "); Serial.print(Dir); Serial.print(" ;lastDir= "); Serial.println(lastDir); delay(150); }

else

{ Dir = 0; if( lastDir == 0) { lastDir=1; } Serial.print("Dir= "); Serial.print(Dir); Serial.print(" ;lastDir= "); Serial.println(lastDir); delay(150); } moveServo( Dir); }

void moveServo( int Direction)

{ if( Dir>= 1) {myservo.write(85); }

if( Dir < 1) { myservo.write(95); } }

Step 4: The Button Schematic

You can also find this picture on the Arduino webpage, here is the link.

Step 5: The STL File

I attach a file folder with all the STL files needed to 3D printed for the project.

Have fun Making and Happy Fourth of July Maker.

Comments

About This Instructable

300views

1favorite

License:

Bio: My hobby is building robot. My goal is design and 3D printing all different kind of robot and provide the robotic hobbyist community with a ... More »
More by Khang Nguyen:How to Modify Standard Hot Wheels to R/C Hot Wheels  The Fourth of July Celebration BoxHow to Detail and Strengthen Your 3D Printed Parts.
Add instructable to: