Week 9 - Outputs

Solo Assignment

This week, I decided to learn how to use servos and motors. I also bought a solenoid to experiment.

Coding the servo

Using richards code and other tutorials on youtube for reference, I created this code below.

I used my board from week 8 to program the servo.

Watching the servo move

Electric Solenoid being used as a piston

I wanted to control an electric solenoid with my board but the power needed to run it was more than 5 volts so I used a 9V battery to see if the idea was possible still.

Later on, I hope to dive into H-Bridges and be able to apply 9v controlled by my 5V board.

After a bit of thinking, I decided that rather than an H-Bridge to create a motor driver, I could use transistors to change the flow and output of power from the 9V to the piston.

Controlling a motor

When you need to control a motor, there is a current spike that your regular board cannot handle. In order to solve this dilemma, motor drivers were created to house capacitors and introduce exterior power sources to your motors while still being controlled by the PCB board or whatever.

In order to be ready for both my final project and machine week, I chose to use a CNC shield to drive a Nima 17 stepper motor. Below is the video and code for the stepper motor I got from mechatronics.

Why I want to make a fire out of stepper motors

So, for some reason, whenever I try to do my own thing without arrays or use other tutorials online, my stepper motor just vibrates. ya, like it goes clockwise 1 step but then counterclockwise the next step. Not gonna lie, its making me want to put it in a fire and burn all of it. I go more in-depth into my pain in week 10 if you have some time to sit around and listen to pure suffering.

Group Assignment

Group Site

Reflection

This week taught me how to use servos, the requirements for a solenoid as well as the fact that they are not usually intended to work as pistons, and started me on my path of motor drivers. Next week, I plan to dive more in-depth into how the motor works and make a machine with it.