Self Balancing Robot Using Arduino

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • In this video we are going to learn how to make Balancing Robot using Arduino Nano and dc gear motors.
    This video contains in depth code explanation of balancing robot code and calibration of mpu6050 in very easy way.
    *Important** : Please note that there is some issue in the connection diagram shown in video.
    So I have corrected it and please refer the connection diagram from git repository link github.com/un0...
    👉Please subscribe:
    www.youtube.co...
    👉Components List
    ✅ Arduino Nano
    ✅ MPU6050 sensor
    ✅ DC TT Gear motors - 2
    ✅ L298N motor driver module
    ✅ DC Battery 7-12 V (in our case 11.1 3S lipo)
    ✅ Foam board
    ✅ Wooden Sticks
    ✅ Glue Gun
    ✅ PCB
    ✅ Jumper wires
    👉 Shorts Channel :
    / ujwalnandanwar
    👉Code/library and diagram:
    github.com/un0...
    👉mpu6050 library credit - Jeff Rowberg
    👉 Obstacle avoiding Robot
    • Arduino Obstacle Avoid...
    👉 Camera Car
    • Surveillance Car using...
    👉 Wi-Fi Car
    • Smartphone controlled ...
    👉 Hand Gesture controlled car
    • Hand Gesture Controlle...
    👉 Bluetooth car
    • How to make Bluetooth ...
    👉 Arduino RC car using nrf24l01+ module
    • Arduino RC car using N...
    👉Watch more videos:
    / hashincludeelectronics
    👉Follow us on Instagram:
    / hashincludeelectronics
    #selfbalancingrobot #mpu6050 #hashincludeelectronics #arduino

Комментарии • 152

  • @hashincludeelectronics
    @hashincludeelectronics  3 года назад +1

    **Important*** : Guys please note that there is some issue in the connection diagram shown in video.
    So I have corrected it and please refer the connection diagram from git repository link github.com/un0038998/BalancedRobot/tree/main/Diagrams

  • @aishanipatra9722
    @aishanipatra9722 3 года назад +6

    Very nice bro. Self balancing robot is surely a model which can be used to build lot of useful tools

  • @ugibugiugiRAH
    @ugibugiugiRAH 3 месяца назад +1

    hello! what do the values KP, KI, and KD do and how do i know which ones to change in order to calibrate it. The current issue with my robot is that as soon as it's turned on, both wheels spin at maximum speed and i'm not sure what the issue is ):

    • @hashincludeelectronics
      @hashincludeelectronics  3 месяца назад

      It’s really tricky to set these values . It varies based on robot. You need to set it as suitable for your robot. Please check videos on how we can set PID values correctly . 👍🏻👏🏻

  • @huanle5807
    @huanle5807 3 месяца назад +1

    Hi, I coppy your code but it wrong.’analogWrite’ was not declared in this scope

  • @madhav14_99
    @madhav14_99 2 года назад +2

    sir how to get the values of Kp Ki and Kd for pitch and SETPOINT PITCH ANGLE OFFSET for my robot. Please help. My submission deadline is 3 days from now.

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      Its not easy to get these values. Its most challenging part. You need to follow the steps which i have suggested at the end of the video . However still it depends upon many factors.

  • @umairsaeed1608
    @umairsaeed1608 6 месяцев назад +1

    i am getting this msg while compiling the Balanced Robot code " no matching function for call to 'PID::Compute(bool)". Help please

    • @hashincludeelectronics
      @hashincludeelectronics  6 месяцев назад

      You need get the library from the folder I provided in the code link. Please check .

  • @muhammadardikurniawan7135
    @muhammadardikurniawan7135 Год назад +1

    I have entered the library but still "no matching function for call to 'PID::Compute(bool)'
    "

  • @demej00
    @demej00 3 месяца назад +1

    Yours is like mine, won't balance on a smooth surface without runnng away. Can't figure out how to get it to balance on smooth surface and stay in one place.

    • @hashincludeelectronics
      @hashincludeelectronics  3 месяца назад

      Yeah I can understand . It depends upon the the robot body motors used and PID values as well 👍🏻👏🏻

  • @zainhassan2564
    @zainhassan2564 10 месяцев назад +2

    I am getting a error of "Error: 13 INTERNAL: Library install failed: moving extracted archive to destination dir: library not valid" when I try to include the zip folder for libraries into the Arduino. Can I talk with you on instagram?

  • @lifesutra5865
    @lifesutra5865 Год назад +2

    Can you please tell
    HOW TO SET SETPOINT_PUTCH_ANGLE_OFFSET
    and how did you got the value as -2.2
    Does that value show during the mpu6050 calibration or randomly we must set please let me know

    • @hashincludeelectronics
      @hashincludeelectronics  Год назад +2

      The ideal value is 0. However you need to adjust it if robot runs in either direction . So it might vary based on your robot design .

  • @surendrakumarsahoo9878
    @surendrakumarsahoo9878 Год назад +1

    Hello, There is an error when compiling the code in thi line "yawPID.Compute(true);" . the error is "exit status 1
    no matching function for call to 'PID::Compute(bool)'
    ". Please help to solve the issue.

  • @gamingwithprakalp
    @gamingwithprakalp 3 года назад +2

    Congratulations for 100 subs❤️❤️❤️❤️

  • @dhirajbanpurkar5397
    @dhirajbanpurkar5397 2 года назад +2

    I got problem in code rotateMotor was not declared in scop

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      Can you send the screen shot of error on Instagram? @hashincludeelectronics

  • @OlavurNonE
    @OlavurNonE 2 года назад +1

    Im building a balancing robot myself, but i am having issues with the electrical noise from the motors interfering with the MPU. This makes the (in my case) ESP32 not being able to read from the MPU all the time. Did you have any troubles like this?

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      Good you are trying to make it with esp32 👌🏻 I never faced such issue with this robot . I was able to read mpu values using Arduino nano .

  • @itsprit302
    @itsprit302 3 года назад +2

    Superb robo 😘😘 .nice idea 💡💡👍

  • @yonatantamiru7756
    @yonatantamiru7756 Год назад +1

    it run too fast to balace at some point how can i adjust the motor speed?

    • @hashincludeelectronics
      @hashincludeelectronics  Год назад

      You have to adjust the PID values which is little bit complicated. Please check the video and try to follow the step 👍🏻👏🏻

  • @YashJain-nh8nh
    @YashJain-nh8nh Год назад +1

    I have tried this project but the motors rotate in only one direction...can help me out?

    • @WHITE_222
      @WHITE_222 Год назад

      Same problem
      Is it solved

    • @YashJain-nh8nh
      @YashJain-nh8nh Год назад

      @@WHITE_222 yess

    • @WHITE_222
      @WHITE_222 Год назад

      @@YashJain-nh8nh please help me

    • @YashJain-nh8nh
      @YashJain-nh8nh Год назад

      @@WHITE_222Earlier i used the same motor which they have shown in the video.Then I changed the motor & used 12v Geared DC motor

  • @a.remenraj1015
    @a.remenraj1015 2 года назад +1

    what is your gyro and accelerometer sensitivity?
    My accelerometer sensitivity is +/-2g and gyro is 250. will the code work fine for me?

  • @sandeepgpatil8297
    @sandeepgpatil8297 3 года назад +2

    Very nice .. very informative

  • @musicalvibe3343
    @musicalvibe3343 10 дней назад

    Bro pls make a model of Self balancing + Obsacle avoiding robot. Pls i have to go for my zonal science exibhition and pls use a arduino Uno instead of nano.Pls make this model a Humble request.🙏🙏🙏🙏🙏

  • @user-bm1bc8es2g
    @user-bm1bc8es2g 7 месяцев назад +1

    how did u control the motion of the robo. did u make a controller or ?

    • @hashincludeelectronics
      @hashincludeelectronics  7 месяцев назад

      As of now we are not controlling it with any controller 👍🏻👏🏻

  • @a.sanusinazareth9213
    @a.sanusinazareth9213 Год назад +1

    I have a question: How to connect it using RX and TX Flysky?

  • @TIRTHKANDOI
    @TIRTHKANDOI 4 месяца назад +2

    Compiler showing error in undeclared 'rotatemotor'

    • @hashincludeelectronics
      @hashincludeelectronics  4 месяца назад +1

      Please copy paste the code properly 👍🏻👏🏻

    • @TIRTHKANDOI
      @TIRTHKANDOI 4 месяца назад +1

      Okay but in the code there is also written "rotatemotor" and it is showing compiled completeld but in diagnosis it is showing that

    • @TIRTHKANDOI
      @TIRTHKANDOI 4 месяца назад +1

      And thankyou for your precious time 😄

    • @hashincludeelectronics
      @hashincludeelectronics  4 месяца назад

      @@TIRTHKANDOI please send the screen shot or paste the whole error here 👍🏻👏🏻

    • @TIRTHKANDOI
      @TIRTHKANDOI 4 месяца назад

      @@hashincludeelectronics okay

  • @praneetsharma
    @praneetsharma 3 года назад +2

    Very detailed video..

  • @varghesebinu8443
    @varghesebinu8443 5 месяцев назад +1

    What should be the pid max limit and pid min limit

    • @hashincludeelectronics
      @hashincludeelectronics  5 месяцев назад

      There is no such limit but you need to find the approximate values for your robot 👍🏻👏🏻

  • @sahelidas5291
    @sahelidas5291 3 года назад +4

    awesome stuffs :)

  • @yashasvichoubey9179
    @yashasvichoubey9179 3 года назад +2

    Very Nice👍🏻

  • @musicalvibe3343
    @musicalvibe3343 18 дней назад +1

    Can i use arduino uno instead of nano

  • @servers.LinhIT
    @servers.LinhIT 3 года назад +1

    Why is the MPU 6050 X,Y,Z ,X ,Y ,Z code different from the Balanced_Robot code?

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад +1

      Thanks for checking out the video . However I did not get your question properly. Could you please tell me more about this query?

    • @servers.LinhIT
      @servers.LinhIT 3 года назад +1

      @@hashincludeelectronics What do you mean the code in the mpu 6050 part shows a different value than the code in the robot's value?

    • @servers.LinhIT
      @servers.LinhIT 3 года назад +1

      @@hashincludeelectronics If you still don't understand the question you can contact me through this Facebook so I can better explain the problem I'm havingfacebook.com/anhlinh6789sbtc

    • @servers.LinhIT
      @servers.LinhIT 3 года назад +1

      @@hashincludeelectronics where the minute 9.06 and the minute 11.03 are different values ​​in the axes?

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад +1

      @@servers.LinhIT connected on Facebook .

  • @dennisfitzpatrick2179
    @dennisfitzpatrick2179 Год назад +1

    how do you determine the pitch angle offset???

    • @hashincludeelectronics
      @hashincludeelectronics  Год назад

      This you need to do manually by placing the robot vertical . If it tilts one side then change it other way +ve or -ve . Give it a try and also check video 👍🏻

  • @chakraborty6069
    @chakraborty6069 10 месяцев назад +1

    Tell me for controlling which android app are u use ?

    • @hashincludeelectronics
      @hashincludeelectronics  10 месяцев назад

      We don’t use mobile app to control it . 👍🏻👏🏻

    • @chakraborty6069
      @chakraborty6069 10 месяцев назад

      @@hashincludeelectronics so how can control it ?

  • @alimahmoud8708
    @alimahmoud8708 2 года назад

    Great work man! I got a question, What were the criteria used in evaluating the control algorithm?

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      Thanks for checking out the video 👍🏻 there were many factors I considered . Motors max speed , batteries used , robot frame etc .

  • @user-wg4lu3zp3m
    @user-wg4lu3zp3m Год назад

    thank you for this video. sorry I have a question, how can I write this code for a neural controller, I'm talking about the arduino code that will imitate the PID controller?

  • @beep6202
    @beep6202 2 года назад +1

    Very clever! Now here’s a question. Is it possible to combine this robot with using the PS3 controller in a recent video of yours?

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад +1

      Not exactly . In that video I used esp32 with ps3controller. Will have to make lot of changes for it . Better to make this robot with esp32 then.

  • @prabhatverma7538
    @prabhatverma7538 3 года назад +2

    Awesome

  • @JulioHahn
    @JulioHahn 3 года назад +1

    Nice robot!

  • @shimaalcarrim7949
    @shimaalcarrim7949 11 месяцев назад +1

    Good Work Bro

  • @TARUN__46
    @TARUN__46 3 года назад +2

    Can I use Arduino Uno instead of namo and is code same

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад

      Yup . You can use Arduino uno and same code will work .

    • @TARUN__46
      @TARUN__46 3 года назад +1

      @@hashincludeelectronics and can I use a single stack insted of double stack design where u use a single whole compartment for battery in down the wheel and moter driver will be there in top Arduino , battery ,and accelerometer sensor will be ther in a compartment will I face any issues ?

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад

      Should not be a problem . it’s good to keep battery at the top for proper balancing.

    • @TARUN__46
      @TARUN__46 3 года назад

      @@hashincludeelectronics can I send u a pic in Instagram?

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад +1

      @@TARUN__46 sure . You can send me email as well un0038998@gmail.com

  • @zofmod
    @zofmod 2 года назад +1

    that is awesome can we implement it into a Segway and remotely control the Segway from the phone

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      Yes we can . Actually need to use stepper motor for that . Will try to make one in future .

    • @zofmod
      @zofmod 2 года назад +1

      @@hashincludeelectronics i can't wait plz tag me when u do it

  • @shreeharily
    @shreeharily 3 года назад +2

    Where do you buy your components from?

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад +1

      I buy all these components mostly from Amazon . Also sometimes i buy it from local store here called Abra . I will definitely add components links in description going forward . 👍🏻

  • @danishafaq5691
    @danishafaq5691 9 месяцев назад +1

    How are you controlling it buddy?

  • @gamingwithprakalp
    @gamingwithprakalp 3 года назад +1

    Goood job bro

  • @zainhassan2564
    @zainhassan2564 10 месяцев назад +1

    Hi is 9v battery good? Also, can I use Arduino Uno R3?

    • @hashincludeelectronics
      @hashincludeelectronics  10 месяцев назад

      Please do not use that non rechargeable 9v battery . Use only rechargeable battery . Also you can use Arduino Uno 👏🏻👍🏻

    • @zainhassan2564
      @zainhassan2564 10 месяцев назад +1

      @@hashincludeelectronics Which battery do you recommend?

    • @hashincludeelectronics
      @hashincludeelectronics  10 месяцев назад

      @@zainhassan2564 use LiOn or LiPo battery 👍🏻

    • @zainhassan2564
      @zainhassan2564 10 месяцев назад +1

      How many Volts?

    • @hashincludeelectronics
      @hashincludeelectronics  10 месяцев назад

      @@zainhassan2564 7-12 V

  • @AbhishekKanti
    @AbhishekKanti 2 года назад +1

    How do we find set point for our robot?

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      You need to figure it out using the few steps which I have provided at the end of the video .

    • @AbhishekKanti
      @AbhishekKanti 2 года назад

      Actually I was talking about SET_POINT_PITCH_ANGLE_OFFSET. Which is -2.2 in your case.
      While moving , does your robot leans -2.2 degrees? If yes than how did you calculate the angle for a moving robot?
      If you could tell than it would be of great help brother.

  • @WHITE_222
    @WHITE_222 Год назад

    Hello sir can you help i follow your steps but my robo can't move 😢😢
    Please help sir I have to submit project tomorrow please 😢😢😢

  • @peerapongseangkhuntee6450
    @peerapongseangkhuntee6450 3 года назад +1

    Can it be used with n20 gear motor ?

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад +1

      You can give it a try . However as I see rpm of this motor is very low , you might have to adjust PID values accordingly.

    • @peerapongseangkhuntee6450
      @peerapongseangkhuntee6450 3 года назад +1

      @@hashincludeelectronics Thanks brother, what ratio of tt gear motor do you use 1 : 48 or 1 : 200 ?

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад +1

      @@peerapongseangkhuntee6450 I used 1:48 gear ratio motor . It’s very cheap. I will make sure to add links of components in the description so that it will be useful. Let me know if you need more info .

  • @samirmirza6575
    @samirmirza6575 3 года назад +1

    PCB single hai ya double use kara hai?

  • @samirmirza6575
    @samirmirza6575 3 года назад +1

    May i use your project ? for my final year project

    • @hashincludeelectronics
      @hashincludeelectronics  3 года назад

      I am very glad that you liked this video 🙂. I would be very happy if this is helpful in your project . Please go ahead and it would be nice if you could give credit to my channel.
      Please don’t forget to like , subscribe and share among your friends too 👍🏻all the best .

  • @shreeharily
    @shreeharily 3 года назад +2

    Yay

  • @gauravganesh2007
    @gauravganesh2007 2 месяца назад +1

    where do you live

  • @musicalvibe3343
    @musicalvibe3343 9 дней назад +1

    Bro pls reply

  • @haterlog8825
    @haterlog8825 2 года назад +1

    Motor rpm?

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      Thanks for checking out video 👍🏻these motors have gear ratio of 1:48 . Max rpm would reach around 150-200 rpm with lipo 3s battery .

    • @haterlog8825
      @haterlog8825 2 года назад +1

      @@hashincludeelectronics can we use 300rpm motors?

    • @hashincludeelectronics
      @hashincludeelectronics  2 года назад

      @@haterlog8825 yup we can use it .

    • @haterlog8825
      @haterlog8825 2 года назад +1

      @@hashincludeelectronics thanks bro 😊

  • @onlytech4799
    @onlytech4799 3 года назад +2

    Are you Indian?

  • @samirmirza6575
    @samirmirza6575 3 года назад +1

    Bro check your email again..sorry to disturb you

  • @samirmirza6575
    @samirmirza6575 3 года назад +1

    I had sent you mail please check it

  • @Nirajsharmaaa
    @Nirajsharmaaa Год назад

    Problem in coding
    1) mpu.dmpGetCurrentFIFOPacket(fifoBuffer))
    2)pitchPID.Compute(true)
    3) yawPID.Compute(true)
    This problem is arising while compiling the code, what is the reason.

  • @-pavanisai
    @-pavanisai 6 месяцев назад +1

    Sir i want this project how can we contact you

  • @atulgo22415
    @atulgo22415 3 года назад +1

    Awesome