Thursday, October 4, 2007

Analog Out/Servo Control Lab


Here's a small snapshot of my analog out/servo control lab. For my variable resistor, I used a pot rather than anything super fancy like a photosensor, but the results were the same nonetheless. When the pot was fully counter-clockwise the resistance was 0ohms and therefore the analog output to the arduino was essentially 5V. As I moved the pot clockwise, the output voltage to the arduino approached 0V, and thus moved the servo clockwise.

I tried to get creative with this assignment and I imagined a scenario where I could implement a servo like this. I was talking to someone around ITP and he said, "use the servo to open or close something." Since my mind has lately been in my kitchen, specifically improving my efficiency in kitchen appliances, I thought of my garbage can (I know, not really an appliance, but follow me on this one). I have one of those garbage cans that opens when you step on the mechanical lever. I thought, why not replace the lever with a push button or some type of sensor pad so that it sends a pulse to the arduino (let's say a 5V pulse), and then goes through a loop (starting with minPulse=500 and going to maxPulse=2500). With a little help from Hans I sort of figured out how to write this function into the code, however I am still working out the kinks. I posted a video of me activating the servo with a pushbutton. My main obstacle to get over is my lack of programming experience. My background is more centered in electronics, but I would like to make my job easier in the analog domain by figuring out some coding. More to come on the code topic...

No comments: