Spinning with motors
Since motors often require more power than a microcontroller can provide, the labs start by instructing us how to safely power a DC motor from a 12V DC power adapter. Based on the diagram below, I see this circuit broken down into two parts - the potentiometer connected to an analog pin on the microcontroller, and the DC motor connected to a digital pin on the microcontroller. The potentiometer connection is pretty straight forward, so lets focus on the motor portion. The motor is connected to the microcontroller through a transistor to regulate the voltage, which I assume is to prevent the microcontroller from getting burnt out by the 12V supply to the motor?
To change the direction in which the motor spins, we incorporated a motor driver H-bridge into the circuit. The h-bridge was more complex than the other things we worked with thus far, so I mainly followed the diagrams and tinkered with the code. I'd like to think that when more time is allowed, I will come back to this lab and understand the system a little better. Below are some "attachments" I added to the motor in attempt to better see the motor movements. In the middle, I used blue painter's tape. The program that was loaded to the microcontroller set up the motor in a way that when the switch was pressed, the motor would spin faster. It worked, but I also realized when painters tape spins very fast, it almost turns into a blade and has almost cut me a few times... So I decided to tie a deflated balloon to the motor for the next exercise. In this program, I created some boolean variables so that when the switch was pressed, it would change the direction of the motor. This was much less dangerous, and honestly, something about the balloon was so comedic, Devon and I could not stop laughing as we watched is spin. Okay, so the question I had about the diode.
I found some conflicting information on the lab graphics - In the wiring diagram (bottom left image), it says that the 1N400x diode's anode is connected to the collector, and its anode is connected to the ground. I assume the first instance of "anode" should actually say "cathode", correct? This becomes more confusing as at the next instruction is to connect the diode to the circuit correctly, but then provides more conflicting information. The schematic symbol and component representation match, but the caption says "The silver band on the diode indicates the anode end" which clearly is the opposite of the graphics provided. Comments are closed.
|
Blog posts and other documentation from NYU ITP classes
Categories |