element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Better World with Arduino
  • Challenges & Projects
  • Project14
  • Better World with Arduino
  • More
  • Cancel
Better World with Arduino
Blog Self Balancing Triangle Robot | Balancing Inverted Triangle | With Ultrasonic Sensor, Servo Motor and Arduino | Shifting Centre of Gravity to Balance
  • Blog
  • Forum
  • Documents
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Better World with Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Robotics_EveryDay
  • Date Created: 30 Mar 2022 6:13 PM Date Created
  • Views 7705 views
  • Likes 8 likes
  • Comments 3 comments
  • servo motor
  • self balancing robot
  • robotics
  • better world with Arduino
  • arduino
  • sensor fusion
  • betterworldch
Related
Recommended

Self Balancing Triangle Robot | Balancing Inverted Triangle | With Ultrasonic Sensor, Servo Motor and Arduino | Shifting Centre of Gravity to Balance

Robotics_EveryDay
Robotics_EveryDay
30 Mar 2022
Self Balancing Triangle Robot | Balancing Inverted Triangle | With Ultrasonic Sensor, Servo Motor and Arduino | Shifting Centre of Gravity to Balance

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image
What is your project about?

This is the triangle. Which will try to balance itself. With the help of all the sensors & actuators on board.

Why did you decide to make it?

To make a balancing robot without using the MPU-6050 IMU. Instead, used a conventional ultrasonic sensor.

How does it work?

It is an Inverted Triangle. With counterweight on the servo motor to balance itself. And an ultrasonic sensor to detect the falling direction.

When the triangle is upright, its center of gravity remains right above its base. If the triangle falls left, then the CG Shifts left. And moves beyond the base. so the triangle tips over. The same goes for the right side.

So, to keep it balanced. We have added a servo motor. With counterweight on its shaft.

Now if the triangle falls on one side, The servo motor will move the weight to the opposite side. So their combined CG remains at the same place.

Scrap Cardboard Box

image

Take a scrap cardboard box. Cut it as per your requirement. Then fold it to form a prism shape. Stick it with tape. This will be the body or fuselage of the robot. We will mount a Servo motor on top of it. The wings will be inserted into their sides.

Cutout Wings

image

From the same cardboard box cut out two longer pieces for making wings.

Join Wings With Fuselage

image

Make holes on either side of the fuselage. The dimensions of the hole must be equal to that of the wings.

Make Holes in Fuselage

image

Take reference to an ultrasonic sensor and make some marking on the wings. These markings need to be cut out and the sensor will be inserted into them.

Ultrasonic Sensors

image

Take two ultrasonic sensors. There are two sensors. But, the other sensor is just for equal dead weight, it is not connected.

Inserting Ultrasonic Sensors

image

Inserted these sensors into the holes on the wings.

After Inserting Sensors

image

This is what it looks like after inserting sensors on both of its wings.

The Servo Motor With Link Attached

image

Take a servo motor. Take a long metal link and attach it to the horn on the servo motor. Some weights can also be attached to this link.

Making Holes in Fuselage

image

Make some holes in the fuselage to mount a servo motor.

After Attaching All Sensors & Actuators

image

Attach the servo motor on the fuselage with the help of a string/ zip tie/ wire.

Circuit Schematic & Simulation TinkerCAD

image

This is the circuit schematic of the self-balancing triangle.

Interfacing With Microcontroller

image

Write the code and upload it to the microcontroller.

The code should have logic such that whenever the triangle falls on the left side, the link is moved right. And whenever the triangle falls towards the right, the link should be moved left. To counterbalance.

Working

When the triangle is upright, its center of gravity remains right above its base.

If the triangle falls left, then the CG Shifts left. And moves beyond the base. so the triangle tips over. The same goes for the right side.

We have added a servo motor. With counterweight on its shaft. Now if the triangle falls on one side, The servo motor will move the weight to the opposite side. So their combined CG remains at the same place.

Conclusion

We are not able to balance the triangle. But no regrets. We will modify it further. to make it balance itself in its next version.

Robotics EveryDay!!!

Code

#include <Servo.h>
Servo m;

int t = 6;
int e=  7;
double d,dp=0;

void setup() {

  pinMode(t, OUTPUT);  //trigger pin
  pinMode(e, INPUT);  //echo pin
  m.attach(3);       // motor at pin 3

}

int distance(){
  
  long duration, cm;
  
  digitalWrite(t, LOW);
  delayMicroseconds(2);
  digitalWrite(t, HIGH);
  delayMicroseconds(5);
  digitalWrite(t, LOW);  
  duration = pulseIn(e, HIGH);


  cm = duration/ 29 / 2;
  
  return cm; //returns distance in centimeters
}

void loop() {

  d = distance();
  
  if(d<18 && d>0){
    m.write(180 - ((dp*0.95 + d*0.05)*10));
    
  }
  
  dp=d;
  delay(25);
}

CAD

Schematic

  • Sign in to reply
  • beacon_dave
    beacon_dave over 3 years ago

    This looks similar to the Reading 'Griimblebot' which has ultrasonic sensor out on a single 'wing' measuring the distance from the ground.

    Grimblebot - self balancing robot:
    https://www.youtube.com/watch?v=EDbRQ8Id4iY

    It uses the more traditional wheel design instead of a moving pendulum to adjust CoG.

    DJ did an Arduino self-balancing robot design over on Element14 Presents a while back:

    Episode 491: Arduino Single-Wheel Balancing Robot:
    /challenges-projects/element14-presents/project-videos/w/documents/5273/episode-491-arduino-single-wheel-balancing-robot

    not sure if any of his Arduino feedback loop control code may help. He also used a primitive balance bar arrangement to help balance the robot initially to a more stable pose. Could be an alternative way to balance if motorized, a bit like a tightrope walker's balance bar. (Extra points if you stick a wheel on it and get it to cross a rope) 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • robogary
    robogary over 3 years ago

    cool idea.  Could help to use a little trig for adjusting the weight position by the angle arm of the servo, essentially  open loop torque at the balance point of the free body diagram. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 3 years ago

    I like it, sort of like a dog using its tail to balance.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube