My code for task 1 is linked below. motor-lab.ino
contains the code to rotate the servo and stepper motors, and the lab-diagram.jpeg
displays the task 1 circuitry.
cpsc334/kinetic-sculpture at master · sienacizdziel/cpsc334
<aside> 💡 For this project, I worked together with Ansel and Sachi to build a kinetic sculpture!
</aside>
Since we had so many motors as a group, we wanted to create something that would really take advantage of all the motors we had. After some brainstorming, we settled on the idea of creating a diorama of a day/night cycle. Because there are so many moving parts in a diorama, we had the freedom to get creative with what we wanted to add into our diorama, from spinning stars to a rising and setting sun to a person walking from end to end. We wanted a kinetic sculpture that would move seamlessly from state to state, capturing the passage of time in the sky.
An image of (one of the pages of) our brainstorming sketches
In the initial stages, we divided our work and spent time on our own getting our tasks done, before meeting back up in the CEID a few days later to put it all together into the box enclosure. On my end, I was to create and code the mechanisms for the clouds and curtains. Ideally, the clouds would always move up and down slightly, and the curtains would open and close depending on night (open, to reveal stars and moon) or day (closed, to hide stars and moon).
To start, I found a way to power my stepper and servo motors using the 12V wall power given to us in class. To do this, I used a linear voltage regulator that brought the voltage down to 5V.
I also learned how to do multithreading in Arduino, which came in handy once we had to get multiple motors moving simultaneously off of a single ESP32.
For the clouds, I drew and cut out cardboard clouds and hung them using blue yarn from a servo, which was extended a bit with two toothpicks (see image below).
For the curtains… after some brainstorming, I decided to 3D print (my friend helped me out with this, since I’d never used openSCAD before) two rails for the curtains to slide across. They had slits in them, which I put a screw into, and then hot glued that screw to a string connected to a popsicle stick, which was then connected to a servo. If the servo moved quickly back and forth from 0 to 180 degrees, it created enough torque and rotation to pull the screw along the rail back and forth.