I want to use a 90 degree servo, and make it as simple as humanly possible. press button, servo moves and remains there, press button again, servo moves back in to position. what do i need?
A 90 degree servo, a button and a H bridge would work? HG7881 this H bridge
Do you have the specifications for the servo?
If you are looking for hobby servo control, here is a well-written article with some example code:
Hello, yes, 4.8-6V, 3 pin connector
Connect your Arduino, power supply and servo and Arduino like this... the DATA wire will be connected to the Arduino pin that you declare in your sketch (Pin 9 in the example, below).
Because your Servo is 4.8vdc to 6vdc, you need a 5vdc power supply. Connect the power supply 5vdc to the Arduino 5V pin, and to the power wire on the Servo. Connect the power supply Ground wire to the Ground pin on the Arduino and the Ground wire of the Servo

The basic Servo sketch on the linked page looks like the following to move the Servo to 0 degrees.
#include <Servo.h> // the Servo library
Servo myservo; // create a Servo object to control a servo (from the Servo library)
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
myservo.write(0);
}
The referenced link also showed how to move the Servo to 90 degrees...
myservo.write(90);
Now, you need a push button.. here is an example...
After you get the Servo to work, then the button to work... show your progress here.
Why a H-bridge? A servo is directly powered from a power supply and controlled from the Arduino.
Did you do your research first and understand what a servo is and how it works?
- An UNO
- A servo
- 5V power supply for the servo or 4AA batteries
In your code, use the Servo library.
Examples in the IDE, details on wiring on the manual page (and many other instruction pages can be found on the Internet - you just have to do some googling).
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.