# Electric Unicycle Arduino DIY

28,686

115

58

This is a cheap electric arduino self balance unicykle. Total cost is around 360 USD, and you get a range of 10-15KM. The unicycle works like a Segway just with one wheel.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: Step 1. Parts

To make this you need:

i have bought all on ebay.

• Unicycle 20" Tire 80 USD
• Motor 4-600W DC brushed motor 100 USD
• Old normal 21 gear bike(gears and chain) 10 USD
• BTS 7960 40A 25V motor controller 25 USD
• MPU 6050 gyro 5 USD
• Arduino Nano V3 5 USD
• LM2596 DC DC 3A 5 USD
• 22.2V 10C 10000MAH Nano Mars Lipo 100 USD
• iMAX B6 LCD battery charger 5A 20 USD
• 80A fuse, on switch, main relay. 10USD.
• Total 360 USD.

## Step 2: Step 2. Drivetrain

Her you need a large 48 tooth crankset. Remove the smallest 24 tooth and attach the largest with rubber bearings. Because is really difficult to attach it dead senter. So when you attach the chain is will prevent it to slip out.

I have a 2600RPM motor.

20"*2,54(to cm)*3,14/100=1,59M/RPM.

And i have first 1:3(6-18) in the first chain, and 1:2,7(13-48) in the other. That gives me a total of 1:11.

2600/11=236RPM.

That gives me a top speed of:

236RPM*1,59m*60Min/1000m(in 1 km)=22,5 km/h. But the software limits it to 70%. So 15 Km/h.

## Step 3: Step 3. Electronics

The code is from a segway. Is Ovaltineo that has wrote it and you can fint it here:

I use a 24V 10Ah and its have 240Wh, and it rated at 10C. So it can deliver 2,4KW.

The motor controller can deliver 40A, 960W. And the motor i use is 600W.

You have to find a box of some sort to solder everything together. i have also installed a Horn, and light on it to be a legal "segway" in my country.

## Recommendations

• ### Internet of Things Class

22,809 Enrolled

## 58 Discussions

Hey! I downloaded the zip file with all the code. I am using all the same boards as you (except im using an uno instead of the nano), and I'm wondering what bits of code you uploaded to the arduino? Is it just the MPU6065 code? Or is there another bit from the zip folder I have to upload as well? Thanks.

2 replies

You have to open the Segwayclone.ino file. Then you will get a lot of windows. Under segwayclone.h start by calibrate.

/*

Uncomment one MODE below

*/

//#define MODE_CALIBRATE

//#define MODE_RUN

And you have to use:

#define MPU6050_X1_STEERING

#define PWM_PWM_CONTROLLER

It is also over 1000 post in this forum you can search about it.

Sir I have collected all components for this project.. Can u please guide on the how to put code in Ardiuno..
I have tried the way u told in earlier comment.. But it's not complileing

hello can you help me that 3 days I try to use the library but every time compilation error I would first like to make a prototype with an L298N, MPU6050 and a TT engine thanks

Once I pond the code how do I get it onto my ardwino board?

Hello Markula9

Why do you use two step-down? One I think is for the Arduino and the other?

Congrats

2 replies

Hi

I use the other too 12V 10W led front light, and 1W red back and horn. Is all 12V.

Hello, I am making a self balancing vehicle for my final year project using an MPU 6050, a Genuino board (might be a counterfeit), and a Cytron duo motor driver.

However I am encountering a problem. The gyro sometimes starts giving out random absurd values and at times stops communicating. Do you think a problem with the MPU or the Arduino?

Well if you have problems try to just buy new MPU is 5\$. But before dukument and then change to new MPU. Common problem nois, long cables, connections ?. Then also is it SW/HW problems.

Hi

https://github.com/ovaltineo/SegwayClone

Hey Markula,

It is certainly a good project! And I'm doing a project based on your's, but I'm facing a difficulty: I downloaded the SegwayClone.ino file and I tried to change the code like you said previously in other comments but I can't get it work.