loading
Picture of Easy build self balancing electric skateboard
Titlepic2.jpg

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

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:
http://www.instructables.com/id/Arduino-Self-Balance-Controller-using-DIGITAL-IMU-/

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!
http://www.s-walker.com/index.php/de/products/board

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:
http://www.youtube.com/watch?v=_PEGi3k6yNQ
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 (!)

Background:
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.

Skills:
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:
http://sites.google.com/site/onewheeledselfbalancing/

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: http://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: http://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.


NOTE:
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.

John



 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

Picture of Parts
Here are the parts laid out on floor

Step 2: Scooter wheel as it comes

Picture of Scooter wheel as it comes
Razor scooter E100 chain driven back wheel.
This is great as it fits under board, has axle and bearings all with it, sprocket is ready fitted.
Reduces your work considerably.

Step 3: Closer view of scooter wheel

Picture of Closer view of scooter wheel
We need two of these assemblies.

There is a threaded rod running through entire wheel. There is a tubular sleeve each side, one is short and one is long. The nuts each end clamp tubes to bearing in wheel so everything locks up tight (bearing can still spin though).

Step 4: Dismantle each wheel assembly

Picture of Dismantle each wheel assembly
Wheel is dismantled and reassembled so the long metal tube is on the other side to the one it was originally and the short one is swapped over too. This will allow wheel to be on outside of vehicle with sprocket on inner edge of wheel.

Step 5: Reassembling wheel

Picture of Reassembling wheel
Another view of this process

Step 6: Frame

Picture of Frame
Frame cannot be simpler. Everything will bolt to a 24cm width slab of 2cm thick marine-ply. Anything will do so long as not flexible otherwise tension of drive chains will vary in use.

Step 7: Axle brackets

Picture of Axle brackets
Brackets to hold the axles cannot be simpler either, steel angle brackets from a large hardware store.

Step 8: Trial fitting the axle

Picture of Trial fitting the axle
You can see how this is going to work. 2 brackets face each other and are bolted down to deck. Axle goes through 2 holes, one in each bracket.
Holes have to be drilled to EXACTLY opposite each other.

Step 9: Fitting axle

Picture of Fitting axle
Axle has to be fitted with one of the large washers in this position else there is not enough thread free for the end nuts to tighten everything up solid against the short and long tubes that run over the axle.

Tip: Bolt the axle up like this and tighten everything.

Then, and only then, mark the amount of overlap of the L shaped brackets underneath the wheel where they will bolt to the deck.

Clamp them together and drill the holes through both layers that will be used to bolt them to the wooden deck. I just used a pair of locking adjustable pliers. I also left the axle bolted in place while I drilled the holes (from underneath). Make sure the drill does not suddenly go through and drill a hole in the side of the polyurethane wheel! My baseplate holes are located so the drill bit tip missed the wheel when I made these holes!

This way everything then bolts up straight and true with no headaches!

Step 10: Axle mounts

Picture of Axle mounts
If one of the angle brackets is resting on top of the other, remember to drill the end holes for the axles to take account of this fact! In the end I drilled the holes off to one side as you will see in subsequent photos.

Step 11: Wheels fitted

Picture of Wheels fitted
Here are the wheels fitted and bolted up to board.
Note if you want minimum width wheelbase, as for a self balancing skateboard then you can trim the inner ends of the axles as I have done here.

Step 12: Motors

Picture of Motors
Motors are electric scooter motors from toy scooters. You can get them from electric scooter suppliers or ebay. These are 250Watt 24V each and come with an 11 tooth sprocket already fitted which has teeth spacing that matches those on the wheel sprockets - conveniently.

You could try 300 watt ones (that look almost the same). Just make sure they are the same as each other.

Step 13: Alternative layout

Picture of Alternative layout
I am going to describe simplest layout.

However here is an alternative layout which might be OK for a skateboard and which would mean the batteries will fit under the deck while motors go on top - you would have to make a feature of them though. Chains run vertically. Has a certain symmetry. The "Emanual" board used this layout.

Step 14: Motors above deck?

Picture of Motors above deck?
I tried welding up a frame to mount the wheels so they could be driven by motors on top of the deck. Not very happy with it. It would work but motors would be a long way above wheel sprockets and I am worried there would be a lot of chain slack causing vibrations/oscillations around the balance point.

I did not take this design any further.

Step 15: Chain

Picture of Chain
Chain is ASA 25-1 chain 
I bought 2m of it from "Bearing Boys" UK. Also on rght is connecting link for when you shorten it.

If unsure how to shorten a chain, bike shops will do it for you.

Step 16: Chains fitted

Picture of Chains fitted
Chains must not be too tight or too loose.
Too tight and motors bind.
Too loose and get lots of rattling and judddering when balancing in stationary position as motors go one way then the other very quickly.

Tempting to make the motor bolt holes slotted then slide motors forward and back until tension just right. I avoided this as on a previous project the motor was so powerful it just pulled itself along the slot so chain went loose.

If you can I would measure, measure again, then drill (circular) bolt holes for the motors only after great care taken.

I suggest: Locate motors in exact position to get just a little bit of slack on the chain. Get a pencil and sharpener and sharpen it until it is just a stub about 1 inch long. Carefully poke it through the 4 bolt holes in baseplate of the motor, without moving the motor, and mark on the wooden base where to drill the holes.

This way they should end up in exactly the right place.

M6 bolts go straight into 4 threaded holes on underside of motors.

Step 17: Chain tension

Picture of Chain tension
Here is a chain that is slightly too loose. It is important to get this right.
There is a way to take up a small amount of slack like this:

Step 18: Chain tension 2

Picture of Chain tension 2
Insert washers under inner 2 bolt holes for motor. This lifts motor a tiny bit and chain slack is taken up.
Surgery forceps very useful in this project - also for holding wires for soldering etc.

Step 19: Electronics

Picture of Electronics
NOTE March 2014: See link on title page to my newer Instructable on how to wire one of these up to an Arduino, with code.



Original text:
There is a 5 degree of freedom inertial measurement unit (IMU) from Sparkfun.
This is cheapest one they do that will do the job - a situation that is always changing by the way.

It has a 3 axis accelerometer. We will only use one of these.
It has 2 solid state gyroscopes. One is used with the accelerometer (using a "combination" filter) to make the thing balance.

The other is used to allow machine to resist sudden changes in direction (one wheel hitting a pebble for example) so it does not spin you off. This is easier and more reliable possibly than using wheel speed encoders which is the other way to do this.

I like ribbon cable as it is neat. I also use blu-tack when doing this sort of soldering as it holds wire in exactly the right spot as well as holding the little circuit board still.

I tin the wire ends then solder them to the holes.


Step 20: Arduino power supply

Picture of Arduino power supply
Arduino powered by a separate 9V battery in little box with an on/off switch.

NOTE: Some motor power controllers have a low voltage on board output to power a microcontroller, but the sabertooth doesn't have this. Having a 9V battery like this is just the simplest way around the problem.

This has several advantages:

a) Nice and safe - I fried a £100 gyro once connecting it to one of the 12V batteries (the wrong one)
b) You can debug the software without the main motor controller being powered up.
c) Cheap.

Step 21: Motor controller

Picture of Motor controller

This is a Sabertooth 2 x 25Amp (40Amp peak) robot motor controller for medium sized robots with 2 motors.
Each motor has to be able to go forward and reverse, and switch direction frequently and rapidly without mishap.

The ones I have are 250 Watt 13.7 Amp peak (that is what it says on them). Watts = Amps x Volts and I have 24 Volts so that makes 10.4 Amps using that calculation. Anyhow, well within limits of the Sabertooth.

NOTE: It will handle most forms of abuse and will shut down rather than burn out and so on. It will NOT tolerate having the power supply leads conncted up back to front however - be warned.

Also it has to be able to handle a lot of power as if falling over, motors have to be big enough to allow machine to accelerate fast to bring itself beneath you once again.

Therefore unless you really know what you are doing, designing your own is out of the question.

The sabertooth can handle many types of misuse but you mustn't connect the batteries to it back to front!

The Arduino can send control data to it in several ways but I have chosen a mode called simplified serial mode. The Sabertooth website has a lot of downloadable information on all this.

It isn't exactly low cost but worth the money.

Step 22: Sabertooth

Picture of Sabertooth
The Sabertooth is configured for data streams of various types and various battery types, using a  set of dip switches.

The configuration you need for simplified serial, 9600 baud rate, and lead acid batteries is shown here. All this is also available for download from their websiite.

Step 23: Battery connections

Picture of Battery connections
I have used 2 simple 7AmpHour lead acid batteries in series to give 24V.

The main power switch is in the middle and essentially "joins them together."

Diagram below.

Again, make sure power leads go into the Sabertooth the correct way around.

Step 24: Hand controller wiring

My "de-luxe" self balancing skateboard has a wireless Wii Nunchuck as the control system.

However here we are interested in reducing cost.

Therefore we have a cable with a hand controller on the end.

This has a dead-man switch (cuts motors if you let go i.e. fall off)
Also has steering left and steering right plus a switch to fine-tune the balance point of the platform.

See links on first page to my newer Instructables desribing how to wire up newer IMU's to an Arduino and the Sabertooth, with code.

Step 25: Hand Controller

Picture of Hand Controller
Here is a view of handcontroller internals in a small plastic box.

I used 2 cable ties to locate the end of the cable so it cannot easily be ripped out of the end of the box. Cheap and simple.

Dead man button is on the end.

Step 26: Handcontroller assembled

Picture of Handcontroller assembled
Image of assembled handset

Step 27: Handcontroller input wiring to Arduino

Picture of Handcontroller input wiring to Arduino

Arduino analog inputs all used apart from one for balancing etc.

All handcontroller inputs go in through the digital input pins on other side of the Arduino board.

The cable is fixed to the deck using simple cable ties again so the wires are not stressed where they are soldered to Arduino input pins. The cable itself is screened cable with 6 or more wires inside it.

You can also see the 10K potentiometer used to control the "overall gain" function. This allows simple user adjustment of the machine between feeling "squishy" and "tight" as you ride it.
NOTE: See my links on page 1 to my newer Instructables describing how to wire up newer IMU's to an Arduino and use it to control the skateboard, with code.
These newer versions do not use the potentiometer any more.

 

Step 28: Testing

Picture of Testing

I fixed the IMU with blu tack to start with as you always end up with it back to front or the wrong way around!

When you get it working then fix it properly. Protect it from debris from the wheels and keep it near to centre of the deck by the way - it works best there.
NOTE:  If you hold the IMU with Blu-tack initially, make sure it is a decent sized blob - if IMU is wobbly the board will bahave erratically and oscillate wildly.

Step 29: Anti-tamper power cutoff key

Picture of Anti-tamper power cutoff key
One last thing. At recent maker faire I left my monowheel on a table while I went for a look around.

When I came back there was a small child playing at one end of the table while ??his father was flicking the on/off switch and pressing every button on the hand controller trying to make it "go" - while it was tilted to one side.

Luckily for him the batteries were flat and it wasn't working properly.

If he had been successful, this heavyweight hunk of metal would have thought it was tipping hard over and would have hurled itself at the child with the full 500W motor power. No doubt I would have been blamed.

If you plan to take your creation anywhere public like an exhibition, and leave it for any period of time, I suggest you fit some sort of disabling device like an ignition switch and high current relay (from car spares shop) perhaps, or easiest would be one of these which is a race/rally car emergency battery cut off switch with a key you can remove and carry with you. It will easily handle the high current and adds very little weight.

Step 30: Working

Picture of Working
Here it is balancing.
This version has same motors and motor controller as my previous twin wheel self balancing skateboard so should perfom the same.
Wheelbase is 24cm but if you spaced them further apart clearly you could build a Segway style vehicle.
The idea is that you just bolt whatever you want to the top of it, Segway, skateboard deck, R2D2 or whatever takes your fancy! One of those R2D2 trash cans if modified would fit just perfectly on top.

Main parts (all new):
Sabertooth £97
Motors: very variable on ebay but about £35 each
Chain: £9
Arduino: £20
IMU: £52
Razor E100 rear wheel sets: £24.99 each from a big online electric scooter shop spares department.

Total £273 including purchase tax which I think is pretty good for any self balancing vehicle. Batteries would take you over my £300 target but not by much. Also compares well with cost of conventional 4 wheeled (one motor on one of back wheels) electric skateboards.

UK pound weak at present and Sparkfun and Razor scooters are US based, which suggests that you could do this at even lower cost in the US.

Might possibly be worth trying to buy a used Razor E100 electric toy scooter as this would give you one rear wheel unit, one motor (but might be too small), some batteries to get started with and a charger, then buy the rest as above.

Step 31: Rebuilt on a skateboard deck

Picture of Rebuilt on a skateboard deck
Since first posting this instructable I have taken all the components as in the instructable but mounted them on a skateboard deck insted of the marine ply board.

This has allowed me to test ride it.

As a result of this I have tweaked the code slightly to improve (tighten up) the ride and also have used the second gyro to improve the steering:

When you steer the gyro will adjust power to the motors to create a constant rate of turn. Currently this is set slow at 10 degrees per second but you can alter it in the code. Have done this after feedback from viewers.

You could also use a potentiometer to vary the "target" desired rate of turn if you want to take this on another step (see image on front page and also code attached to page 47).

Code examples attached to pages 43-47 as text files. If you cannot download them message me with a working email address and I will email them to you.

Step 32: View of underside of skateboard

Picture of View of underside of skateboard
Here's what is underneath.

Mount the accel/gyro as close to centre of board as possible. NOTE: I have since moved it to the top of the board, see later pages.

Also if using blu-tack as I did originally for temporary adjustments, make sure it is a big blob and holds it firmly. If it wobbles about the board will oscillate and you cannot work out why!

The board was largest skateboard deck I could get.
Also, it bends down each end very slightly when you stand on it. This makes the chains go slack!
Therefore need to brace it with wood/metal strut down centre or along sides on top of deck. It only has to run out as far as each motor from centre line. This is important, it does matter, binding tight chains mean motor contrioller keeps cutting out, slack chains mean too much oscillation, they have to be just right.


One solution is to use a square of half inch marine ply as mounting for wheels and motors, then just bolt a skateboard on top of this!

With a little welding the motors can be mounted sideways and brought nearer the wheels. This gives room to put batteries underneath (just) and circuit boards on the top in a small housing (see photo on first page).

Step 33: Re-arrangement of components

Picture of Re-arrangement of components
I have found a better way to arrange the components (March 2011).

Use a thick board to mount the motors and wheels to that will not flex.
On top of this bolt a large size regular skateboard deck.
Mount batteries to underside of the skateboard deck, just outboard of the motors, which themselves should be as close to the wheel sprockets as you can get them.
If distance between top of wheels and skateboard deck is 3-4cm you will find the batteries can be fitted underneath. With suitably large (but not too large) wooden bump stops under each end of the deck you can arrange things such that the bump stops hit the ground before the batteries do - which would not be good for them.
Electronics now placed on top of skate deck in small housing. This as also makes them more easy to access.

Step 34: Mounting IMU correctly

Picture of Mounting IMU correctly

One example of how you might mount an IMU and an Arduino on a board.

Step 35:

Step 36: Videos

Picture of Videos
Here are a few videos to keep you going:

http://www.youtube.com/watch?v=engi16bLJe0
http://www.youtube.com/watch?v=engi16bLJe0&feature=mfu_in_order&list=UL
http://www.youtube.com/watch?v=w6dUuGo2TO8&feature=BF&list=ULWzfGzFby4qI&index=13
http://www.youtube.com/watch?v=ygX7ukAIWn0&feature=BF&list=ULWzfGzFby4qI&index=14
http://www.youtube.com/watch?v=MyQ-N-pxh10&feature=BF&list=ULWzfGzFby4qI&index=15
http://www.youtube.com/watch?v=Xtb4wUItBFQ&feature=BF&list=ULWzfGzFby4qI&index=18

The one that started it all:
http://www.youtube.com/watch?v=HGbbag9dklU&feature=related

Step 37: Additional Improvements (1)

Picture of Additional Improvements (1)
IMG_1944.JPG

There are many ways to potentially improve this project, here are just a few

Powering the Arduino
Using a 9V battery to power the Arduino is quick and simple. However it won't actually last that long and when it runs out you may fall off!

A better option therefore is to use a commonly available voltage regulator to convert the 24V from main batteries to a little over the 7V the Arduino needs and run it that way.

The problem is that to go from a big voltage to a much lower one means the voltage regulator generates a lot of heat and may need a heat sink. My batteries are already a little on the small side so I looked for a more efficient way to do this.

A solution does exist; it is called a Tracopower TSR 1-2490. This particular one puts out 9V which is fine for the Arduino. The way it works is very clever but it is very efficient and generates almost no heat.

Similar devices exist to power radio receivers in R/C aircraft from the main batteries, but the one I have used is small and reasonably priced.

Step 38: Pneumatic tyres

Picture of Pneumatic tyres
Pneumatic tyres
You could build this project with a welded frame and pneumatic tyres if you are feeling more ambitious.

Frame is much harder to make however.

These wheels/tyres are Razor E200 rear wheels with drum brake mechanism removed and axles shortened.

Step 39: Rewiring a Nunchuck as a hand controller (1)

Picture of Rewiring a Nunchuck as a hand controller (1)
Step 1,

Take Nunchuck apart. Get a proper Nintendo one if you can as potentiometer has higher resistance than cheaper Chinese copies.

You need a 3 lobed screwdriver which you will have to get from ebay.

Also when the 2 screws are out, you still need to v carefully "pop" it open as there are still some clips holding 2 halves together.

Then, cut back half of circuitboard off completely.

Step 40: Wii Nunchuck rewiring as a hand controller (2)

Picture of Wii Nunchuck rewiring as a hand controller (2)
Next you need to solder tiny wires to each solder point of the 2 potentiometers that are worked by the thumb joystick.

Potentiometers have to have +5V supplied to one end of the carbon track and the other end run back to GND on Arduino.

The "wiper" middle pin of the 3 on each potentiometer, reads variable voltage as joystick is moved and wire from each of these 2 central "wipers" is sent back to the spare 2 analog input pins 1 and 5 on the Arduino board.

The sketch that works with this is attached to page 47 of this Instructable.

NOTE: The ends of the internal tracks of each potentiometer are joined via the circuit board they are soldered to, so you only have to connect a +5V wire from Arduino and a GND wire to ONE of the two potentiometers and then run 2 more wires (one from wiper of each potentiometer) back to the analog input pins on the arduino.

Last of all, You need to supply +5V to one side of the contact pad of one of the end buttons, and run a wire back to Digital Pin 9 on the rduino to make one of the end buttons into the deadman switch (see diagram).

This is all very fiddly, if you are not experienced I would suggest sticking with the simpler box of switches hand control method.

Step 41: Code for use with new 6dof DIGITAL IMU from Sparkfun

There is a problem as most of the analog output IMU's are vanishing from stores and being replaced with digital ones.
I have looked at the Sparkfun 6dof Digital IMU and tried to incorporate code to read the digital output from this into my existing self balance code. Did not want to do it, but this is coming so someone has to have to have a go else nobody will build any more hobby self-balancing machines.

I have used code from the web, full wiring instructions and orientation instructions are given in the attached arduino sketch.

Code to read the IMU came from here:
http://www.varesano.net/blog/fabio/my-first-6-dof-imu-sensors-fusion-implementation-adxl345-itg3200-arduino-and-processing

I have built it into my existing code for a self balancing 2 wheeler that uses rocker switches or buttons for steering and adjustment of balance point.

It is set up at present so you can test it with the IMU attached to an Arduino watching the outputs on an attached computer.

If you want to run it in a real machine then there is a section of code to comment out which then enables all the buttons including the deadman switch.
At present I am using pulldown resistors to GND on the button input pins as in my original instructable here.

NOTE: Unfinished. Not sure if even works but is here as a start for others to work with.

Step 42: Arduino Shield idea for a self-balancer

Picture of Arduino Shield idea for a self-balancer
Just an idea for an arduino shield. I have just made this for someone. The whole control system assembled in one single lump with IMU and hand-controller all pre-attached and tested. See link to video on front page.

What do people think?


1-40 of 583Next »
jellis282 months ago

do you think a couple 100watt e100 scooter motors would be suffucient? ASAP

XenonJohn (author)  jellis281 month ago

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.

abhi9962 months ago
Can I use the same process to build a airwheel or solowheel
I'm doing this as my final year project
Plzz let me know....
XenonJohn (author)  abhi9961 month ago

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........

1101Snehil2 months ago

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.

XenonJohn (author)  1101Snehil1 month ago

I think there is an example of a board that is steered like that in the example links on page 1. The "Velocyrider" I think it was called, google it.

thank you very much .
I show my schooter
1433948053673-14916728.jpg
XenonJohn (author)  Jacob vazquez1 month ago

Do you have a video of it on the web anywhere?

It as very good to see people building them, if only to prove that the thing in the Instructable can actually be built!

Best wishes, John

helo,, can i have a flow chart to do this project

i want to make it for my final year project

what was the autonomy with these two batteries?
what was the autonomy with these two batteries?

Hello,

can I use MPU6050 (6DOF) gyro instead of 5DOF gyro..

Thank you.

danmellow11 months ago

this is a free ride :-)

Tjoydavi1 year ago

Hello,Im in search of someone that has the skills to build an electronic device.

If you can be of service let me know tyffanij5@gmail.com

umerji10001 year ago

is there any way to build this without the hand controller

anthology1 year ago

hello

i have found your code for grove analog gyro and accelerometer with the nunchuck

but actually i cant found it

can you publish this ?

thanks a lot

zetowe1 year ago

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

XenonJohn (author)  zetowe1 year ago

Hi,

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.

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.

John

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!

Sorry, i dont know why but my English is sort of broken today, usually it's better. :/ (i am dutch).

DSC00351.JPGDSC00352.JPGDSC00353.JPGDSC00354.JPGDSC00355.JPGIMG_20140225_231035.jpgIMG_20140225_231119.jpgDSC00356.JPGDSC00357.JPGDSC00358.JPGDSC00359.JPGDSC00360.JPG
XenonJohn (author)  zetowe1 year ago

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!

John

If you want, let me know maybe i can send pictures in the future.

zetowe

XenonJohn (author)  zetowe1 year ago

Please do. Your metalwork looks really neat and tidy.

John

Hello XenonJohn,

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!

Zetowe

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.

Zetowe

You are a great genius John!

Congratulations, you have given new hope to all of us,

regards,

Gerry

Hi zetowe,

can I please ask what is the logic you intend for your light sensor?

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?

Such that I am interested to learn what you think about the logic for this process. thanku

XenonJohn (author)  eyrecamp1 year ago

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).

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.

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.

Hello eyrecamp,

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)

(general update)

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.

zetowe

DSC00361.JPGDSC00362.JPG

Hi zetowe,

you are fortunate that you can keep your shoes so clean!

Personally I cannot yet bring myself to trust this as a fail safe.

Do you have any specific identifier data on that light sensor?

I would like to learn more about that one.

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.

Hello eyrecamp,

Personally i have decided to use a switch because it indeed is more reliable. If you are still interested here is some info.

http://m.eet.com/media/1049853/C0086-Table1a.gif

http://en.wikipedia.org/wiki/Photoresistor

I hope this was helpfull to you.

Zetowe

Great mate, thanks I had no problem finding this option.

Hello to all,

can anyone tell me if the IMU is oriented correctly?

Thank you, Regards

ORIENTATION IMU.JPG
XenonJohn (author)  gerrymazzotta1 year ago

Other way up. The edge with the two large holes in it faces upwards. Then run the IMU tester sketch.

John

Ciao Giovanni, ho ruotato l'Imu di 180 ° e allegato inviare le immagini del monitor seriale. Pensi che i valori sono coerento o sto facendo qualcosa di sbagliato? Grazie, cordialità, Gerry
Platform level.JPGPlatform tilted back.JPGPlatform tilted forward.JPG
XenonJohn (author)  gerrymazzotta1 year ago

Hi, we can correspond by email and I am sure we will sort this out.

John

XenonJohn (author)  XenonJohn1 year ago

We did sort this out and his machine works now.

John

eyrecamp1 year ago

Hi, I'm needing to get a copy of the code for this project!?

my mail is eyre.c@hotmail.com.au

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.

XenonJohn (author)  eyrecamp1 year ago

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).

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.

1-40 of 583Next »