# 14 - Servomotor

> **Arduino IDE**
>
> [**UNO / MEGA / NANO**](https://docs.microside.com/practicas/arduino-ide)

<figure><img src="/files/cwqZ88gHziJxGQf6N6F5" alt="" width="225"><figcaption></figcaption></figure>

## **Introducción**

En esta práctica se implementa el control de giro de un servomotor usando el módulo PWM. El servomotor podrá girar a las siguientes posiciones: 0°, 90° y 180°.

## **Descripción**

En esta práctica se implementa el control de giro de un servomotor usando el PWM de las tarjetas **UNO,  MEGA** o **NANO**. El servomotor podrá girar a las siguientes posiciones: 0º, 90º, 180º.

#### **Materiales:**

1 x Tarjeta **UNO**, **MEGA** o **NANO.**

1 x Servomotor SG90.

1 x Juego de cable Dupont.

1 x Protoboard de 830 puntos.

1 x Cable micro USB.

#### **Software:**

Windows 8.1 o posterior.

Arduino® IDE. [**Descarga**](https://www.arduino.cc/en/Main/Software)

## &#x20;**Procedimiento**

1. En el apartado de “[**Diagrama Esquemático**](#diagrama-esquematico)” selecciona el modelo de tu tarjeta, realiza las conexiones que se muestran en la imagen y conéctala a la computadora.
2. Ejecuta el software **Arduino® IDE**, crea un nuevo proyecto con el código fuente que se encuentra en el apartado "[**Código**](#codigo)" y compila el programa.

{% hint style="success" %}
Si tienes dudas de cómo realizar los pasos anteriores puedes encontrar un manual de **Arduino® IDE** a través del siguiente [**link**](https://docs.microside.com/practicas/ides/arduino-r-ide).
{% endhint %}

3. Al terminar de programar, el módulo se reiniciará y el programa de esta práctica se ejecutará.

## Diagrama esquemático

{% tabs %}
{% tab title="UNO" %}

<figure><img src="/files/aX7psNn7vZjY5p0xbXyR" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="MEGA" %}

<figure><img src="/files/MUgdU04eHSJtto3WfwhV" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="NANO" %}

<figure><img src="/files/zfFe5rPGjQIzsTKaE1BG" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Código

{% tabs %}
{% tab title="Proyecto Arduino" %}
{% embed url="<https://gist.github.com/microside-mx/1ff387d367faa816bac0d08720acaef2#file-14-servomotor-arduino-ino>" %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.microside.com/practicas/arduino-ide/14-servomotor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
