Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO and PCA9685 Controlled Robotic Arm with Bluetooth and Audio Feedback

View and Edit Project In Cirkit DesignerImage of Arduino UNO and PCA9685 Controlled Robotic Arm with Bluetooth and Audio Feedback

Circuit Documentation

Summary

This circuit is designed to control multiple servos, DC motors, and a DFPlayer Mini module using an Arduino UNO. The circuit also includes a Bluetooth module for wireless communication. The Adafruit PCA9685 PWM Servo Breakout is used to control the servos, while the L298N DC motor driver is used to control the DC motors. The DFPlayer Mini is used to play audio files, and a loudspeaker is connected to it for sound output. The circuit is powered by two 9V batteries.

Component List

  1. Adafruit PCA9685 PWM Servo Breakout

    • Description: 16-channel PWM driver
    • Pins: 5.0V, GND, PWRIN, PWM0-PWM15, VCC, SDA, SCL, OE
  2. Servo

    • Description: Standard servo motor
    • Pins: GND, VCC, PWM
  3. Arduino UNO

    • Description: Microcontroller board
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13
  4. 9V Battery

    • Description: Power source
    • Pins: +, -
  5. DC Motor

    • Description: Standard DC motor
    • Pins: pin 1, pin 2
  6. L298N DC Motor Driver

    • Description: Dual H-Bridge motor driver
    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
  7. DFPlayer MINI

    • Description: MP3 player module
    • Pins: VCC, BUSY, RX, USB -, TX, USB +, DAC_R, K2/ADC_KEY, DAC_L, K1/ADC_KEY, SPK1, IO 2, GND, SPK2, IO 1
  8. HC-05 Bluetooth Module

    • Description: Bluetooth communication module
    • Pins: Key, VCC, GND, TXD, RXD, State
  9. Loudspeaker

    • Description: Standard loudspeaker
    • Pins: pin1, pin2

Wiring Details

Adafruit PCA9685 PWM Servo Breakout

Servo

Arduino UNO

9V Battery

DC Motor

L298N DC Motor Driver

DFPlayer MINI

HC-05 Bluetooth Module

Loudspeaker

Documented Code

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <SoftwareSerial.h>
#include "DFRobotDFPlayerMini.h"

#define SERVOMIN  150  // Valor mínimo para el pulso del servo (0°)
#define SERVOMAX  600  // Valor máximo para el pulso del servo (180°)

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
SoftwareSerial BT(10, 11); // RX, TX (Conecta HC-05 a estos pines)
SoftwareSerial DFPlayerSerial(8, 9); // TX, RX (Conecta DFPlayer Mini a estos pines)

DFRobotDFPlayerMini myDFPlayer;

const int motor1_IN1 = 3;
const int motor1_IN2 = 4;
const int motor1_ENA = 2;

const int motor2_IN3 = 5;
const int motor2_IN4 = 6;
const int motor2_ENB = 7;

int velocidadMotor = 128; // Velocidad de los motores DC (media)

int velocidad180 = 90; // Para servos de 0 a 180 grados
int velocidad90 = 45;  // Para servos de 0 a 90 grados
int velocidad135 = 67; // Para servos de 0 a 135 grados

bool motor1Controlado = false; // Estado del botón para motor 1
bool motor2Controlado = false; // Estado del botón para motor 2
bool motor1Sentido = true; // Sentido del motor 1 (por defecto sentido "x")
bool motor2Sentido = true