A project log for Android Controlled Self Balancing Robot

A smartphone controlled balancing robot using bluetooth, stepper motors, homemade electronics and 3D designed / printed parts.

Arcadia LabsArcadia Labs 07/11/2017 at 16:180 Comments

I like modularity, so I built the electronics using 2 separate homemade boards : the brain board, and the motors board.

The robot's brain board is based on an Arduino Pro Mini. I choosed this board because it is small, cheap, and because of its Atmega32u4 chip : the robot control needs two 16bit hardware timers, and the Atmega328 has only one while the Atmega32u4 has two. So if you plan to reproduce this robot, you will have to opt for an Atmega32u4 board (Pro micro or Leonardo).

The MPU-9250 IMU is connected to the Arduino using I2C. I also routed 3 additional I2C buses for future upgrades.

The HC-05 uses the second hardware serial port of the Arduino (D0 / D1), while the first hardware serial port is used by the micro-USB for programming the board.

Later, I used 2 more digital pins to wire a SR-04 ultrasonic sensor but it wasn't working too well. So I used a Sharp gp2y0a21f IR sensor on an analog pin instead (can't see it on the schematics because it just basically works at the moment, but it is present in the arduino code on github).

The micro-servo powering the arm uses the D10 PWM pin.

The motors board is based on two A4988 stepper drivers that came from a RAMPS 3D printer kit

Both A4988 stepper drivers use 2 digital pins each for speed and direction, and both share an additional digital pin to enable or disable the motors. I added 3 jumpers on each driver to adjust the microstepping setting, but I'm using 1/16th (robot could also work on 1/8). Two additional 100µF capacitors help smoothing current to the motors.

Both brain and motors board, the IR sensor and the micro-servo are powered by a LM7805 regulator and its two 10µF capacitors.

I later added the 12V 3 LEDs strip, it is wired directly on the 3x18650 batteries output.

Basic schematics are in the project's Github repository :