C10: Arduino / RPi Pico Advanced – Actuator Interfacing

Aim:
To use Arduino or Raspberry Pi Pico to rotate a servo motor when a button is pressed.

Requirements:

  • Arduino or Raspberry Pi Pico

  • Servo motor

  • Push button

  • Breadboard & jumper wires

  • Arduino IDE (for Arduino) or Thonny (for Pico)

Procedure:

  1. Circuit Connections

    • Connect the servo motor’s signal pin to pin 9 (Arduino) or GP15 (Pico).

    • Connect the servo’s VCC to 5V (Arduino) or 3.3V (Pico).

    • Connect the servo’s GND to the microcontroller’s ground.

  2. Button Setup

    • Place the push button on the breadboard.

    • Connect one side of the button to 5V (Arduino) or 3.3V (Pico).

    • Connect the other side to a digital pin through a pull-down resistor to ground (ensures the button reads LOW when not pressed).

  3. Upload the Code

    • Write a program that:

      • Reads the button state (pressed or not pressed).

      • If pressed → rotate servo from 0° to 90°.

      • If not pressed → move servo back to .

  4. Test the System

    • Press the button and observe the servo movement.
    • Release the button and check if it returns to its original position.
Fill in the form for S’O’A Fablab Orientation 2021.