Two-Wheeled Drive Car With a Robotic Arm

by Orange Digital Center in Circuits > Robots

639 Views, 6 Favorites, 0 Comments

Two-Wheeled Drive Car With a Robotic Arm

ff.png
5985633756087698295.png
ll.png

This project was developed within the Orange Digital Center Morocco , a space dedicated to fostering innovation, creativity, and rapid prototyping. At the FabLab, individuals and teams have access to state-of-the-art tools, including 3D printers, laser cutters, and a variety of electronic and mechanical resources. The center provides a collaborative environment where innovators, entrepreneurs, and students can transform their ideas into tangible products. By focusing on sustainable and impactful solutions .

This is a great beginner project for anyone to make! It is a robotic arm mounted on a Two Wheeled Drive vehicle designed to perform various manipulation tasks in dynamic environments. The base consists of a small robot car, often with rugged wheels for diverse terrain. The two main wheels are motorized for movement and steering. The arm, centrally mounted on the car’s upper structure for balance, features multiple motorized joints for movements such as rotation, bending, and extension, all controlled by servos.

Prepared by Ilyasse Ait Moulay Blla.

Supplies

1.png
Design sans titre (1).png
1000068462.jpg
5985633756087698337.png
5985633756087698336.jpg

Material Needed :

To start building a Two-Wheeled Drive Car with a Robotic Arm, the first step is to acquire the necessary hardware.

  1. Breadboard – A board for making temporary circuits without soldering.
  2. Bluetooth Module (HC-05 or HC-06) – For wireless communication using Bluetooth.
  3. L293D Motor Driver – Used to control the direction and speed of motors.
  4. PCA9685 Servo Driver – A 16-channel, 12-bit PWM driver for controlling multiple servos or LEDs.
  5. SG90 Servo Motors (x5) – Mini servo motors commonly used in robotics.
  6. Arduino Uno – A popular microcontroller board based on the ATmega328P.
  7. On/Off Switch – A basic switch to control power to a circuit.
  8. DC Barrel Jack – For power input, used with Arduino boards.
  9. 18650 Li-ion Batteries (x2) – Rechargeable lithium-ion batteries, each rated at 2200mAh and 3.7V.
  10. 2-Wheeled Robot Car Kit – It includes components to build a basic two-wheeled robot with motorized wheels and a balancing caster wheel.
  11. 3D Printed Robot Arm – It consists of 3D-printed parts. We will provide the STL files for the 3D models in the 3D modeling section

Operating the Two-Wheeled Drive Motors

Copy of arduino l293d Motor driver ic.png

Connections:

  1. Powering the L293D:
  2. Connect the VCC1 pin (Pin8) of the L293D to the 5V pin on the Arduino. This powers the logic circuitry of the L293D.
  3. Connect the GND pin (Pin 4 and Pin 5) of the L293D to the GND pin on the Arduino.
  4. Connect the VCC2 pin (Pin 16) of the L293D to the + of the battery. This powers the motors.
  5. Connect the GND pin (Pin 12 and Pin 13) of the L293D to the - of the battery.
  6. Motor Connections:
  7. Connect one terminal of the first DC motor to OUT1 (Pin 3) on the L293D.
  8. Connect the other terminal of the first motor to OUT2 (Pin 6) on the L293D.
  9. Connect one terminal of the second DC motor to OUT3 (Pin 11) on the L293D.
  10. Connect the other terminal of the second motor to OUT4 (Pin 14) on the L293D.
  11. Control Pins:
  12. Connect IN1 (Pin 2) on the L293D to a digital output pin on the Arduino (Pin 9). This controls the direction of the first motor.
  13. Connect IN2 (Pin 7) on the L293D to another digital output pin on the Arduino (Pin 10). This also controls the direction of the first motor.
  14. Connect IN3 (Pin 10) on the L293D to a digital output pin on the Arduino (Pin 11). This controls the direction of the second motor.
  15. Connect IN4 (Pin 15) on the L293D to another digital output pin on the Arduino (Pin 12). This also controls the direction of the second motor.
  16. Enable Pins:
  17. Connect EN1 (Pin 1) on the L293D to the 5V pin on the Arduino and EN2 (Pin 9) on the L293D to the + of the battery. This enables the motor outputs.

Note : The 9V battery shown in the schematic represents two 3.7V Li-ion batteries.


Designing the Robot Arm Parts for 3D Printing

