Saturday, January 19, 2013

Using the Microcontroller

The first thing to do this time was to start hacking my robotic toy. 


I got a Hexbug.

I tore out its guts and went straight for the motor leads, soldered them to appropriate gauge wires, then attached it to my breadboard.
My motor requires very small voltage, so I used three diodes in series to reduce the 6 volts I was getting from my power supply.

I removed its wheels. Haha.

Next, I needed to learn how to use transistors to control the large voltage of the power supply with the small voltage of the microcontroller. Transistors can be chained in a "Darlington arrangement" to effectively create a more sensitive transistor that controls a larger current. 
I managed to use transistors and the microcontroller to light up a holiday light, which requires much more current than an LED.

 The two black components are transistors in a Darlington arrangement.

The controller activates the transistor's "base" which allows the larger current through the transistor.
The arrangement I created can be replaced with a specialized transistor component that houses the same arrangement.

 Ignore the green wire and small transistor.  :(


Then I switch out the light for my Hexbug. I can control the speed of its motor by varying the voltage it receives. The Launchpad allows me to output an analog voltage (0% - 100%) to the resistor, which in turn, sends about the same relative voltage to the motor.

My program cycled between slow and... extra slow.


No comments:

Post a Comment