Introduction: Farm House and Windmill Desk Decoration

"This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)"

This project is a small desk decoration or end table conversation starter. It is a farmhouse with a windmill landscape that has a continuously spinning windmill and LED's inside the house that are operated via a photo sensor.

Step 1: Gather Materials and Tools

Here are the materials and tools needed for this project.

Tools:

1. Butane torch

2. Hot glue gun

3. 3D printer or 3D printing service

4. Drill

5. Knife

6. Screwdriver

7. Paint brushes

8. Pencil

Materials:

1. Arduino

2. Stepper motor

3. Yellow LED (x4)

4. Photo-resistor

5. 220 Ohm resistor (x4)

6. Electronics box

7. Hot glue

8. Rubber band

9. Sandpaper

10. Super glue

11. Spray adhesive

12. Landscape materials

13. Small 1.5'' metal shelf bracket

14. Jumper wires

15. Breadboard

16. Extension cord

17. USB charging block

18. Acrylic Paint

19. 10K Ohm resistor

Here are links to some of the materials:

Electronics box - https://www.polycase.com/dc-47p

Stepper motor - http://www.digikey.com/product-detail/en/858/1528-...

Arduino - https://www.amazon.com/OSOYOO-ATmega328P-CH340G-Ar...

Step 2: Programming Your Arduino

Part 1:

Here is the complete commented main code for the arduino copy and paste it into arduino software and upload it to the arduino. (there will be a few random extra spaces between the lines of code you can delete these or leave these as it will not effect the way the code runs.)

/******************************************

PURPOSE: run the Farmhouse with Windmill Project

Created by Tyler Adams

DATE: 10/2016

*******************************************/

#define led1 2 //defines LED 1 as pin 2

#define led2 3 //defines LED 2 as pin 3

#define led3 4 //defines LED 3 as pin 4

#define led4 5 //defines LED 4 as pin 5

int sensorPin = A0; //set the A0 pin as the sensor pin

int lowThreshold = 300; //sets low threshold for photo-restor

int highThreshold = 400; //sets high threshold for photo-restor

#include //calls in library and functions for the stepper motor

#include //calls in library and functions for the stepper motor

const int stepsPerRevolution = 2048; //defines number of steps in 1 rotation

#define gearratio 64 //sets gear ration to 64 for stepper motor

#define pin1 8//these are the Arduino pins that we use to activate coils 1-4 of the stepper motor

#define pin2 9

#define pin3 10

#define pin4 11

Stepper myStepper(stepsPerRevolution, 8,9,10,11);

#define delaytime 8 //delay time in ms to control the stepper motor delaytime.

void setup() {

Serial.begin(9600);

pinMode(led1, OUTPUT); //sets LED pins as outputs

pinMode(led2, OUTPUT);

pinMode(led3, OUTPUT);

pinMode(led4, OUTPUT);

pinMode(pin1, OUTPUT); //sets stepper motor pins as outputs
pinMode(pin2, OUTPUT);

pinMode(pin3, OUTPUT);

pinMode(pin4, OUTPUT);

myStepper.setSpeed(0.15*gearratio); //determines speed or stepper motor

}

void loop(){

int sensorValue = analogRead(sensorPin); //reads the photo-restor

if(sensorValue < lowThreshold){ //if statement to tell LED's on if sensor read is below the low threshold

digitalWrite (led1, HIGH);

digitalWrite (led2, HIGH);

digitalWrite (led3, HIGH);

digitalWrite (led4, HIGH);

}

if (sensorValue > highThreshold){ //if statement telling LED's off if sensor read is above the high threshold

digitalWrite (led1, LOW);

digitalWrite (led2, LOW);

digitalWrite (led3, LOW);

digitalWrite (led4, LOW);

}

myStepper.step(stepsPerRevolution); //tells the stepper motor to make a full revolution

}

Part 2:

Here is the function code also required for the code to work these are downloaded form a library file and are not commented as I did not write this code. Copy and past this code in another tab attached to your main code file and name it "Functions".

//these functions set the pin settings for each of the four steps per rotation of the motor (keepp in mind that the motor in the kit is geared down,

//i.e. there are many steps necessary per rotation

void Step_A(){

digitalWrite(pin1, HIGH);//turn on coil 1

digitalWrite(pin2, LOW);

digitalWrite(pin3, LOW);

digitalWrite(pin4, LOW);

}

void Step_B(){

digitalWrite(pin1, LOW);

digitalWrite(pin2, HIGH);//turn on coil 2

digitalWrite(pin3, LOW);

digitalWrite(pin4, LOW);

}

void Step_C(){

digitalWrite(pin1, LOW);

digitalWrite(pin2, LOW);

digitalWrite(pin3, HIGH); //turn on coil 3

digitalWrite(pin4, LOW);

}

void Step_D(){

digitalWrite(pin1, LOW);

digitalWrite(pin2, LOW);

digitalWrite(pin3, LOW);

digitalWrite(pin4, HIGH); //turn on coil 4

}

void step_OFF(){

digitalWrite(pin1, LOW); //power all coils down

digitalWrite(pin2, LOW);

digitalWrite(pin3, LOW);

digitalWrite(pin4, LOW);

}

//these functions run the above configurations in forward and reverse order

//the direction of a stepper motor depends on the order in which the coils are turned on.

void forward(){//one tooth forward

Step_A();

delay(delaytime);

Step_B();

delay(delaytime);

Step_C();

delay(delaytime);\

Step_D();

delay(delaytime);

}

void backward(){//one tooth backward

Step_D();

delay(delaytime);

Step_C();

delay(delaytime);

Step_B();

delay(delaytime);

Step_A();

delay(delaytime);

}

Step 3: Assembling Your Circuitry

Part 1:

Connect the 5V output on the Arduino to the hot rail of the breadboard and connect one of the ground pins on the Arduino to the ground rail of the breadboard with jumper wires.

Part 2:

Connect your stepper motor to the adapter that comes with the motor. (see image 2)

Part 3:

Connect stepper motor adapter to pins 8, 9, 10, and 11 on the Arduino. (see image 3)

Part 4:

Connect jumper wires from the hot rail and ground rail to the stepper motor adapter. (see image 2)

Part 5:

Connect a jumper wire from pin 2 to a row on the bread board. (see image 4)

Part 6:

Connect a 220 Ohm resistor to a pin in the row that you just connected the jumper to in part 5. (see image 4)

Part 7:

Connect the other end of the 220 Ohm resistor to a jumper wire. (see image 5)

Part 8:

Connect the longer lead of a yellow LED to the jumper wire from part 7. (see image 5)

Part 9:

Connect a jumper wire to the other lead of the yellow LED. (see image 5)

Part 10:

Connect the jumper wire from part 9 to the ground rail of the breadboard. (see image 5)

Part 11:

Repeat parts 5-10 for the remaining 3 yellow LED's using pins 3, 4, and 5.

Part 12:

Connect a jumper from the hot rail to a lead on the photo-resistor. (see image 6)

Part 13:

Connect a jumper from the other lead of the photo-resistor to a row on the breadboard. (see image 6)

Part 14:

In the same row as part 13 connect a 10K Ohm resistor from the row to the ground rail and connect a jumper wire from the row to the A0 pin on the Arduino. (see image 6)

Part 15:

Make sure all of your connections are secure and use a little super glue on the outside of the connection to ensure that they don't slip off.

Step 4: Printing Your Parts

Here are all the part and stl files I used for this project. You can just simply print the stl files or you can open the part files and customize the parts to your liking. The last part (Windmill Blade) needs to be printed 12 times for the 12 blades.

Step 5: Assembling and Painting Your Parts

Part 1:

Start with taking the 12 blades and sanding them down on one end and fitting them into the slots of the windmill head. This will take some time and once you have all the blades fitting nicely into the slots start to put super glue on a single blade and sliding it into place and letting it dry before you put the next blade in.

Part 2:

Now you paint all the parts with white acrylic paint as a base coat so the colors lay on well and for the house it will prevent any light shining through the print.

Part 3:

Paint your parts with the colors of your choice I decided to go with a brown for the windmill and a metallic silver for the blades, head, shaft, and spool. For the house I went with beige walls, a grey roof, brown window trim, and a red chimney.

Part 4:

Now that the parts are all painted you need to slip the top rod through the top spool onto the windmill base and then slip the windmill head with blades on to the end of the top shaft.

Part 5:

Super glue the motor shaft 3D printed part to the shaft of the stepper motor.

Step 6: Layout Your Landscape Design

During this step you take all of your landscape pieces (trees, bushes, etc.) and the house and windmill and place them where you want them to be on the top plate of the box and trace their position with the pencil. You will also want to trace out where you want things like roads or crop fields. After this you will want to trace around the 4 LED's that you want in the house, mark the center of where the 4 legs of the windmill base are, and trace the hole where the photo-resistor will go.

Step 7: Modify Your Box

Part 1:

Start by drilling out the holes you marked for your LED's. Don't go to big or it will make gluing the LED's in straight very difficult.

Part 2:

Drill out the hole for the photo-resistor. Once again don't go to big or it will be hard to glue in place later on.

Part 3:

Drill out a hole in the middle of the 4 legs of the windmill base where you marked in the last step. It will help to slot this hole slightly in the direction perpendicular to the way the head of the windmill points.

Part 4:

Now take the charging block you are going to use and trace the prongs onto the long side of the box towards one of the ends.

Part 5:

Slot out these lines with the drill but be careful not to drill to much or you a drill bit that is too big. You want the prongs to fit snug.

Part 6:

Push the prongs of the charging block out of the 2 slots from the inside so that the prongs are sticking outside the box. Apply super glue to the face of the charging block that is touching the inside face of the box.

Part 7:

Take the extension cord and apply glue to the face with the holes in it and plug it into the prongs of the charging block that are sticking outside the box and hold the charging block firmly when plugging the 2 together.

Step 8: Create Your Landscape

This is where you have the freedom to make this project your own. The endless possibilities on the different routes you could take with this step. You could have a snowy landscape with white frosted evergreen trees, a swamp setting with cypress trees and cattails, or even a deserts scene complete with cacti. I decided to go with a standard farm house setting with a corn field so I will go over my process for creating this scene.

Landscape Materials: You can find these at your local hobby store or craft store and online.

1. Model train ground cover granules in both earth and green turf colors.

2. Model train scale trees. X5 (basic oak)

3. Model train scale corn. X30

Part 1:

Take the spray adhesive and spray the areas where you want the grass to be spread the green turf ground cover. You will have to spray and spread multiple times to achieve complete and full coverage.

Part 2:

Take and cut hot glue sticks in half long ways so that the are semi-circles. These are for the rows of corn so also cut them to the length the rows need to be for the field.

Part 3:

Take the butane torch and heat up the bottom of the glue stick pieces from part 2 and place them where you want the rows of corn to be.

Part 4:

Take the torch and heat up the individual spots where you want to place the corn stalk and push the stalk down into the hot glue. Repeat this for all 30 stalks of corn.

Part 5:

Now use the spray adhesive and the earth ground cover to fill the spots where you want it to be dirt just as you did for the grass in part 1.

Part 6:

Now to cover the bottom of the trees with a ring of dirt you spray the plastic bottom with the spray adhesive and roll it in the earth ground cover and push the earth ground cover only on the top of the base.

Part 7:

Now use the super glue to glue down the trees and bushes but not the house or windmill.

Step 9: Final Assembly

Now Finally the final assembly. Here you will make the last few modification and assemble the complete project.

Part 1:

Take the hot glue gun and glue in the 4 LED's and the photo-resistor so that they sit flush and level.

Part 2:

Use the super glue to glue the house down around the LED's and on the outline you drew in step 6.

Part 3:

Now use the super glue to glue down the windmill base to the marks outlined in step 6.

Part 4:

Now you will take the 1.5'' metal shelf bracket and super glue it to stepper motor. (see image 2)

Part 5:

Now you will hot glue the 1.5'' metal shelf bracket to the bottom of the lid so that motor shaft line up with the top spool. This may take several attempts to line up correct which is why we use the hot glue so you can reheat it and remove. To test if the motor shaft and top spool are aligned put the rubber band on and allow the windmill to spin for a few minutes and if the rubber band doesn't then it is aligned. If it falls off then it is not aligned and needs to removed and re-positioned. (see image 2)

Part 6:

Now just plug the Arduino into the charging block inside the box and set the Arduino down into the bottom and set the breadboard down into the box right next to the Arduino. (see image 3)

Part 7:

Now just set the top plate of the box down onto the plate and screw down the 4 screws in the corners.

Part 8:

Set up on desk or end table and let it run.

First Time Authors Contest 2016

Participated in the
First Time Authors Contest 2016

Design Now: 3D Design Contest 2016

Participated in the
Design Now: 3D Design Contest 2016

Arduino Contest 2016

Participated in the
Arduino Contest 2016