# 15 - Servomotor + Potenciómetro

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

<figure><img src="/files/RBGnAEgTBRMrbdPJXzQO" alt="" width="396"><figcaption></figcaption></figure>

## **Introducción**

En esta práctica se implementa el control de giro de un servomotor a través de un potenciómetro. Se usa el módulo PWM para el control del servomotor y el módulo ADC para variar la posición por medio del potenciómetro.

## **Descripción**

En esta práctica se implementa el control de giro de un servomotor, a través de un potenciómetro. Se usa el módulo PWM para el control del servomotor y el módulo ADC para variar la posición por medio del potenciómetro conectado a las tarjetas **UNO**, **MEGA** o **NANO**.

#### **Materiales:**

1 x Tarjeta **UNO**, **MEGA** o **NANO.**&#x20;

1 x Potenciómetro de 10K Ohms.

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/KHsn4Kx5tcbjIere7byN" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="MEGA" %}

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

{% tab title="NANO" %}

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

## Código

{% tabs %}
{% tab title="Proyecto Arduino" %}
{% embed url="<https://gist.github.com/microside-mx/77a6eda6c9b9e37e4d18807d76fb5cca#file-15-servomotorypotenciometro-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/15-servomotor-+-potenciometro.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.
