Search

Balancerobot Raspberry Pi 3

About the project

Talking BalanceRobot Raspberry Pi 3 written in c++ for Linux Raspberry

Project info

Difficulty: Moderate

Platforms: Raspberry Pi

Estimated time: 4 weeks

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

18650 battery 18650 battery x 1
114990584  ARM Raspberry Pi 3 Model B 114990584 ARM Raspberry Pi 3 Model B x 1
2 x 12V 37mm 350 Rpm 30:1 DC GearMotor with Half Encoder 2 x 12V 37mm 350 Rpm 30:1 DC GearMotor with Half Encoder x 1
RPi Motor Driver Board RPi Motor Driver Board x 1
MPU6050 MPU6050 x 1

Software apps and online services

https://github.com/takyonxxx/BalanceRobot-Raspberry-Pi https://github.com/takyonxxx/BalanceRobot-Raspberry-Pi

Story

BalanceRobot Raspberry Pi 3

Project on github:

https://github.com/takyonxxx/BalanceRobot-Raspberry-Pi


Components:

RPi Motor Driver Board for Raspberry (each channel supply 5a)
https://www.waveshare.com/wiki/RPi_Motor_Driver_Board

MPU6050 (6-axis motion-tracking device that combines a 3-axis gyroscope and a 3-axis accelerometer) With MPU6050 , you can get stable angle when the Kalman filter is used. Place the sensor in the lower section, middle part of robot. I put it in the middle of two dc motors. This prevents oscillations.

2 x 12V 37mm 350 Rpm 30:1 DC GearMotor with Half Encoder

Raspberry Pi 3

18650 battery holder,

The Balance Robot parts are:

For autostart the app on raspberry boot please read below instructions. 

Remote module written in android studio java ,
for controlling robot via Rfcomm serial bluetooth connection.
Please first pair your android device with rapberry pi, and run remote android app on phone than keep it in listening mode. 
After run raspberry pi code with sudo. The default start mode is off (m_IsRunning = false). 
You can press start button from android app to power dc motors
or set m_IsRunning variable to thing you want true or false for start option.

in BalanceRobotPi/main.cpp, plaese change the mac address to your android phone mac address std::string RfCommAndroidMac = "XX:XX:XX:XX:XX:XX";// change it with your phone mac

Building code: 

  1. cd BalanceRobotPi
  2. qmake, make
  3.  
  4. sudo apt-get install build-essential
  5. sudo apt-get install alsa
  6. sudo apt-get install qt4-default
  7. sudo apt-get install espeak
  8. sudo apt-get install libasound2-dev


Please install build-essential, alsa , qmake and espeak before compile. 

Schematics and circuit diagrams

robot chasis

Code

the main.cpp full project is available on github: https://github.com/takyonxxx/BalanceRobot-Raspberry-Pi

BalanceRobot-Raspberry-Pi

Credits

Leave your feedback...