IOT: Outfit Assembler Cardstock Spinning Farris Wheel Takes Daily Temperature From OpenWeatherMap API Mr Law Physical Computing Class by Logan Silvers

by lsilvers in Circuits > Assistive Tech

268 Views, 1 Favorites, 0 Comments

IOT: Outfit Assembler Cardstock Spinning Farris Wheel Takes Daily Temperature From OpenWeatherMap API Mr Law Physical Computing Class by Logan Silvers

Screenshot 2023-01-25 1.41.32 PM.png

HI! today we are going to build a farris wheel clothing carosel! it will give you a randomized outfit depending on the temperature for the day - for instance if it is 46° outside you would wear something that is coldish - so it would choose an outfit from outfits 5-8 which we will get to near the end of the project.

this project was assembled by a high school senior - so please be patient with me! this is an example of trusting the process.

What does this do? The sides spin around once a day (or once every 30 seconds) to give you a randomized outfit based on the temperature.

Supplies

For this project you will need:

1x Argon https://www.adafruit.com/product/3997

4x Short 3'' Wires

12x Long 8-10'' Wires

1x External Power supply / DC barrel jack adapter for breadboards https://www.sparkfun.com/products/10811

1x Wall Adapter / Power supply https://www.sparkfun.com/products/15312

1x 28BYJ-48 Stepper Motor https://www.adafruit.com/product/858

2x flat / thin cardboard around 12x8" (to make the top and bottom of a box)

8x smaller thick cardboard that matches the width of the thin cardboard (to make the sides of a box)

Paste This Code Into Your Argon

Screenshot 2023-01-24 10.24.52 AM.png
Screenshot 2023-01-24 10.25.44 AM.png
Screenshot 2023-01-24 10.26.22 AM.png

https://go.particle.io/shared_apps/63c0482967075c0009f4b1a8

You can find the code at this link ^ or in this text document :


Log into your particle account and create a new project, go into the link or text file below and copy and paste all of the code into your particle project you just created. While your argon is plugged into your computer, press the lightning bolt in the top left corner to flash your code onto your argon.


this isnt super important but if youre curious heres basically what the code does:

  • checks time every milisecond
  • if milisecond we are currently at - milisecond since the last time the code ran = amount of miliseconds you want to have between each time the thing runs
  • check the temperature and get a number
  • if the temperature is cold = cold is true
  • if the temperature is kind of cold = its kind of cold
  • if the temperature is warm = its warm
  • if its cold out = randomize outfits 0-4
  • if its kind of cold = randomize outfits 5-9
  • if its warm = randomize outfits 9-12
  • record the current milisecond

Set Up Your Webhook

Screenshot 2023-01-24 1.56.56 PM.png
Screenshot 2023-01-24 1.56.08 PM.png
Screenshot 2023-01-24 1.58.11 PM.png
Screenshot 2023-01-24 2.01.08 PM.png

The webhook will collect the weather data every day

go to console - then integrations - then create a new webhook

click webhook and type in the following in the appropriete boxes:

Event Name: weatherData

url: https://api.openweathermap.org/data/2.5/weather?q=Chicago&appid=bda703fac1cb8525aaf64c55dfa86e91&units=Imperial

Open advanced settings and look to image four -

q : Chicago

appid : bda703fac1cb8525aaf64c55dfa86e91

units : Imperial


  • If you notice this imput is the same thing as the link for the url - if you want to set your own city, replace "Chicago" with your own city in the advanced settings AND inside the url - if you are having trouble finding it hit "ctrl F" on your keyboard and if you type it in the box that appears - it will highlight the word "Chicago" on your page - and then you can find "Chicago" inside of the url and replace it with the EXACT SAME lettering as your own city.

PAUSE

Now that we have the code set up for the stepper motor, the time, and the weather - we are going to start assembling the farris wheel and placing wires on the breadboard in order to make the things physically move! Lets start slowly and work up to assembling everything all together - we are going to start with the sides of the farris wheel which will be the parts that are actively turning.

Cut Out Two Circles From Cardstock With a Small Hole in the Center

IMG_6592.PNG

As you can see from the image, one third of the circle is dedicated to cold weather. One third is dedicated to coldISH weather, and the last third is dedicated to warm weather. The sides will spin around once a day and STOP somewhere in one of the thirds (labeled above) BASED OFF OF the temperature of the day.


You dont need to label them just yet if you dont want to for assembly purposes this early in the project - but it might be helpful to split the circle into 12 even spaces (split the circle into 4ths and split each of those fourths into thirds to make 12) because we will be labeling them LATER in this tutorial.

For the hole in the middle you might want to cut a tiny slip and then push it through the stepper motor so that you dont accidentally cut it too big.

Attatch the Cardstock to Your Stepper Motors

IMG_6596.PNG

I would tape down the cardstock or use a WEAK GLUE

We will be taking this off again later in the project

PAUSE

Now that we have our stepper motors prepped for the sides of the farris wheel - we are going to start building the physical components for our code that will allow the stepper motors to spin. Lets start!

Prepping the Breadboard

Screenshot 2023-01-24 10.31.43 AM.png

Make sure there is nothing on your breadboard except for your argon, and that your argon is placed kind of in the middle on the edge of your breadboard like the image here so theres at least one row of empty ports on each side. Connect the wifi router antenna thing to your argon as shown in the image, make sure the argon is NOT PLUGGED INTO YOUR COMPUTER.

Powering Your Farris Wheel

Power on the Argon With Your External Power Supply

Screenshot 2023-01-23 12.20.25 PM.png
Screenshot 2023-01-13 10.42.50 AM.png
Screenshot 2023-01-13 10.42.56 AM.png
Screenshot 2023-01-13 10.42.25 AM.png
Screenshot 2023-01-23 12.23.25 PM.png
IMG_6593.PNG

YOU WILL NEED ALL PHOTOS ATTATCHED -

CLICK SEE MORE PHOTOS BEFORE READING


youll need four shorter 3" wires


wire number one: ground : you are going to attatch a wire onto the edge of your breadboard closest to the sleeve of your power supply, the other end of this wire is going into your negative rail see the second to last image attatched, one half of the wire should be in the negitive rail, and the other half should be in the sleeve pin

wire two : power : connect this wire to the tip of your power supply, the other end of this wire is going into your positive rail, see the second to last image attatched, first half of this wire is going to the tip of your power supply, the second half is going into your positive rail

wire three: connect this wire from your negitive rail into your ground pin in your argon - should be labeled GND

wire four : IMPORTANT : connect this wire from your positive rail into your VUSB pin in your argon, it MUST BE VUSB OR BAD THINGS WILL HAPPEN TO YOUR ARGON


****WARNING:: you CANNOT connect your argon to a USB power source AND to an external power source at the same time. very bad things will happen to your argon and possibly your computer. make sure your argon is NOT physically connected to your computer.*****


Connect the wall adapter to an outlet and your DC barrel jack.


If you need help visualizing what the setup shoud be looking like right about now, see the last two images, the RED and BLACK wires in the last image are what we are currently setting up the red wire is the positive/power line and the black wire is the ground/GND/negitive line that makes your power supply complete the full circuit.

Making the Farris Wheel Spin Around

Connect Your Stepper Motors to Your Breadboard

Screenshot 2023-01-23 12.28.37 PM.png
Screenshot 2023-01-13 10.40.26 AM.png
Screenshot 2023-01-23 12.28.49 PM.png
IMG_6593.PNG

this is a lot of text, but it is very important to read if you want to understand how to build this, so bear with me.


intro:

with the longer 8-10" wires you are going to connect your stepper motors to your breadboard! this part is very difficult and extremely specific so if you need help visualizing see/maximize image four (the last image) before continuing. the stepper motors are the little circle things, and we are going to be connecting the wires to A2-A5 on your breadboard, pause to find out where these pins are now.

  • One of the stepper motors will be going in order from A2-A5, but the other stepper motor should be going backwards from A5-A2. it doesnt really matter which one is doing which - so long as one is going forwards and the other is going backwards. it looks like a lot of text in this thing but just remember to check in with image four if you ever get stuck, and try to visualize the circuits. the most important part is that INT1-4 stay in order when you are placing the wires on A2-A5 otherwise the stepper motor will not spin.


instructions:

you will need the

12 x long wires


lets start one at a time - take four of the long wires and set them aside / take two of the longer wires and set them also aside but seperatly from the four wires.

a) find the positive and negitive ports on your stepper motor as shown in image three. connect the negitive port to the negitive rail on your argon. connect the positive port to the positive rail on your argon. this will supply the power to your stepper motor.

b) now its time for the four wires you set aside earlier, connect one of the wires to INT 1 as shown in the first image and the other half of the wire to A2 on your argon as shown in image 2. Connect the second wire to INT 2 and A3. Connect the third wire to INT 3 and A4. Connect the fourth wire to INT4 and A5.

You should now see red LEDS light up on your stepper motor and start to spin, if not - check the positive and negitive rails to make sure the power supply is still connected.

Now we will connect the second stepper motor - take four of the long wires and set them aside / take the last two of the remaining longer wires and set them also aside but seperatly from the four wires.

2a) find the positive and negitive ports on your second stepper motor as shown in image three. connect the negitive port to the negitive rail on your argon. connect the positive port to the positive rail on your argon. this will supply the power to your stepper motor.

2b) we will connect the wires in a different order so read carefully. Connect the first wire from the four you set aside earlier to INT 1 as shown in the first image but connect the other half of that wire to A5 (DO NOT CONNECT INT 1 TO A2) Connect the second wire to INT 2 and A4. Connect the third wire to INT 3 and A3. Connect the fourth wire to INT 4 and A2.


Troubleshooting:

You should see both stepper motors have red LEDS and spin in opposite directions, if you dont see this happening you need to check in with your power rail and make sure your argon is not blinking - if this is happening see the instructions in the next step.

If your argon is not blinking and you see red LEDS but the stepper motors are not spinning -check in with the wires connencted to A2-A5 and make sure that they are not super loose/wiggling around. you may need to get new wires should the connection not go through completely.

If this still isnt working check in with your power rails (the positive and negitive rails with the external power supply running through them) make sure that your power supply is fully plugged into your breadboard and that the wires you are using to plug into the positive and negitive in the stepper motor are fully seated in the outlets on the stepper motor. It should be working now as there are no other problems i could fix from this instructables

Checkpoint: Look at Your Breadboard

Screenshot 2023-01-13 10.41.08 AM.png
IMG_6593.PNG

SEE ATTATCHED VIDEO


Hypothetically your machine you just built should look something like this: with the code you pasted from step one it should start running. If not, please take a look at your breadboard and make sure that

a) the power supply is plugged in and the tip goes to the positive rail and the positive rail to VUSB

b) the end goes to the negitive rail and the negitive rail goes to GND

c) both stepper motors INT1-INT4 are plugged into A2-A5

d) stepper motors negitive is connected to the negitive rail and positive is connected to the positive rail


If you are encountering an issue where your argon is blinking white and green or it just isnt turning on/blinking another color it is because the connection to power isnt fully protected, try swapping out the wires for larger ones and plugging them in or playing around with different open spots on your breadboard in the same row.

PAUSE

We are now going to build the actual farris wheel - I will walk you through the steps on how to assemble the farris wheel completely now that we have finished assembling the robot parts.

First we will create a box - this will be the base of our farris wheel.

Gather a Bit of Thicker Cardboard.

Screenshot 2023-01-23 11.55.15 AM.png
IMG_6594.PNG

So here I am holding a piece of very thick cardboard, this step is very flexible but basically these should be stacked on top of each other to make about 6" tall and 12'' wide walls for the sides of your cardboard box that we will build later. Gather a bunch of cardboard into one space or find cardboard like the one that I have here and continue on.

Get Two Flatter Pieces of Cardboard

Screenshot 2023-01-23 11.54.34 AM.png
IMG_6594.PNG

Here is a picture of a flat peice of cardboard, the rectangles don't have to be exact but they should be around the same size and ideally they would be around 12"x9".

Cut Out a Rectangle in the Top Peice of the Box

Screenshot 2023-01-23 12.01.31 PM.png
IMG_6594.PNG

Theres no real way to do this but in the picture you can see that the rectangular hole is large enough for the paper towel roll to fit through but not so big that the paper towel roll wobbles back and forth a lot. You want to try and experiment with this a little bit, my hole is maybe 1.5" x 2" big.

Hot Glue Cardboard Together to Create a Box

Screenshot 2023-01-23 11.59.09 AM.png
IMG_6595.PNG

Here is the image of my completed box from a 3/4th angled view. your box doesnt need to look exactly like this but it does need to be a base supportive enough to hold the paper towel tubes in the middle and high enough not to mess with any of the wires that are coming out of your breadboard.

PAUSE

Now that we have our base, we are going to build the pilar that holds up the farris wheel, and the bar that connects the two sides of the farris wheel together.

Cut Around the Top of One of Your Paper Towel Tubes and a Hole in the Center of the Other

Screenshot 2023-01-23 12.05.35 PM.png
IMG_6594.PNG

You can see this gnarly v shape divot in the top of my paper towel tube. I would cut something vaguely similar in the top of your paper towel tube because the point of the tube is to balance another tube on top of it. in the tube that you are balancing on top of it cut out a circle large enough to fit the stepper motors and wires through but smaller than the circumferance of the paper towel roll that you cut the divot in.

Insert Your Stepper Motor Into the Tube With the Hole in the Middle

Screenshot 2023-01-23 12.11.18 PM.png
IMG_6595.PNG

I hot glued mine to the sides as shown, you should attatch a stepper motor one on each side with hot glue or really strong glue so that it perminently sits there. I removed the paper circles from my stepper motors before I attatched them to the paper towel tube but if you would like to leave them on that is also okay - just know that you will have to attatch the paper circles back to the stepper motors after the glue has set if you removed them while you were gluing the stepper motors inside the tube.

Insert Breadboard Inside the Box

Screenshot 2023-01-23 12.13.26 PM.png

The wires should be attatched to the stepper motors and inside of the two paper towel tubes already so you should be able to just slide that breadboard inside your cardboard box no problem. if not, because the paper towel tubes are not attatched to anything but the stepper motors, try to un plug and replug in the wires so that the breadboard can go inside the box you just made.

Checkpoint: Look at Your Creation

Screenshot 2023-01-25 1.59.35 PM.png

I have attatched two videos here on what mine looks like so far.

Take Cardstock Circles Off the Stepper Motors and Attatch a Clocklike Circle

Screenshot 2023-01-13 10.51.54 AM.png
Screenshot 2023-01-13 10.51.49 AM.png
Screenshot 2023-01-13 10.52.02 AM.png

this is the part where you have to divide your circle into 12ths and I labeled a star on the top of my circle so I knew which one was the 0 starting point - I would also do this. You put cardstock over it so that the circle is a stronger material and it can hold up the decorations.

Reattatch to Stepper Motors

IMG_6596.PNG

Decorate Cardboard Tubes, the Cardboard Box, and Attatch Clothing to the Circles

IMG_6592.PNG

This is the part where you can go crazy with your project! feel free to decorate the farris wheel any way you like, attatched i included a picture of where the clothes are going to rotate depending on how cold it is outside - feel free to use it as a guide to attatching your outfits


here are some CREATIVE IDEAS to DECORATE YOUR FARRIS WHEEL!

  • paint the exposed carboard
  • put decorative paper over the sides of your project
  • place pipe cleaners inside or outside of the box
  • use glitter glue to make a spiral on the sides so that when it spins it looks like a spinning spiral
  • replace the cardstock with pinwheels

Checkpoint: Look at Your Final Project

Screenshot 2023-01-25 1.41.32 PM.png

Huzzah! we did it!

*OPTIONAL* Set Your Code So It Rotates Once a Day Instead of Every Minute

In your code in your particle project, find line 28ish it should say something like

"const unsigned long period = 30000; //the value is a number of milliseconds between the calls"

Delete this line and replace it with :

"const unsigned long period = 86400000; //the value is a number of milliseconds between the calls"

(obvisously without the quotation marks on it)

this will edit the call time so the function will excecute once a day.