C.Y.R.U.S - A Multi-Functional Humanoid Robot with Arduino and A.I Integration



Introduction:

As the demand for robotic technology continues to grow, humanoid robots are becoming increasingly popular due to their potential applications in various fields such as education, entertainment, and research. Among these, Cyrus stands out as a cost-effective and customizable humanoid robot that provides an interactive and engaging user experience.

Cyrus, short for "Cyber Robotic Unit System," is a versatile humanoid robot that performs a wide range of tasks using its advanced hardware and software features. The robot is equipped with line following and obstacle avoidance capabilities, which enable it to move around without colliding with objects in its path. Additionally, it has app control and servo movement features that allow users to control its movements and actions.

One of the most impressive features of Cyrus is its ESP32 webcam, which enables it to capture images and videos effortlessly. Additionally, the robot's AI, programmed with Python, allows it to learn and adapt to its environment, making it an ideal platform for educational and research purposes. The primary microcontroller used in Cyrus is Arduino, known for its reliability and ease of use.

Taking its capabilities to the next level, Cyrus includes a powerful AI with Gemini, enabling it to recognize faces and greet individuals by name using machine learning. Furthermore, Cyrus can answer any question posed to it, utilizing the AI power of Gemini. This feature enhances its interactive and engaging nature, making it suitable for a variety of settings, from classrooms to social gatherings.

Constructed from materials such as cardboard, plywood, and PVC pipes, Cyrus is not only cost-effective but also easy to assemble and customize. With its advanced features and affordable price, Cyrus is an excellent choice for anyone looking to explore the world of robotics and AI technology.


Back Story:


In the realm of creativity and innovation, Cyrus came to life twice: first in my imagination, and then in the tangible world of reality. Creating Cyrus was a story of dreams turning into equations, where the vast boundaries of imagination met the structured reality of engineering.
At the age of 14, my love for electronics and Arduino sparked a dream - Cyrus, a robot with charming AI integration abilities and expressive moves. Fueled by DIY enthusiasm, I dived into the world of coding, servos, and endless curiosity, transforming this dream into a buzzing reality. With cardboard, PVC pipes, and a sprinkle of creativity, Cyrus emerged, showcasing the power of imagination paired with electronic know-how.

The equation that guided me was simple:
Dream + Creativity + Engineering + Electronics = C.Y.R.U.S
In other words, anything is possible if you can imagine it. My journey began with a strong passion for electronics. Inspired by the humanoid robot in the 2010 Indian movie named "Robot," after that I delved into research on AI and machine learning, understanding how all the electronic components work. Certainly My dedication was noticed by my science teacher, Devendra Rana, who appreciated my efforts and provided an opportunity to create a humanoid robot. We devised a plan to build the first version of Cyrus within a tight deadline of seven days to showcase it at the 25th anniversary of my school. Despite the short timeframe, we harnessed the power of imagination and the programming skills I had developed over the years. However, as often happens, the gap between imagination and reality posed challenges. The motors could not lift the upper body weight, so necessitating the creation of two separate robots—one with hand movements and AI, and another with app control, obstacle avoidance, and sensors.


Cyrus 1.0
The dual robots presented at the anniversary were met with admiration and enthusiasm, but I was determined to make further improvements. Driven by the spirit of innovation, I consulted with my teacher Devendra Rana again. Over the next three months, we meticulously rebuilt and enhanced Cyrus, facing numerous problems and errors along the way. Through perseverance and learning, Cyrus 2.0 was born, transforming our imagination into a functional reality. Now, Cyrus stands as more than just a collection of wires and circuits. It represents a testament to the power of dreaming until it becomes reality. In the story of Cyrus, we find not just a robot, but a testament to the power of dreaming until it becomes reality. This equation proves, time and again, that the fusion of creativity and engineering can bring forth marvels that redefine the boundaries of innovation.


Table of Contents:




Needed Material :

Electronics Components:

  1. Arduino board ( Arduino Uno or Arduino Mega) x1
  2. ESP32-compatible webcam module x1
  3. Servo motors (Mg995) x3
  4. Mini servo motor x1
  5. Jhonson motors (100 rpm)x2
  6. Bluetooth module (HC05) x1
  7. Motor drivers (L298N) x1
  8. Ultrasonic distance sensors(Hc-SR04) x1
  9. Infrared (IR) sensors (for line following) x2
  10. Jumper wires and breadboard for circuit connections
  11. Power supply (3.7 v batteries and battery holder )x9
  12. 10 A BMS Module x1
  13. Buck converter (lm2596)x1
  14. Bluetooth speaker x1
  15. 1 channel Relay Module x1
  16. Ultrasonic sensor Holder x1
  17. caster wheel x2
  18. motor mount x2

Electronic Components

Mechanical Components:

  • Cardboard sheets (for creating the humanoid body structure)
  • Plywood sheets (for robot base)
  • PVC pipes or dowel rods (for creating limbs and joints)
  • Screws, nuts, bolts, and washers (for assembling the structure)
  • Adhesives (such as glue or double-sided tape) for securing components

Mechanical Components

Additional Components:

  • Smartphone or tablet (for app control)
  • Computer with Python installed (for AI implementation)
  • USB cables for programming and power supply
  • Miscellaneous tools (screwdrivers, pliers, cutter, etc.) for assembly

Software:

  • Arduino IDE (for programming the Arduino board)
  • Python IDE (such as PyCharm or VS code)

Optional:

  • Additional sensors for environment sensing (e.g., light sensors, temperature sensors)
  • Microcontroller shields or expansion boards for additional functionalities
  • 3D printer (for creating custom parts if available)
  • Laser cutter or CNC machine (for precise cutting of plywood or PVC)

Ensure that you have access to the necessary tools, materials, and software environments before starting the construction and programming process. Additionally, be cautious when working with electrical components and follow safety guidelines.




Circuit Connections:


Arduino to sensors and motor Driver:

Arduino to Sensor


Here, we have a circuit diagram that incorporates the feature of controlling our robot from an app. You can access line following, obstacle avoidance, and any other feature you can imagine. You can customize it according to your needs.


Connection Chart for Bluetooth HC-05, Ultrasonic Sensor, IR Sensors (1 & 2), and L298N Motor Driver on Arduino Uno :


Notes:

  • You have the option to select various digital pins for the ultrasonic sensor, IR sensors, and motor driver control pins, provided they are compatible with your Arduino code.
  • It is important to ensure that the external power source can handle the current requirements of your motors.
  • Additionally, please double-check the pinout diagrams of your specific HC-05 and L298N modules for any potential variations.

Arduino to Servo connection:

Servo Connections


Here, the circuit diagram incorporates the feature of controlling its head and hand through servo motors from our Android application.


Servo Motor Connection Chart for Arduino Uno:

Power Supply:

It is essential to ensure that the servo motors receive a stable 5V power supply. This can be achieved in two ways: 
1. By using a dedicated 5V power supply.
2. By connecting a voltage regulator such as the LM2596 Buck converter to a higher voltage source, for instance, a 9V battery. 

Notes :

1. It is possible to use digital pins other than 11, 12, and 13 to control servo motors, as long as the Arduino code is modified accordingly.
2. To ensure precise servo control, make sure that the selected pins are compatible with PWM (Pulse Width Modulation). 
3. Additionally, it is important to double-check the voltage and current requirements specified for your servo motors.

ESP32-Cam Connection:

Integrating an ESP32 webcam into our humanoid robot, Cyrus, allows for real-time video streaming, enhancing Cyrus's capabilities for monitoring and remote interaction. To set up the ESP32 webcam and stream video to our robot app, follow the detailed guide provided in the link below.


Note: Some features and connections are not shown in this guide, giving you the freedom to personalize and enhance Cyrus's capabilities. Feel free to experiment and innovate, as the possibilities are virtually limitless.

Building the Hardware & Software :

Hardware

Creating a humanoid robot like Cyrus is a complex process that requires precision and attention to detail. Every part must fit together seamlessly and function properly to achieve a visually appealing and fully functional robot.

To accomplish this, precise measurements of each component are necessary, including the head, body, hands, and base. The head dimensions include the circumference, height, and width, as well as additional measurements for the eyes, ears, and mouth.The body measurements cover the chest, waist, and shoulders, aiming to create a sturdy yet flexible structure capable of supporting the weight of the head and arms. 
Accompanying images for each part provide a visual reference to help replicate the measurements accurately during the building process. With these comprehensive dimensions and pictures, builders can create a fully functional and aesthetically pleasing humanoid robot that meets all requirements.

Step 1: Measuring and Cutting the Materials

1. Measurements: Start by measuring the Cardboard sheets plywood and PVC pipes. Use the images provided as a guide for the dimensions needed to create the body, arms, limbs, and base.

Body, Hand & Head:

Measurements

Base, Limb & Covering:

Base Part
2. Cutting: Carefully cut the cardboard sheet, plywood, and PVC pipes according to your measurements. Ensure that each piece fits correctly with the others, as precision is crucial for the robot's mobility.
Cutting

limbs

3. Assembly: Assemble the head, hand, body, limbs, and base to make our complete robot.


4. Mounting: Attach wheels and motor so that the base can smoothly carry the weight and facilitate movement.
Mounting
Step 2: Assembling the Structure
5. Framework Assembly: Start by assembling the frame. Attach the torso, head, arms, and legs to the base. Use bolts and screws to secure each joint to ensure flexibility and strength.

Frame Work Assembly

6. Servo Installation: Install the servo motors at the joints. These motors will be crucial for the hand movements of Cyrus.
Servo Attachment 
Step 3: Installing Electronics:

7. Wiring: Route the wires from the motors to the Arduino and motor drivers. Make sure the wiring is neat and organized to prevent any disconnections or electrical hazards.
Circuit connection

8. Sensor Placement: Install the ultrasonic and IR sensors on the head and lower parts of the body for obstacle detection and line following.

Sensor Placement

Step 4: Final Adjustments:

9. Testing Joint Movement: Before moving onto the software, manually test the joints to ensure they move freely without resistance.
All parts of Robot 

10. Secure Loose Parts: Use Velcro straps and adhesive tapes to secure any loose wiring or parts.

Interior
Let's shift our focus to the software section after completing the hardware section of our robot.


Software


After the completion of the physical parts of Cyrus, Our humanoid robot has been assembled, the next critical step is to program it to function as intended. This process involves software development, which includes a wide range of capabilities such as AI programming, app control for remote operation, and the core programming code.

To enable Cyrus to function as a truly intelligent robot, we incorporate sophisticated AI programming techniques. This allows the robot to learn from its environment, adjust to changes, and make decisions based on the data it collects. Furthermore, we designed an app control system that allows remote operation of the robot. This makes it easier to control the robot from any location, and it also simplifies the task of monitoring its performance. Finally, the core programming code is essential for ensuring that all the robot's hardware components are functioning correctly and efficiently. This includes the sensors, motors, and other hardware components that are integrated into the robot's design.

Therefore, each part of the software development process is designed to maximize Cyrus's hardware capabilities, making it a highly functional and intelligent robot.


AI Implementation with Python

Developing a highly functional humanoid robot like Cyrus requires not just advanced hardware but also robust and efficient software. Good software is crucial to fully utilize the hardware capabilities, enabling the robot to perform a wide array of tasks seamlessly. Cyrus's AI system is developed using Python and VS Code, leveraging various libraries to enhance its functionality. The development process includes creating a graphical user interface (GUI) and integrating more than 30 features that make Cyrus a versatile and powerful assistant. The AI system ensures that Cyrus can learn, adapt, and interact with its environment effectively.
C.Y.R.U.S GUI

Key Features:

1. Image and Video Capture: Cyrus uses its ESP32 webcam to capture and process images and videos, enabling facial recognition to greet individuals by name.

2. Web-based Interactions: It can perform Google searches, play YouTube videos, and fetch web-based news updates, keeping you informed and entertained.

3. Location Tracking and Map Navigation: Equipped with GPS modules and the geopy library, Cyrus can track its location and navigate efficiently.

4. Environmental Monitoring: Our robot provides real-time updates on time, temperature, and weather forecasts, helping you plan your day effectively.

5. Network Utilities: Cyrus retrieves IP addresses and assesses WiFi speed, ensuring optimal connectivity.

6. Personal Assistant Functions: From setting alarms and performing mathematical calculations to answering questions and conducting Wikipedia searches, Cyrus is a highly capable assistant.

7. Home Automation: Through a Cyrus we can control compatible home appliances, adding convenience to your daily life.

8. Facial Recognition and Greeting: Using its powerful AI made with Google Gemini, and machine learning algorithms Cyrus recognizes faces and greets individuals by name, providing a personalized experience.

9. Powerful AI with Google Gemini: The AI capabilities of Cyrus are enhanced with Google Gemini, allowing for advanced processing, learning, and interaction capabilities.


Cost-Effective Implementation:


AI Code

To keep Cyrus affordable and accessible, we designed the system to run on a laptop instead of using additional microcontrollers like Raspberry Pi. This approach reduces costs while still providing high computational power. Cyrus communicates with its hardware via WiFi and Bluetooth, ensuring smooth and reliable interactions. This setup makes Cyrus an economical choice for anyone interested in robotics without compromising on performance or features.

All the code for our AI is provided below, and you can download it free of cost to build and customize your own Cyrus robot.

Android Application:

In addition to the sophisticated AI system running on Cyrus, we've developed a user-friendly mobile app using MIT App Inventor. This app serves as a seamless interface for controlling and interacting with the robot, offering a range of intuitive features for enhanced user experience.
Features:
1. Connectivity: The app allows users to establish a connection with Cyrus effortlessly, enabling seamless communication between the robot and the mobile device
2. Live Stream Viewing: Users can view live streams from Cyrus's camera directly on their mobile devices, providing real-time visual feedback of the robot's surroundings.
3. Voice Control: With voice control functionality, users can issue commands to Cyrus using simple voice prompts, enhancing convenience and accessibility.
4. Manual Control: The app features intuitive buttons for manual control of Cyrus's movements, allowing users to navigate the robot with ease.
5. Auto Modes: Users can switch between auto modes such as line follower and obstacle avoidance, enabling Cyrus to navigate autonomously in various environments.
6. Hand and Head Movement Control: Cyrus's hand and head movements can be controlled directly from the app, offering precise control over the robot's interactions.
7. AI Functionality: The app includes a toggle for enabling AI functionalities, empowering users to leverage Cyrus's advanced AI capabilities directly from their mobile devices.
8. Button Lights Control: Users can control the lights on Cyrus's buttons through the app, allowing for customization and visual feedback.
Making of App

The MIT App Inventor provides a user-friendly platform for developing and deploying mobile apps, making it an ideal choice for creating the app control interface for Cyrus. With this app, users can easily interact with Cyrus and unlock its full potential, whether for educational, research, or practical applications in robotics.
App Interface:
Here is a guide with images for using our robot application. It provides step-by-step instructions and visual aids to help users navigate the app interface and utilize its features effectively. These images offer visual guidance and clarity, making it easier for users to understand and interact with Cyrus's mobile app.
Step 1:
Step 2 :
Step 3 :
Step 4 :
Step 5 :
Step 6 :
Step 7 :


Arduino Coding for Cyrus:


In addition to its advanced AI system and user-friendly mobile app, Cyrus also utilizes Arduino for controlling its hardware components and performing tasks such as motor control, sensor readings, and communication with external devices. Below is an overview of the Arduino code used in Cyrus's development:
Overview:
Cyrus Main Code



The Arduino code serves as the backbone of Cyrus's hardware control system, enabling communication between its various components and facilitating interaction with the environment. It includes modules for motor control, sensor readings, and communication protocols such as WiFi and Bluetooth.

Key Components:
1. Motor Control: The Arduino code includes functions for controlling Cyrus's motors, allowing precise movement and navigation in different environments.
2. Sensor Readings: Cyrus is equipped with various sensors for detecting obstacles, tracking lines, and gathering environmental data. The Arduino code reads data from these sensors and processes it to make informed decisions.
3. Communication Protocols: Cyrus communicates with external devices such as the ESP32 camera and the mobile app via WiFi and Bluetooth. The Arduino code includes protocols for establishing and maintaining these connections, ensuring seamless communication.

Overall Code and Download Link:

The complete Arduino code for Cyrus, along with the necessary libraries and resources, is available for free download. You can access the code and resources from the below links.

Source Code:

We've compiled all the resources you need to build a humanoid robot like Cyrus. This includes circuit diagrams, Arduino code, a mobile app for remote control, Python code for AI, and essential libraries. Access these resources for free and start building your own Cyrus robot.

Working Prototype:


Conclusion :


The journey of building Cyrus, from a mere idea to a tangible reality, has been a testament to the power of persistence, creativity, and innovation. Along the way, there were countless challenges and setbacks,but each failure served as a stepping stone toward success. From circuitry mishaps to coding errors, every obstacle was an opportunity to learn and improve, ultimately leading to the creation of a remarkable humanoid robot.

Through Cyrus, we've demonstrated the transformative potential of combining imagination with technology. It's not just a robot; it's a symbol of limitless possibilities and endless exploration. With its advanced AI system, versatile mobility, and interactive features, Cyrus represents a new frontier in robotics, offering solutions to real-world problems and inspiring future generations of innovators.





In today's rapidly evolving world, robots like Cyrus play a crucial role in shaping the future of technology and society. From assisting in education and research to enhancing productivity and convenience in daily life, humanoid robots offer a myriad of benefits and opportunities. They bridge the gap between humans and machines, opening doors to new possibilities and revolutionizing various industries.

As we look towards the future, robots like Cyrus will continue to evolve and adapt, becoming integral parts of our lives. They'll assist us in tasks that are dangerous, tedious, or beyond human capability, making our lives safer, easier, and more efficient. With continued innovation and collaboration, we'll unlock new potentials and redefine the boundaries of what's possible, ushering in a new era of human-robot interaction and cooperation.

In the end, Cyrus is not just a robot; it's a symbol of innovation, perseverance, and the boundless potential of the human spirit. It reminds us that with determination and creativity, we can overcome any obstacle and achieve our dreams, no matter how daunting they may seem. As we continue to push the boundaries of technology and imagination, the future holds endless possibilities, and robots like Cyrus will be at the forefront of shaping that future.


Thank you for joining me on this journey. I invite you to follow my work, share your thoughts, and perhaps even collaborate on future innovations. Together, we can push the boundaries of what is possible and shape the future of robotics in Nepal and beyond.
Previous Post Next Post