Introduction: Make a Self-balancing Robot With Arduino UNO

Self-balancing Robot is very interesting. Many friends around us were trying to make one, but they encounted a lot of chanllenges including the lack of the easy-to- assembly structures, the suitable electronic circuits and the programs. So I decided to make a self-balancing robot as simple as possible.

Thanks to Arduino team that almost every
maker has one Arduino board in hand. Among those Arduino boards, Arduino UNO R3 is the most universal entry-level board. Arduino UNO is open source and there are huge of applications based it. We want to help those who has the similar idea of making a self-balancing robot based on the Arduino UNO.

After a period of preparing including learning theory, programming, making PCB and etc..

My goal comes true and now I'm sharing with you.

Support us on Indiegogo.

Step 1: Preparing

I want the assembly of self-balancing robot to be very easy. It doesn’t need much wires, complicated connections and testing, just like playing with LEGO.

I designed a balance shield that includes gyroscope and motor driver part on it. After times of testing, it can now always work perfectly. Thanks to this shield, as it makes everything much easier.

Bill of the main materials:

  • 1 x Arduino UNO R3 or compatible board
  • 1 x Balance Shield for Arduino
  • 2 x High torque&speed motor with encoder
  • 2 x Wheels
  • 1 x 5mm Acrylic board
  • 2 x 3mm Acrylic board
  • 1 x 11.1V Lithium battery or
  • 1 x 18650 battery holder and 3 x 18650 batteries
  • N x Screws and Nuts

Step 2: Install Two Motors

To make the whole structure strong enough, I use a 5mm thickness acrylic board to fix the two motors.

Step 3: Install Two Wheels

Mount two wheels to the motors and put the motor’s wires out through the slot of the acrylic base board.

Step 4: Install the Acrylic Board for Battery

Install the 3mm acrylic board for fixing the battery.

The battery can be 11.1V battery for model aireplane, either be 3 18650 batteries.

If 18650 batteries are used, it needs to use a battery holder for that.

Step 5: Install the Battery

Using nylon ribbon to fix the lithum battery.

After the battery is fixed, we can now add a new layer of acrylic board by some screws.

Step 6: Install Arduino UNO and Balance Shield

Here we install the Arduino UNO and the Balance Shield with some screws.

The Shield has pin headers for connecting the wires from two motors.

There are also led indicators ,a buzzer and a power switch. A blue-tooth port is easy to connect a blue-tooth adapter for communicating with other device. 4 io pins of Arduino are left,use to connect other sensors or RC receiver .

Step 7: Programming and Run

Programming the code to the Arduino.

With the Balance Shield, and the Arduino collects the angle from gyroscope, position from motor’s encoder then process them. It will control two motors to keep balance.

Step 8: More Applications

With more adapters like bluetooth, WiFi, and RC Receiver, we can control the Balanbot in different ways.

I wrote an application running on computer and another application running on android. So i can easily adjust PID parameters and control my balance robot by android mobile phone via blue-tooth ,gamepad via computer and RC remote .

The balanbot works very stable because of the two high torque&speed motors and the optimized algorithm. It keeps balanced even when you push it suddenly.

It took me a lot of time to get the best matching PID parameter for Balanbot.

Thanks for reading to the end, but I believe the making for more interesting things never ends.

Comments

author
SpringS2 (author)2017-08-31

Please send me the code

thank you so much :)

springstudio.vn@gmail.com

author
ShehanK1 (author)2017-07-19

Please send me the code,

thank you so much :)

squad4promo@gmail.com

author
dls sp (author)2017-06-20

could you send me the code please?

ncmamm@gmail.com

author
splodgie (author)2016-07-10

All of you asking for the CODE, try reading the Ible and use some common sense.

https://drive.google.com/open?id=0B_d2pPrExdfYd3hx...

Link for the Idle.

author
MuammarY (author)splodgie2016-10-06

Thank you!!
Finally, someone speaks my mind.. it just feels wrong reading an instractable without finding a senseless comment like:

"Send me AND JUST ME the code and the schematic and probably a copy of the robot to my email: Moron@StealingProject.com
Warning! Do not share the schematic or code on the website but send it to the only worthy person here which's me"

Morons!!

author
splodgie (author)MuammarY2016-10-06

Yep you do get them. I post projects on YouTube and get the same, Send me the code I need it now for a school project. where did you get the parts from that you made ?. I do persevere with them sending everything they normally ask for.

I got at a bloke who uploaded a ible last week, asking him to put the original coder back in his arduino.ini code download link he had made, he never got back to me about it but days later I checked the code link and the original coder was back in the .ini file.

author
galdinofsneto (author)2016-08-26

ola, estou construindo um destes e preciso do codigo e do esquema alguem pode me enviar, obrigado.


Olá, eu estou construindo um destes e precisa do código e esquema alguém pode me enviar, obrigado.

galdinofsneto@gmail.com

author
wattstar (author)2016-07-28

Is there somewhere online where I can order the Acrylic board cut using a template?

author
jnhernan (author)2016-06-23

Please, send methe code

jnhernan@gmail.com

author
stormbr (author)2016-06-19

I need learn this.

alexandre_ar@msn.com

Many thanks.

author
ThirunavukarasuD (author)2016-06-18

Superb Job

Can you send me the code

Thanks in advance

d.thirunavukarasu@gmail.com

author
jnhernan (author)2016-06-15

Fantastic Job!

please send me the code and schematic?

Thanks!

jnhernan@gmail.com

author
AndreF49 (author)2016-06-15

Great Job!

please send me the code and schematic?

Thanks!

andrep.defaria@gmail.com

author
NdamonaU (author)2016-06-12

hi guys... send me the code too

ndamonauunona@gmail.com

author
the07ruben (author)2016-06-08

guys does anyone have code?

pls share this code ı really need and ı ll apprıcıate

thank you

here ıs my gmail : the07ruben@gmail.com

author
NgocL9 (author)2016-06-04

please send me the code. thank you!

lengoc1997th@gmail.com

author
AriesS10 (author)2016-05-26

please send me the code, thank you!
duongvu.av@gmail.com

author
هوملزخ (author)2016-05-22

pls send me the code , thank you

saif120009@cceoman.net

author
AshkanK1 (author)2016-05-21

pls send me the code , thank you

Ashkan.khajeh@gmail.com

author
dac phuocp (author)2016-05-16

Can you please send me the code ? Thank you so much.

phamdacphuoc1995@gmail.com

author
MārtiņšK6 (author)2016-05-14

Hi. I`m making segway, could you please send me the code ? mkadakovskis@gmail.com

author
Mr.S16 (author)2016-05-11

i really want code and schematic, send me please!

chelsee9x@gmail.com

Thank You !

author
c0nan (author)2016-05-09

Can you please send me the code and schematic ?
dbgt640@gmail.com

Thank You !

author
RonY6 (author)2016-04-22

Can u send me the code and schematic please

roniiymerii@gmail.com

author
PutraP3 (author)2016-04-19

i proud it

please send me the code and schematic?

putra.pamungkas00@gmail.com

author
VoH7 (author)2016-04-17

Great !!!

can you please send me the schematic and code?

vohung8385@gmail.com

author
KesavanathJ (author)2016-04-15

cool and amazing job !!

would really appreciate it if u could send me the code

kesavanath@hotmail.com

author
SuhaoL (author)2016-04-13

Can you please also send me the code? ?
Csolim@hotmail.com

author
majd95 (author)2016-04-07

it's an amazing job !
if you send me the code I'll be so grateful for you :)
mlr.t3ys95@gmail.com

author
Mlhomsi (author)2016-04-07

Can you please also send me the code? ?
mlhomsi@gmail.com

author
teitan (author)2016-04-06

Hi,

Great job !!!

can you please send me the schematic and code?

teitan1@walla.com

author
anandhsrinivasan (author)2016-03-30

Can send me the code

anandhs1996@gmail.com

author
XuanW (author)2016-03-12

Hi everyone, I felt confused about the code in line 243;pwm = (Angle_Car-5 + K_Base)* KA_P //P

+ Gyro_Car * KA_D //D

+ Position_Add * KP_I //I

+ Position_AVG_Filter * KP_P; //P

does anyone know why use Angle_Car minus 5 and then plus K_Base?

Thank you:)

author
RicardoN19 (author)2016-03-10

could you send me the code please?

rickynieto97@gmail.com

thx

author
CoryH23 (author)2016-03-09

Can you please send me the code

hortoncory77@gmail.com

author
majd95 (author)2016-03-07

can I have the the code please !
mlr.t3ys95@gmail.com

author
vsandhu (author)2016-03-06

send me the codes too..

vardeep.sandhu277@gmail.com

author
somesh1 (author)2016-03-05

nice....can u send me the code ?

shahsomesh1@gmail.com

author
JoseC203 (author)2016-03-03

EXCELLENT PROJECT, CAN YOU SEND ME THE CODE? jvcortes2013@gmail.com

author
HosamȜ (author)2016-03-02

very nice! can you please send me the schematic and code? 7ossam.elwan95@gmail.com

author
YoussefG8 (author)2016-02-25

nice job! would you please send me the schematic and code ?

ghorab_1995@hotmail.com

author
YoussefG8 (author)2016-02-25

nice job! would you please send me the schematic and code ?

ghorab_1995@hotmail.com

author
leon.t (author)2016-01-09

I have completed the hardware part. But facing some problems with the code. But i really like to finish the project as soon as possible. Could you please send the code to me --> leontalukdar@gmail.com, Thank you.

author
sprotte24 (author)2015-07-15

I got my BalanBot kit before about 1 month from makerstudio.cc.
My first problem was:
Because of the photos I assumed the Arduino Uno belong to the delivery.
This was not the case, and the Arduino Uno is also not listed in the bill of materials.
The BalanBot kit from makerstudio did not supply a single sheet of
paper, not any hints for adapting the Arduino ports or installing the
code.

I asked Steve from makerstudio.cc for schematics.
Steve sent me a schematic for the balance shield and a schematic for the bluetooth 2.0 shield.

Feel free to ask me for sending you the schematics.
My mail address: djk24@arcor.de

After I had bought the Arduino bought later and adjusting the code a bit, I could take the BalanBot in operation.
That means, the BalanBot balances standing on the floor.
In a further step I added the bluetooth 2.0 shield.
No I was able to let the BalanBot run by control with my Samsung S3 smartphone.
I wanted to steer the BalanBot using the Android gravity sensor. That did not work. :-(
I would like to stay in contact with other users you for further exchange of help and experience.

Dietrich

author
walck_s (author)sprotte242015-11-06

Hey, where did you find the code? I built it and would like to make it work .. Please share, my email is l.walckenaer@gmail.com, Thanks!

author
walck_s (author)2015-11-06

I have completed the hardware section and really would like it to work, please share your sketch code with me - l.walckenaer@gmail.com, Thank you much!

author
ValmorM (author)2015-11-06

I have completed the hardware section, please share your sketch code with me - valmor_mello@terra.com.br, Thank you much!

author
HendrikZ (author)2015-10-01

I have completed the hardware section, please share your sketch code with me - hendrik.zwiegelaar@gmail.com, Thank you much!

author
GloriaC14 (author)2015-09-17

Hi could you share a code to choikayam@gmail.com? Thanks! I feel interested on your work!

author
LongL6 (author)GloriaC142015-09-29

Do you have a code? If you have share to me , please

About This Instructable

88,865views

155favorites

License:

Bio: I am maker_studio and I love to build the robot of Arduino and DIY something fun. Here is something new&fun: kck.st/2q0eCUG
More by maker_studio:How to DIY a set of pictrue pannel earphonesHow to build  a Bluetooth wireless upload Self-balancing RobotHow to DIY a magnetic car mount QI wireless charger
Add instructable to: