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

Arduino Uno Robotic Arm with Joystick Control and Flex Sensors

View and Edit Project In Cirkit DesignerImage of Arduino Uno Robotic Arm with Joystick Control and Flex Sensors

Circuit Documentation

Summary

This circuit is designed to control multiple servos using an Arduino Uno R3 microcontroller. It includes a 16-Channel PWM Servo Driver to manage the servos, a 16x2 I2C LCD for display purposes, and several sensors including flex resistors and joystick modules. The circuit is powered by a pair of 18650 Li-ion batteries regulated by an XL4016 module.

Component List

Arduino Uno R3

16-Channel PWM Servo Driver

16x2 I2C LCD

Servo (Wokwi Compatible)

Servo

Tower Pro SG90 Servo

2.2 inch Basic Flex Resistor

KY-023 Dual Axis Joystick Module

XL4016

18650 Li-ion Battery x 2

Resistor

Wiring Details

Arduino Uno R3

16-Channel PWM Servo Driver

16x2 I2C LCD

Servo (Wokwi Compatible)

Servo

Tower Pro SG90 Servo

2.2 inch Basic Flex Resistor

KY-023 Dual Axis Joystick Module

XL4016

18650 Li-ion Battery x 2

Resistor

Code Documentation

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <LiquidCrystal_I2C.h>

#define SERVOMIN 102  
#define SERVOMAX 492  

int joystickMG995Pin = A0;  
int joystickMG90Pin = A1;   
int joystickSG90Pin = A2;   
int flexPin = A3;
int flexPower1 = 4;        
int flexPower2 = 5;         
int flexThreshold = 110; 
int flexThreshold2 = 130;   
int servoMG995Channel = 0;  
int servoMG90Channel = 1;   
int sg90Channels[5] = {2, 3, 4, 5, 6};

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

LiquidCrystal_I2C lcd(0x27, 16, 2); 

int bendCount1 = 0;       
int bendCount2 = 0;        
bool isFlexed1 = false;    
bool isFlexed2 = false;

int currentMG995Angle = 0;
int stepDelay = 8;

void setup() {
  pwm.begin();            
  pwm.setPWMFreq(50);      
  Serial.begin(9600);      

  pinMode(flexPower1, OUTPUT); 
  pinMode(flexPower2, OUTPUT); 
  
  lcd.begin(16, 2);
  lcd.backlight