Step 1: Self-Balancer
In actuation systems for automated drones, hover boards, segways, etc. there is an accelerometer that helps the micro-controller tell motor or servo know what to do.
In the case of hover boards and segways they use and accelerometer as an inclinometer, a device that measures the angle you are at. The desired angle it wants to be at is 0 degree forward or backward, so straight up. If the angle is any degree backward or forward the person would fall over. Example a person balancing on top of a ball. (very hard to do) If the person on the ball leans forward or backward too much with out correcting themself then they will fall off the ball. But if the person is correcting themself on the ball, then they will stay on top of the ball.
Arduino UNO Super Starter Kit
Step 2: Materials
The materials you would need for this tutorial are:
You can find them all at this location-Kit
4: 24 AWG Wire
7: Tiny9: RGB Module (Make the lights turn colors if it is in the wrong or right position)
9: 1/18 drill bit
Step 3: SetUp
To get to this point in the tutorial for setup follow the instructions on these tutorials:
Optional tutorial if you want to use the RGB Module
After you have set up your breadboard to this point then we can do these steps.
1: Attach a wire to the red line on the breadboard and connect the other side to the red wire socket on the servo
2: Attach a wire to the blue line on the breadboard and connect the other side to the black wire socket on the servo
3: Attach a wire to D6 on the Arduino Nano and connect the other side to the white wire socket on the servo
Whooo Hooo all done super simple.
If you are attaching a perfboard to the servo like me then her are some steps:
4: Drill in the middle of the perfboard with the 1/18 drill bit.
5: Screw the screw into the middle of the Perfboard and connect it to the servo on the other side.
Step 4: Download .ino
Download here from github the Tiny9: Self Balancer .ino for arduino.
Upload it to the Arduino Nano.
Step 5: Now Enjoy!!!
Now that everything is hooked up and you have the the code in the arduino, move the X axis (see video for orientation) of the breadboard and see the servo move.
Once you have played with the servo for awhile change the code and make it go faster, slower, or create a magnetic robotic arm that can move up and down and pick up things with its magnet.
Disclaimer: This blog is solely Tinee9’s opinions through electrical engineering experience and does not have exact knowledge of the inner workings of DJI products that would compromise IP, or patent infringement. DJI is not a sponsor of Tinee9 but Tinee9 is apart of DJI affiliate and Amazon affiliate program to help earn revenue to keep the website going.