What is it?
Twin wheeled skateboard that works like a Segway. Electric skateboards exist already with powered rear wheels. Plan here was to build something like a Segway but in the form of a skateboard. It knows which way is "up" via a combination of gyroscope and and accelerometer sensors, using a complementary (not complimentary) filter which reads and combines data from both 100 times per second. Steering by a simple rocker switch in hand controller (or a rewired Wii-Nunchuck as in photos if you are more ambitious).
Upper photo is original budget version with two lead-acid batteries and solid wheels. Lower photo is 2013 not-so-easy-build version, with pneumatic tyres and Headway LiFePO4 batteries just to see how far I could push this overall concept. More on the new one is here: https://sites.google.com/site/onewheeledselfbalancing/Home/18-2013superskate

NOTE: All my self balancing projects are now documented on my Youtube channel here: Click

UPDATE regarding IMU's and CODE (December 2014):
This Instructable is a little old now and the IMU used is no longer available. Therefore I have removed the pages that describe the IMU wiring and the code as it is confusing people.

If you use a digital Sparkfun 6dof IMU (which is much more easily available) then for instructions on how to use this with an Arduino, to control a self-balancing skateboard, with code, then look at this new Instructable of mine here:

Also there is a scooter I have made inspired by the 1970's Raleigh Chopper with updated (December 2014) software using the same easily available digital IMU from Sparkfun: Raleigh Chopper inspired self-balancing scooter.

If you want to build a big unicycle check out this one I built with two friends for the 2014 Hackaday competition, called the MediCycle: http://hackaday.io/project/1156-Medicycle---Urban-...

Can I buy one ready built?
Well, looks as if you now can. The German S-Walker looks strangely familiar!

Also there is the "One-Wheel" single wheeled skateboard which was a recent Kickstarter project: One-Wheel

For a good electric unicycle you can buy check out this very recent Russian one (about US$1000): Russian electric Monocycle

How does it stay level?
It controls the wheel motors so the wheels always stay under your centre of balance, like balancing a broomstick on your fingertip. This is called a "PID" control system and is used for all sorts of control situations. Think of the 363 feet high Apollo rockets used in the moon landings..........
Q: How come they didn't just fall over when they took off? They took off incredibly slowly for the first few seconds, tailfins would have no effect, far slower than Shuttle launches. Watch this video - it takes a full 10 seconds just to get to 100m and clear the launch tower:
A: They had engines mounted on swivelling mounts hydraulically controlled by a PID control system (lots of analog electronics I think involved too). First stage projected guidance system failure rate was approx. 1 in 256 which was considered an acceptable risk (!)

In 2008 I saw a YouTube video by Ben Smithers of his one-wheeled self balancing skateboard whizzing around a car park in Norwich UK. http://www.robosys.co.uk/ Video: http://www.youtube.com/watch?v=HGbbag9dklU
It turns out he was a Lotus cars controls system engineer - which makes sense.
Also see Trevor Blackwell's site: http://www.tlb.org/eunicycle.html
Meanwhile I wanted to teach myself microcontroller programming and, totally underestimating the task, thought this would be a great fun way to do this. Advantage of two wheelers is that they turn more easily and can turn and balance even when stationary - which is fun. I (used to) prefer skateboards to segway clones as you just jump off if it goes wrong without tangling in the handlebars.

Why an Instructable?
Having learned lessons the hard way I thought it would be worth redesigning the project around an Arduino microcontroller, then seeing how low-cost and easy-build I could possibly make it. Something like this is not for the complete Arduino beginner, nor is it that "easy" however this is about as easy as a self-balancing machine is realistically ever going to get.

Projects like this lend themselves to being built as a team. Some examples below were built as college projects. There are
i) some electronics (not making circuit boards, just wiring and soldering) to master,
ii) some mechanical fabrication; this version is designed to require no welding, just nuts bolts and some woodwork. Wheel/sprockets/axles/bearings come as a unit (electric scooter rear wheel assemblies).
iii) some programming; the programs (Arduino sketches) you need, including those to help debugging, are attached (P43 - 47).
There are; IMU tester, motor tester, balances-nothing-else, rocker switch steered and potentiometer steered code examples.

How much does it cost?
I realised when costing them up that the cost of a self balancing robot would only be a little lower than that of a ride on machine, therefore I went for a ride-on machine! For me the cost was about $300 equivalent PLUS whatever batteries you choose to use. I recommend starting with lead-acid batteries then make improvements later once you have a working machine.

Why do it?
i) For the challenge of doing something original. Segway skateboards have been invented in principle BUT there is huge room for improvement.
ii) Making something that is practical and intuitive to ride is quite a challenge in terms of both electronics/software and fabrication/packaging. Cannot all be done on a computer. Eventually you have to actually build something then incrementally improve it. Despite the myth of "Eureka" moments, the truth is that this is how most innovations come about, by slow incremental development and hard work. Edison did not invent the lightbulb. He developed the first practical lightbulb.
iii) To educate yourself, you might become a world expert, there are no textbooks so you are genuinely pushing into the unknown with each machine you make. Few things as an individual hobbyist allow you to truly do this.
iv) These machines are really good fun to ride!

This instructable:
There are a large number of pages in this. This is deliberate, if you are serious about building one then you need every single step documented.

Additional information:
I have documented all my machines both good and bad on another website here:

Can I do this as a beginnner?
The fabrication has been deliberately kept really simple.
The soldering between sensors and arduino board needs to be good quality!
If you are new to Arduino I would recommend buying an Arduino starter kit. These come with some ancillary sensors etc. and a set of about 12 tutorials. Work through them all (about 2 days work) and read a beginners book to Arduino. You will then be ready.

Can I build a SegwayTM clone?
Yes. Australian SciTech group have built a very low cost machine using a version of the Arduino code from this Instructable: https://www.instructables.com/id/Self-Balancing-Scooter-Ver-20/
Here also is the Thatch No-Way Segway using my code almost unaltered: http://www.youtube.com/watch?v=R4ax3N0UW38 and more recently the Jackal: Jackal

Has anyone else built one?
Ages currently range from 12yrs to 81yrs.
This Instructable is over a year old now, so yes indeed, people have. Here are a few I know of:
1) Skateboard: http://www.youtube.com/watch?v=kSW7YXLCjqk
2) Skateboard: http://www.youtube.com/watch?v=u-uUidBZEnM
3) The Velociryder: http://www.youtube.com/watch?v=xvfUIxusPZw&feature=player_embedded
4) Great board video - Buffalo State College senior project: http://www.youtube.com/watch?v=FEaTxahyQxc
5) Another board based on this Instructable: http://www.youtube.com/watch?v=vhbH_AmIKZA&feature=related
6) A board based on old FIRST robotics parts + code from this instructable (FIRST robotics was started by Dean Kamen who also invented the Segway, to encourage youth to get interested in engineering): http://www.youtube.com/watch?v=Vh9LpNQ_S0k&feature=related
7) Carbon fiber racing car seat with 2 - the SciChair: http://www.youtube.com/watch?feature=player_embedded&v=HtivH7INpZ4
8) Carey's self-balancing platform, good video: http://www.youtube.com/watch?v=ngMJcxeB7og
9) Really cool video (on clifftop path by the sea): Skate auto-balancé http://www.youtube.com/watch?
10) The KSLURP board from Malaysia: http://www.youtube.com/watch?v=x3O2NkjJOlg
11) The MIT Seboard, video clip: http://www.youtube.com/watch?v=zZQb-w_wyhM
12) The SITWAY sit-on machine by the 81year old gentleman above, with video: https://www.instructables.com/id/SITWAY/
13) This one has nothing to do with me but is such a really cool inspirational project I include it here, the TILTER skateboard, with hub motors and a suspension system: http://www.youtube.com/watch?v=WsYukdSO64A&feature=player_embedded
14) New one wheeler from team cosmos with some technical information and video here: http://teamcosmos.com/skateone/index.shtml

Potential areas of improvement
It would be cool if people took this design and improved upon it.
The only way I can envisage further improvements in terms of weight reduction and compactness on my 2013 design with Headway cells and pneumatic tyres would be as follows:
a) Make frame from welded alloy.
b) The cheap scooter motors are quite heavy so use equally powerful but lighter, smaller combat robot motors.
c) To reduce length and make even more compact, someone, say a mech eng student, could design a neat hub motor for each wheel using epicyclic reduction gears.

You build these at your own risk. If tilted they WILL accelerate to correct the tilt. If you are not on the board, this means it can fly across a room or into your head. This is why you have to have an emergency hand switch that cuts the power if you let go of it. If it develops a fault it does not have multiple redundant systems like a real segway, most likely you will fall off! The code is not guaranteed against any bugs. If you don't believe me here is a video of Clint Rutkas developing a similar machine, also featuring some holes it punched in the walls of his apartment! http://vimeo.com/2013773

Have fun. Treat it as an adventure. Once you get it to balance there are many ways to improve it.


Step 1: Parts

Here are the parts laid out on floor
<p>I am using a 36V DC motor (MY1020z). It has<br> a rated current of 21.3A. Can I use three 12V 7Ah SLA batteries in <br>series and run the motor. Will these three batteries in series be able <br>to deliver the rated current, or will they get damaged?</p><p>Or should I<br> go for three such batteries in series and having two more such strings <br>in parallel to get combined battery pack of 36V, 21Ah. Will this be a <br>feasible option?</p>
<p>So let me throw something 'out there'.. without re-inventing the wheel.. no pun intended.. </p><p>My kids have the regular looking self balance boards or &quot;hoverboards&quot; you see every where,,, each wheel is independently controlled and each its own gyro blah blah blah... I noticed my son riding in circles while only stepping on one side of the board sensor... &quot;IDEA&quot; so I opened it up to have a look at the guts.. Wanting to change the overall configuration to more of a Skateboard riding stance style...</p><p>Follow me here,,, one sensor connected to gyro/accelerometer on one wheel through both sides are plugged into 1 control board for independent control,,,,so why not remove or Buy or part out a control board, a foot pad sensor, the gyro/accelerometer along with the electric wheel ( motor is built in ),, re configure the setup to look like the picture above pertaining to wheel placement...</p><p>All the electronics are already made and readily available,, I have seen several electronic replacement 'Kits' for those hover boards costing around $80 for all the electronics- control board, gyro/accelerometers etc... If you look inside the hover balance boards you can see how everything is mounted and placed,,, especially the gyro/accel board would be the most important placement on the New board..</p><p>therefore no re calculating voltages, amps,, blah blah blah stuff that's already done for you. Plus using the Li-On battery vs heavyyyyy lead acid save a ton of weight, no chains, no belts, only direct drive... </p><p>Although I'm a fan of Arduino, I am seriously thinking about trying this,,, so don't shoot the messenger here,,, what do ya think???</p><p>BTW,,, great article!</p>
<p>Someone on Hackaday has recently worked out how to use an Arduino to control the motor controller within those hoverboard toys. They use an unusual serial protocol. Therefore if I were to make this board now I would use two hoverboard wheels, the motor controller, their battery pack and an arduino with my own IMU.</p>
<p>Hi John, I was wondering where i could find the code with the Nunchuck modifications in it. And i have another question: in this istructable it is said that the Nunchuck must be attached to analog 1, 5 and to digital 9 pins of the arduino, but ist allready used the analog 5 for the &quot;scl&quot; pin of the IMU?</p>
<p>Hi, I've added your project to the <em style="">&quot;A Collection of Homemade Electric Motorized Skateboards (That You Must Make!)</em><em style="">&quot;</em> Collection</p><p>This is the link If you are interested:</p><p><a href="https://www.instructables.com/id/A-Collection-of-Homemade-Electric-Motorized-Skateb/">https://www.instructables.com/id/A-Collection-of-Ho...</a></p>
<p>Do u connect the motor driver to Arduino direct?</p>
<p>do you think a couple 100watt e100 scooter motors would be suffucient? ASAP</p>
<p>The Sci-Tech team from Australia who also have an Instructable, made a mini Segway using two 100 Watt electric scooter drive motors, so yes, on level ground at least, it would probably just about be OK.</p>
Can I use the same process to build a airwheel or solowheel <br>I'm doing this as my final year project<br>Plzz let me know....
<p>Yes you could. However, these Chinese machines keep getting cheaper due to the market saturation from all the competing Chinese manufacturers so actually would be good and educational to build you own but it would probably cost you a similar amount as buying one. My Hackaday project called the MediCycle is a self balancing monowheel. New version under construction........</p>
<p>Hey xenon jonh. I liked ur project a lot and i want to make an upgraded version of it that will work like the zboard but without weight sensing. But i know very little about arduino programming. Can u help me. Is there a way to recognize when i shift my weight forward or backward? (Using the accelerometer i think). We can then fix a notched disk on the front portion of the board, beneath which there will be a potentiometer. When we will put our heel on the disk and rotate it, the board will turn accordingly. Can u please help me with this idea. I really wanna learn. Plz reply fast.</p>
<p>I think there is an example of a board that is steered like that in the example links on page 1. The &quot;Velocyrider&quot; I think it was called, google it.</p>
thank you very much .<br>I show my schooter
<p>Do you have a video of it on the web anywhere?</p><p>It as very good to see people building them, if only to prove that the thing in the Instructable can actually be built!</p><p>Best wishes, John</p>
<p>helo,, can i have a flow chart to do this project </p>
<p>i want to make it for my final year project</p>
what was the autonomy with these two batteries?
what was the autonomy with these two batteries?
<p>Hello,</p><p>can I use MPU6050 (6DOF) gyro instead of 5DOF gyro..</p><p>Thank you.</p>
<p>this is a free ride :-)</p>
<p>Hello,Im in search of someone that has the skills to build an electronic device.</p><p>If you can be of service let me know tyffanij5@gmail.com</p>
<p>is there any way to build this without the hand controller </p>
<p>hello</p><p>i have found your code for grove analog gyro and accelerometer with the nunchuck</p><p>but actually i cant found it </p><p>can you publish this ?</p><p>thanks a lot</p>
<p>i found this IMU http://dx.com/p/gy-85-6dof-9dof-imu-sensor-module-for-arduino-148436#.Uv_JhfldVwx it is a reliable website</p>
<p>Hi,</p><p>Just pointing out that the IMU above is a digital output one that does not work with the code in this instructable that was written to work with analog (variable voltage) output IMU's. These are becoming quite hard to find however.</p><p>This is why I have had to recently rewrite the code and add a new related instructable that shows you how to make a balance control system using a digital IMU.</p><p>John</p>
<p>Oh, i already ordered this IMU, i even started the project. I am making more like a onewheel-frame. i got all the aluminum parts and cut them up to shape, i picked the aluminum frame up from the welder today, i am using a small 24 volt DC motor. i got 4 small 7 ah 6 volt batteries and a velleman P8004 motor controller. I dont know if it works with my arduino UNO yet but its what i have (i am using a cigarette lighter 24-5 volt adapter as a power supply for my arduino, they're really cheap and function well) , otherwise i will buy an arduino motor controller like the sabertooth. Also, i am planning to add a light sensor as a dead-man switch, that way when somebody steps off the board it stops, i dont need a steering switch etc so i think i am just gonna remove those lines of code. i added pictures (the pics of the frame have low quality because my camera sucks at low-lighting). maybe i am going to upload videos someday. Thanks for the new code, helps a lot!</p><p>Sorry, i dont know why but my English is sort of broken today, usually it's better. :/ (i am dutch). </p>
<p>Looks good. I have no idea if the digital IMU you have bought will work with my new digital IMU code as I have only tested it with the 6dof digital IMU from Sparkfun. I am sure you will find out soon enough!</p><p>John</p>
<p>If you want, let me know maybe i can send pictures in the future.</p><p>zetowe</p>
<p>Please do. Your metalwork looks really neat and tidy.</p><p>John</p>
<p>Hello XenonJohn,</p><p>I have not done an update in a long time (i think about 2 months). I have been working on it but i ran into a lot of problems and i didn't quite get the time to fix them because school is busy lately. No time for excuses tough. I am gonna do an update once it is finished, nothing in between. I will make a video of me riding it and showing the inside lay out etc. I will post it right here. See you then!</p><p>Zetowe</p>
<p>Ok, no problem, but please note, i am not doing this project bcause i know how to do it, i am doing it to learn how to do it so there might be a bit of a time-gap between every update.</p><p>Zetowe</p>
<p>You are a great genius John!</p><p>Congratulations, you have given new hope to all of us, </p><p>regards, </p><p>Gerry</p>
<p>Hi zetowe,</p><p>can I please ask what is the logic you intend for your light sensor?</p><p>Without your advice I am thinking it is like a solar cell and if you block it with your foot and so your logic is drive the motor when the sensor is not generating or sending any voltage (if solar cell). But problem in my mind is if you put some dirt from your shoe on the sensor then it stay in drive mode when you are off it?</p><p>Such that I am interested to learn what you think about the logic for this process. thanku</p>
<p>Another option is the Sharp infra red rangefinder available from robot sites. It fires an infrared beam at an angle and looks at the reflected light. If you have it facing upwards and you are on the board, it will see light reflected from your foot. If not on the board it will not. You would have to recess it about 3cm into the board (for the shortest range one they make).</p><p>Another option is a cheap pressure sensitive resistor mounted under a rubber disc. Look how its resistance changes, set up a voltage divider with another resistor, feed the changing voltage into an analog input and with some adjustment of the limits in the code it will work.</p><p>You can also use a rugged metal push to make foot switch that you stand on, - recess it into the deck. These exist as foot switches to trigger alarms by shop cashiers for example.</p>
<p>Hello eyrecamp,</p><p>You have a very good point, but i think that my shoes don't get dirty enough to completely block the light sensor, i live in a city with mainly pavements, i dont think dirt will be a problem for this idea. (i included a pic of the light sensor)</p><p>(general update)</p><p>I also just got the IMU in the mail! It has the right voltage and the pins have the same names (i included a pic of the soldering so far), i hope it works, if it doesn't it will be hard to determine what doesnt work, its either the IMU not working with the code or it's the motor controller not working with arduino. i still need to find the 2 100 Ohm resistors. I really hope it just works, that way it stays simple.</p><p>zetowe</p>
<p>Hi zetowe, </p><p>you are fortunate that you can keep your shoes so clean!</p><p>Personally I cannot yet bring myself to trust this as a fail safe.</p><p>Do you have any specific identifier data on that light sensor?</p><p>I would like to learn more about that one.</p><p>My current thought is a two wheel unit with a pressure sensitive system. No pressure applied is signal to cut out the motor, then I'd like to be able to bias left and right side pressure to bias drive to one motor in order to steer. Probably there are some floors with this concept.</p>
<p>Hello eyrecamp,</p><p>Personally i have decided to use a switch because it indeed is more reliable. If you are still interested here is some info.</p><p><a href="http://m.eet.com/media/1049853/C0086-Table1a.gif" rel="nofollow">http://m.eet.com/media/1049853/C0086-Table1a.gif</a></p><p><a href="http://en.wikipedia.org/wiki/Photoresistor" rel="nofollow">http://en.wikipedia.org/wiki/Photoresistor </a> </p><p>I hope this was helpfull to you.</p><p>Zetowe</p>
<p>Great mate, thanks I had no problem finding this option.</p>
<p>Hello to all,</p><p>can anyone tell me if the IMU is oriented correctly? </p><p>Thank you, Regards</p>
<p>Other way up. The edge with the two large holes in it faces upwards. Then run the IMU tester sketch.</p><p>John</p>
Ciao Giovanni, ho ruotato l'Imu di 180 &deg; e allegato inviare le immagini del monitor seriale. Pensi che i valori sono coerento o sto facendo qualcosa di sbagliato? Grazie, cordialit&agrave;, Gerry
<p>Hi, we can correspond by email and I am sure we will sort this out.</p><p>John</p>
<p>We did sort this out and his machine works now.</p><p>John</p>
<p>Hi, I'm needing to get a copy of the code for this project!?</p>
<p>my mail is eyre.c@hotmail.com.au</p><p>further, I am considering using the hub motors (8 or 9 inch), in order to reduce mass. Do you know if sabertooth motor driver will provide the power and control through to these motors....? I will chase up some specs if necessary.</p>
<p>The Sabertooth only works with brushed motors. There are some small brushed hub motors out there, but in general, hub motors tend to be brushless nowadays. I have built a machine like a segway with brushless hub motors and a very expensive Roboteq Brushless motor controller but that is another story. It can be done but it was expensive and it would not go up any kind of slope (lack of torque).</p><p>Also, hub motors do not generate as much torque (twisting force) as a regular wheel with a sprocket chain or toothed belt drive from a motor, i.e. small sprocket on motor and big one on wheel). With self-balancers a generous amount of torque is very useful to have, rather than a high top speed.</p>
<p>so what I can determine is that I can get a hub motor (9inch) to give 12N.m of Torque which would allow drive up a slope incline of 0.054 (on a 0 to 1 scale), I guess if I had two of these it would double the Torque capacity and allow for slope incline of 0.108 (all based on a 100kg loading). This suggests capability to climb a 9 degree slope best case.</p><p>So now I am interested to find what your design rates in terms of Torque generated through the motor and sprockets. Maybe your design can carry a 100kg load on a 20 degree slope!?</p>
<p>Here is links to the 8 inch and the 6 inch hub motors.</p><p><a href="http://www.uumotor.com/air-tyre-8-inch-gearless-hub-motor-36v-350w.html" rel="nofollow">http://www.uumotor.com/air-tyre-8-inch-gearless-hub-motor-36v-350w.html</a></p><p><a href="http://www.uumotor.com/6-inch-36v-250w-small-hub-motor-20kmh.html" rel="nofollow">http://www.uumotor.com/6-inch-36v-250w-small-hub-motor-20kmh.html</a></p><p>Seems that the 6 inch motors are reversible, there is a 9 inch version that has variable speed options, however i have a feeling that a control circuit should be able to provide such convenience with any of these hub motor selections (??)</p>
John,<br><br>thanku for the feedback on the hub motors. It is unfortunate that there is a problem with the torque. I assumed that because they are advertised for scooters and wheelchairs that torque would not be lacking.
<p>Suppose I wanted to build one of these... but I wanted to add a third caster wheel and not worry about the whole self-balancing thing. I just want something I can stand on, be self-propelled, and be able to turn it by some really simple means.. What all electronics could I eliminate? Just the IMU's? Can anybody point me to maybe a SIMPLER Instructable that might show me such a thing?</p>

About This Instructable




More by XenonJohn:Ardu McDuino: Bagpipe playing robot (chanter) Star Wars Maz Kanata Inspired Glasses Music & lights in childproof case 
Add instructable to: