# 03 - Servo Motor

![micro:bit connected to a servo motor](https://2550165886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fyb2qmcYgqwLw68em5mST%2Fuploads%2F8DdQIdHda4P9Nj8Y8O7j%2FScreen%20Shot%202022-08-06%20at%207.32.17%20PM.png?alt=media\&token=a031d677-af2b-46da-985f-cfb4e47d38e5)

Electric motors are great, they move many of the devices we have in our daily lives.  We find them in things like blenders, washers, dryers, drills, cars, garage doors, pumps and many more.  They are also part of one of the tools we are using, the **Servo Motor or Servo**.

**Servos** are electrical devices that rotate a part of a machine providing predictable, repeatable and precise movement. Think of them as motors that you can spin with precision, controlling speed and placement.

Servos do have electric motors in them, but they also include other parts that allow them to be moved to specific angles, positions and velocities.  We will control our **servo motor** using a **micro:bit**, with instructions created on **MakeCode**. &#x20;

All is coming together, we can write **code** to represent **data** about **climate** **change** using an **external** **device**.  In this case the **servo** **motor**!

<details>

<summary>Connecting a Servo Motor to a micro:bit</summary>

&#x20;                                 ![](https://2550165886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fyb2qmcYgqwLw68em5mST%2Fuploads%2FBEIqP6A2RPDu93nHGgs4%2Fconnect_servo.png?alt=media\&token=ae789ed9-fbb1-4e92-b866-0858a0597226)

Servo Motors usually have three cables, **Signal**, **Ground** and **Power**. &#x20;

* The **Signal** wire carries the information from our micro:bit to the servo, telling it when and where to move.
* The **Ground(GND)** wire provides a way for excess electricity to flow safely.  The Ground wire only acts when there is a problem with the electrical system.
* The **Power** wire, as the name implies, carries the electricity for the device to run.  In this case, for the servo motor to turn

</details>

In the next section, we code our first servomotor.

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f34e">🍎</span>Teacher's Corner - more about Servos</summary>

For more in-depth resources about servo motors, check the following links:

* Video - [Behind the MakeCode Hardware - Servo Motors with micro:bit](https://www.youtube.com/watch?v=okxooamdAP4\&list=PLMMBk9hE-SeqDYtw9pGNPsQ10V_EGMyGe\&index=8)
* Video - [Connecting a servo motor to the micro:bit](https://www.youtube.com/watch?v=qdX86in2YXo)
* micro:bit guide - [MakeCodeUsing a servo with the micro:bit](https://support.microbit.org/support/solutions/articles/19000101864-using-a-servo-with-the-micro-bit)
* Servos guide - [Servos - A Brief Guide](https://resources.kitronik.co.uk/pdf/a-brief-guide-to-servos.pdf)

</details>