5985633756087698337.png
22fd0841-5211-421a-91f5-c66b939951ac-1_all_7383.jpg
acbf2883fe52f649b768e9003abdd778.png
7bde3765a0764a50d8b33b73af14ef59.png
79c35e0a7c5cd241dbd3b1a70d04ba9d.png
6633fee2f03b52d3b3e163a58cc8f026.png
23558cf18a892cfcc7f48478cf3cf2dd.png
099833809c4e07b0daa190d9bffe8659.png
56096c91d94140efd4c874d5328d3d42.png
a0c6b8390609720c9b86f4d9ec67afbd.png
845e4e68fbe63982b7755460dac62832.png
5985633756087698336.jpg

There is the design of each part of the robotic arm that will be 3D printed. Using CAD software, each component will be modeled to fit the desired dimensions and functionality. The arm consists of several joints, allowing for movement such as rotation, bending, and extension.

The STL files provided below are ready for download :

Testing the Servo Motors With PCA9685 Driver

mm.png

In this step, we will test the servo motors using the PCA9685 servo driver. The PCA9685 allows for precise control of multiple servos, making it ideal for controlling the joints of the robotic arm, ensuring they respond correctly. This will help verify the arm's movement and ensure the servos are functioning properly before final assembly.

Wiring Connections:

  1. Arduino to PCA9685 Driver:
  2. 5V from ArduinoVCC&V+ on PCA9685: Powers the PCA9685 module.
  3. GND from ArduinoGND&OE on PCA9685: Ground connection for both the Arduino and PCA9685.
  4. SCL (Pin A0 on Arduino)SCL on PCA9685: This connects the clock line for I2C communication.
  5. SDA (Pin A1 on Arduino)SDA on PCA9685: This connects the data line for I2C communication.
  6. PCA9685 to Servo Motors:
  7. GND on PCA9685GND on each Servo Motor (black wire): Common ground connection.
  8. V+ V+ on each Servo Motor (red wire): power supply to drive the servos (shared with 9V battery).
  9. PWM pins onPWM wire on each Servo Motor (yellow wire): These are the control signals to each individual servo motor.
  10. 9V Battery:
  11. Positive Terminal of BatteryV+ on PCA9685: Supplies power to the servos via the PCA9685.
  12. Negative Terminal of BatteryGND on PCA9685: Completes the circuit and provides a ground reference.
  13. Note : The 9V battery shown in the schematic represents two 3.7V Li-ion batteries.

Uploading the code :

The provided code controls five servo motors using the PCA9685 PWM driver with the Adafruit_PWMServoDriver library. It initializes the PWM driver and sets the PWM frequency to 60 Hz. The setServoAngle() function adjusts each servo's angle by calculating the appropriate pulse width. In the loop() function, each servo is sequentially moved to a specific angle with a 1-second delay between movements, demonstrating individual control of each servo without using loops for iteration. This approach allows for precise and customizable servo positioning.

Testing the Servo Motors With PCA9685 Driver

arduin.png
arm test

In this step, we will test the servo motors using the PCA9685 servo driver and Bluetooth communication. The PCA9685 allows for precise control of multiple servos, making it ideal for controlling the joints of the robotic arm. We'll also use a Bluetooth module to send commands wirelessly to the servos, ensuring they respond correctly. This will help verify the arm's movement and ensure the servos are functioning properly before final assembly.

Wiring Connections:

  1. Arduino to PCA9685 Driver:
  2. 5V from ArduinoVCC&V+ on PCA9685: Powers the PCA9685 module.
  3. GND from ArduinoGND&OE on PCA9685: Ground connection for both the Arduino and PCA9685.
  4. SCL (Pin A0 on Arduino)SCL on PCA9685: This connects the clock line for I2C communication.
  5. SDA (Pin A1 on Arduino)SDA on PCA9685: This connects the data line for I2C communication.
  6. PCA9685 to Servo Motors:
  7. GND on PCA9685GND on each Servo Motor (black wire): Common ground connection.
  8. V+ V+ on each Servo Motor (red wire): power supply to drive the servos (shared with 9V battery).
  9. PWM pins onPWM wire on each Servo Motor (yellow wire): These are the control signals to each individual servo motor.

  10. Arduino to HC-05 Bluetooth Module:
  11. TX (Pin 1 on Arduino)RX on HC-05: For serial data transmission from the Arduino to the Bluetooth module.
  12. RX (Pin 0 on Arduino)TX on HC-05: For receiving data from the Bluetooth module.
  13. 5V from ArduinoVCC on HC-05: Provides power to the Bluetooth module.
  14. GND from ArduinoGND on HC-05: Common ground.
  15. 9V Battery:
  16. Positive Terminal of BatteryV+ on PCA9685: Supplies power to the servos via the PCA9685.
  17. Negative Terminal of BatteryGND on PCA9685: Completes the circuit and provides a ground reference.
  18. Note : The 9V battery shown in the schematic represents two 3.7V Li-ion batteries

The next step involves configuring the Bluetooth app to communicate with the Arduino and uploading the code to the Arduino board. This will establish the connection between the app and the servos, allowing you to test and fine-tune the control of the robotic arm through the app interface.

Configuring the Bluetooth Control App

1000069316.jpg
1.png
2.png
3.png
4.png

Action 2: Setting Up the Bluetooth Connection

  1. Pairing the HC-05/HC-06 with Your Phone:
  2. Power on your Arduino, which will also power the HC-05/HC-06 Bluetooth module.
  3. Go to your phone’s Bluetooth settings and search for devices.
  4. You should see the HC-05/HC-06 module appear as a device (usually named "HC-05" or "HC-06").
  5. Pair with it using the default password (usually 1234 or 0000).

Action 2: Connecting via the Arduino Servo Control App

  1. Download and Install the Arduino Servo Control app on your Android device.

Note :

  1. The HC-06 Bluetooth module, which is a common Bluetooth serial communication module used with Arduino and other microcontrollers, is not natively compatible with iPhones. The HC-06 is designed for Bluetooth Classic (Bluetooth 2.0), and iOS devices primarily support Bluetooth Low Energy (BLE) for most of their Bluetooth interactions. Consider replacing the HC-06 with a Bluetooth Low Energy (BLE) module, such as the HM-10 or HM-11.
  2. For ios phones you can use Bluetooth for Arduino App or ArduinoBlue App to do the exact same project, Here is how to configure them :

ArduinoBlue App : https://sites.google.com/stonybrook.edu/arduinoble/

  1. Launch the App: (Follow the steps showing in the pictures above)
  2. Open the app and click on the Pro Mini Servo Control wich is the type of servos whe are using.
  3. The app is showing 6 servos slider form 0° to 180° wich is the angle control of the servo motor.
  4. Uploading the code :
  5. The code below controls five servos using the PCA9685 PWM driver and the Servo library, with input values received via a Bluetooth connection. It initializes the PWM driver with a frequency of 60 Hz, ideal for servos, and uses the set_servo() function to adjust individual servo angles based on specific input ranges. Additionally, a special range of input values (11000 to 11180) allows for setting the same angle for all servos simultaneously. The loop() function reads two bytes of data from the Bluetooth serial connection, combines them into a single value, and uses this value to control the servos, enabling remote control via Bluetooth.
  6. Connecting arduino with the app for Real-Time Control:
  7. Click on the top tree point icon then select devices to search for nearby devices.
  8. Select your HC-05/HC-06 module from the list.
  9. moving the sliders in the app will adjust the angles of the servo motors in real-time.
  10. Test the servos by adjusting the angles to ensure they are moving correctly.


Assembling and Testing the Robot

1000068462.jpg
1000068593.jpg

In this step, we will assemble all the components of the robot, including the two-wheeled chassis, robotic arm, servos, and electronics. The two-wheeled chassis is also controlled via Bluetooth using the same app, specifically with slider 6 (labeled as Servo6). The original values (905–1085) are mapped to a range of 0–180, and each movement is assigned a specific range:

  1. Forward: 0 to 45 (original value 905 to 950)
  2. Backward: 46 to 90 (original value 951 to 995)
  3. Right: 91 to 135 (original value 996 to 1040)
  4. Left: 136 to 179 (original value 1041 to 1084)
  5. Stop: 180 (original value 1085)

The corresponding code is provided below :

Downloads

Testing Video

Two-Wheeled Drive Car With a Robotic Arm

This is a great educational project with plenty of room for modifications. You could use larger 5V servo motors if you want to scale up the two-wheeled robot or the robotic arm. Another modification could involve switching the standard wheels to Omni wheels or Mecanum wheels, making the robot platform more maneuverable. Of course, these modifications would require adjustments to both the 3D model and the code. One potential improvement could be the speed of the robotic arm. Through better programming, the arm could move faster and more smoothly. If the arm is moving too slowly or with a jerking motion, it might be due to low battery power. Replacing the batteries should fix this issue. I hope this project helps you learn something new and, most importantly, have fun!