Servo micro switch

Good day. Help with the solution of this issue, is it possible to control the servo using a micro switch through arduino??? There are many options for conventional motors, but there are none with servos.



And how to connect them so that it is possible to control servo motors with a micro switch connection as in the photo???

You posted your question in the incorrect section of the forum. This section is for problems using the Arduino IDE version 1.x to upload sketches/code to your Arduino.

I will move your question to a more correct forum section.

Hi @vanjah,

can you explain what you want to do in some more words?

A general answer is "yes, of course you can control a servo using a micro switch.", but that does quite likely not help you, does it?

What do you want to control:

  • Switch servo on/off manually?
  • Switch servo on/off when it has reached a certain position?
  • Use the switches as emergency switches?
  • Shall the switches directly cut off power to the servo or just give a signal to a controller?
  • Shall the switches (handled by something else but the servo) control where the servo shall be pointing to?
  • ...

Not true. Search for "Arduino useless box".

Surely possible. Been there done that.
Press button, servo moves to a specific position. Release button, servo moves back. Easy. Can be done in a single line of code.

1 Like

All of these options are suitable for my desire to learn how to connect and program.
But from the very beginning I am interested in this information: 1 servo has 180 degrees, let’s say I set it to 90 in the code, when I click 1 the servo switch should move to the 60 degree position, then if I press 2 the servo switch should return to the advance position that I set in the code to the same 90 degrees

Your explanation seems to say that you are using the micro switches like buttons.

Is that true?

If I understood correctly how it works, there is a wheel on the micro switch when pressed, does a certain thing that is connected turn on? Does it work a little differently?
I have never worked with it, so I don't understand it well.

The micro switches you posted work exactly like buttons or others switches .

The difference is only the mechanism that presses the switch.

see here for further details:

https://www.elecrow.com/blog/everything-you-should-know-about-micro-switch.html

or here

https://metrol-sensor.com/solution/87732/

A microswitch, like all kinds of (momentary) switches, does one thing: make and break a circuit. No matter how it looks like, or whether there's a foot pedal or huge round red dome or whatever attached to it. For that matter they all work the same, regardless of how they look.

Need some code examples and pictures on the arduino with the given micro switch and servo connection on the arduino board.

Search for an example sketch that uses buttons and post it here so that I can tell you the changes required for micro switches, ok?

Examples on reading buttons are in the IDE!
Please do at least some of your own homework.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.