Week 4: Microcontroller Programming
The assignment for this week was to program something with a microcontroller.
The Design
As alluded in the previous week's documentation, I am continuing my work with the blinking cyclopse for this week.
In addition to improving the physical aspects of the sculpture, I used this week to focus my energy on leveraging the microcontroller to control the blinking.
Mechanical Improvement
Before jumping straight into hooking up the motor to the microcontroller, I set my sight to improving the existing mechanics of the kinetic structure.
I was not completely satisfied with with the range in motion I achieved on the eyeball from the past week so saught for new solutions.
After multiple iterations, I concluded on a smaller gear (I realized that the larger gear was increasing the size of the mechanism without increasing much of motion of the eyeball) and an elongated slot on the second arm so that the wire attached to the eyelid could move more freely.
Additionally, I manipulated the wire such that the cams mechanism would be guarded from folding into itself:
Final movement:
Micontroller Programing
With a motor driver, it was fairly simple to convert the motor system to work compatibly with the arduino.
In addition to just a motor, I added a button that would turn the motor and a led simutaneously on when clicked once and turn back off when clicked again.
However, I wanted to shrink the microcontroller system so that all the electronics fit neatly inside of body of the box.
I turned towards the SEEEDSTUDIO XIAO microcontroller, which was the smallest microcontroller we had on hand, and adapted the mechanical system with the following code below:
(For those wondering how I got my
arduino sketch neatly embedded into my documentation)
schematic for electrical circuit:
Next steps are soldering all these components together so that all of the wires fit nicely into the body as originally planned.