Mood Cue: Using a potentiometer to turn a servo to where I want

    This project was based around turning a servo motor a certain amount based on how we twisted a potentiometer. This was a very simple circuit to build, with the only three big parts being the servo, potentiometer, and the capacitor. The potentiometer is connected to the A0 pin, and the servo is connected to the ~9 digital pin. 


    The capacitor is meant to take care of voltage dips that could occur by smoothing them out. The potentiometer reads the angle on an analog basis, which is why it is attached to the analog output. We needed to use the male header pins to connect the servo to the board, which gave me pause for a minute because I didn't realize you could move the black plastic pieces down to even out the sides.


    The code for this project was super simple, just mapping the angle from the potentiometer to the servo, and changing the angle based on how much it is spun. The code also outputs the current angle based on how far the potentiometer is spun, shown below.



    This project has been the most fun so for. I found the color changing light and heat sensor projects really hard to control, and the first two were just super simple. But this one was simple to do, and had a really satisfying conclusion when I finished it. It was a fun project to complete, and also play around with!








Comments

Popular posts from this blog

Final Project: Reusing the Snake board design to create Tetris with the Arduino

Art Meets Engineering: Using an Arduino compatible microphone to create light based on sound