Self Balancing Robot V2 Final Build


Hardly coming soon,its here!!


Ok so where do we start?? Lets start with the Schematic and PCB design.

Schematic and PCB Design

After completing the first self balancing robot, I wanted to make something that felt more that a collection of bits, something a little more integrated but still retain the ease of use for the Arduino and also ease of assembly so anyone could have a go. I decided to make a single board replacement for the Arduino Uno that all the other modules could be mounted directly on. I basically just implmented an Arduino Uno cut down to the core, so the microcontroller, oscillator and reset and power supply components. This formed the core of the design.

The MPU module mounts directly to the PCB, its designed to be mounted vertical on the board, which as a result has it horizontal to the ground when the robot is balanced. I utilised DRV8825 stepper motor drives for this project again as they have proven to be reliable and easy to work with. I recommend mounting headers to the board so they can easily be removed (just in case you want them temporarily for another project). 

The HM-10 Bluetooth LE module also mounts on the PCB, keeping the size nioe and compact. A programming port was a last minute addition. It is designed to allow an FT232 FTDI USB to TTL module to plug straight in. This has made code changes and serial monitoring so myuch easier and was a worthwhile addition.

The Schematic and PCB deisgn can be viewed and downloaded on from my EasyEDA project site on the link below. If you would like to construct your own robot, you can order PCB's on the EasyEDA site for $2 + delivery and its super easy and quick. There is a parts list on the project as well, I just ordered my components locally.

You can watch a walk through of the schematic and PCB design on my YouTube channel as well. (please like and subscriber, it really does help me)


Robot Enclosure

What next, how about the case, I designed this in Fusion360, wow it is super easy to use. I printed the enclosure in PETG as I was a little worried about the potential temperature of the stepper drivers and motors, I also saw some flexing on the version 1 robot so thought PETG would be a better option. It took a while to get th eprinter dialed in on PETG but the result was good in the end.

The Fusion360 files can be viewed or downloaded at the links below and the STL's will be in the Github repository for download.


Bill of Materials

Component Name Qty
U1 L7805ABV 1
X1 16 Mhz Xtal 1
C3,C4,C5,C8 100nF Capacitor 4
C1,C2 22pF Capacitor 2
C6,C7 47uF 25V Electrolytic Capacitor 2
R1,R4,R5 1K 0.25W Resistor 3
R2 3.3K 0.25W Resistor 1
R3 2.2K 0.25W Resistor 1
SW1 SPST Momentary Pushbutton Switch 1
P1,P2 2.54_1 x 2 Male Header 2
U3 GY-521 MPU6050 Module + 2.54_1 x 8 Female Header 1
P3,P4 2.54_1 x 4 Male Header 2
LED1 LED 3mm Green 1
LED2 LED 3mm Red 1
U6 HM-10 Bluetooth Module + 2.54_1 x 6 Female Header 1
U4,U5 DRV8825 Stepper Drive Carriers + 2.54_1 x 8 Female Header x 4 2
P5 2.54_1 x 6 Female Header 1
PCB Custom designed PCB - available from EasyEDA 1
Enclosure Custom Design 3D Printed Enclosure - PETG -  available from Github 1
Wheel Rims Custom Designed 3D Printed Wheel Hubs - PETG - available from Github 2
Tyres 2pcs Yellow 65mm Smart Car Model Tire Wheel Robot Part DIY Toy available from EBay 2
Stepper Motors NEMA 14, OSM MPN:14HS130804S 1.8 degree - available from EBay 2
Battery 11.1V 1500mA 3S LiPo Battery 1
Main Switch SPST Toggle Switch 1
Wire Hookup Wire 1
Header connector 2.54_1 x 6 Male Header - one strip 1
XT60 XT60 Connector 1
Screws M3 caphead screws 15mm 8
Screws  3mm Metal Screws 4



The construction is pretty straight forward as everything mounts on the one PCB. There is a silk screen overlay on the PCB design which makes it nice and easy identifing where components go. Start with the components that are low to the board and work up to the higher components. I recommend using headers for the plug in modules rather than soldering straight onto the board. I also recommend using headers and pins for the plug in wiring as it makes it nice and easy to assemble and disassemble as required. Don't for get to install the heatsinks on the motor drivers.

I have made two YouTube videos on the construction as I needed to redo it when I changed the PCB design. Pleas etake a look at them as they could be a help to you.




The Code

So its time to take a look at the code. I have published the code to Github on the following link and I have a YouTube video that walks you through the code. I have also put a link in to the version one code review as it covers off on the way the stepper motor driver code works. If you have any questions, please leave a comment or email me.



Calibration and Setup

OK so we are at the end, almost!! There are a few things we need to adjust and set before we can have the robot up and about. I have made a video that walks you through the process. Again, if you have any questions, just ask away and I will do what I can to help.



Ok so if all went well you now have a robot that will happily balance all day, well until the battery gives up. If you have an Apple device I have a built an App that you can use to control the robot. I am submitting it to Apple for approval to have it in the App Store, however for the moment contact me if you would like a copy.


Comments (2)

  • Amanj 20.05.18

    hello and thanks very much for your good projects. what is the model of your stepper motor? if it is nema14, the shaft of nema14 is 5mm, but the shaft of the wheel that you design is difference. can you explain this foe me? thanks best wishes

  • Grumpy 28.05.18

    Yes NEMA14, I have added the BoM now

Leave a Comment