Arduino self balancing robot

Hello makers in this article I will show you how to make self balancing robot using Arduino Nano as there are already articles on how to make balancing robot using UNO

Why Arduino nano balancing robot

Main factor of consideration is weight and size UNO is 4 times the size of Nano for this project I am specifically focusing on size, Performance wise Arduino UNO is better but what we require for this project is present in nano

What is balancing robot?

Balancing robot is seen in many areas, In industries those are use to transfer objects from one place to another common application is in Segway or small 2 wheel scooters that self balances itself so as to have a safe ride!

How does it work

In common a sensor that measures balance in real time are used, For easier understanding i will explain taking an example of spirit level that will be use to check levelness of a surface but those don’t have feedback but when it comes to electronics small quartz that moves providing real time feedback is made use here

So when it moves far away compared to given limit-set, it adjusts accordingly

For this purpose we are using MPU 6050 sensor that has inbuilt gyroscopic sensor that can detect orientation in addition this also has accelerometer and temperature sensor but those are not our cup of tea here!

let’s start to make this project by gathering supplies

Required materials

  1. ACP SHeet / Metal frame preferably aluminum because of light weight and sturdiness that is important in our project
  2. Two pieces of Nema 17 Stepper Motor
  3. L mounts aka stepper holders
  4. A 4988 stepper motor drivers
  5. Arduino Nano and MPU 6050
  6. HC-05 Bluetooth
  7. Zero PCB Female Header
  8. Wheels for stepper motor
  9. EZ-GUI App download this application Here

Building Stages

Stage 1 is to cut ACP sheets that makes frame for this balancing robot, For comparison from visual below clamps are kept side to side with sheet

Building phase 1
Building phase 1

I cut rectangular piece of aluminum and l channel Mount at first

Start by marking and making holes on sheet to attach stepper Motors to the L mount, I drill holes in the rectangular aluminum sheet and insert clamp screws can refer for same in images below

Self balancing robot frame installation
Self balancing robot frame installation

Adjust the mount configuration so that it doesn’t pass outside of metal frame

Make three layers of same dimensions as we require 3 to our project

Attach stepper Motors on this mount and tighten with screws

Make sure to have it fix very tight as this part will be supporting other parts

stepper installation
stepper installation

To make elevation/steps I use pencil you need four pencils

Steps were built in following pattern one on middle one on top and other on bottom adjust equal distance between 3

Frame height
Frame height

Circuit diagram for self balancing robot

We need empty PCB and headers to support stepper motor drivers, Arduino Nano and mpu6050 and lot of solder lead to make the circuit connections

Below is circuit diagram for this project

Don’t forget to add good quality switch between battery and arduino power input pin

Self balancing robot circuit diagram
Self balancing robot circuit diagram

Here stepper motor drivers control stepper motors and to connect them directly I made use of header pins, some modification might be necessary in stepper connectors if you are making it by yourself

Individual motor control in real time is possible since we have 2 drivers

This project is wireless because of Bluetooth module

After these step we will end up with complete circuit of this project that is ready to be setup

Placing hardware components

assembly of robot
assembly of robot

Entire setup will be placed on the middle layer while to cover this I will be adding top player which was pre-cut earlier

To control this entire project I made use of switch and rechargeable lithium-ion batteries from my old laptop batteries

After placement is complete connect all the wires to this hardware components

Lithium Ion batteries were connect in series so as to provide 12 volt approximate supply

Using double sided tape fix fit to the bottom part of the frame

3rd plate will be attached above final part is attaching wheels to the stepper Motors shafts. Tighten to shaft using screw, Well i think those doesn’t require any visual steps!

Uploading code for arduino robot

Code uploading steps

Connect arduino Nano to arduino IDE during this process make sure to unplug the Bluetooth module

copy paste this code to arduino IDE , select port number and click on upload

After code is done upload completely disconnect usb cable from computer

later connect Bluetooth module and switch on the project by pressing power on button

Open ez-gui application on your smartphone, if you don’t have get it here for free

From top right and click on connect after connecting click on the three dots on top right side

Click on advanced option then untested later model control

Then option to adjust the sensor will pop up, Now balance entire structure using hand this will be a one time process after this your self balancing robot will start to balance itself while you can control the forward and backward motion using smartphone

Since we are using rechargeable batteries which has high backup capacity you can play with this device for many many hours!

Arduino self balancing robot
Arduino self balancing robot

Why Stepper motors for balancing robot?

Many might be thinking why costly steppers are used herein this project instead of normal gear motors or those inexpensive BO motors

I appreciate your thoughts but like all other type of motors mentioned above which doesn’t provide movement accuracy like stepper motor does

Hope your question was answered, if any other questions strike you after reading this let me know in the comments

Also make sure to have a look on working video of this robot

NextPCB PCB Manufacturers Company 

 

1st Thanks NextPCB  for sponsor this project. Nextpcb offer  For New Customer, Your First Order Will Be 10 PCBs for just $0 at Free.

NextPCB   one of the world’s most professional                PCB manufacturers based in China. With professional PCB manufacturing capabilities, for each file of our customer will be double-checked by more than 14 years PCB engineers. they handle the whole process of PCBs including the PCB assembly ,PCB manufacturing, testing and final shipment.

 

 

 

Video for self balancing robot using arduino or Segway

Watch full working of self balancing robot video here

 You are missing out great content if you still didn’t check how to make 3D printed CNC machine check it Here also our recent Make Mini bluetooth boombox project

Social media & sharing icons powered by UltimatelySocial
0
Would love your thoughts, please comment.x
()
x