The must-have toy of the moment last winter was the “Hoverboard”. We all probably secretly wished them to be the boards from the Back to the Future series of films made real, but the more achievable reality is a self-balancing scooter somewhat akin to a miniature Segway. It seemed every child wanted one, schools banned them, and there was a media frenzy over some of the cheaper models that lacked protection circuitry for their li-ion batteries and thus had a tendency for self-incineration.
[Drew Dibble] is interested in the Power Racing Series (PRS), in which toy electric cars are souped up for competition. Casting around for a source of cheap and relatively powerful motors he lit upon the self-balancing scooters, and waited on Craigslist for the inevitable cast-offs. His resulting purchase had two 350W brushless hub motors and all the associated circuit boards for motor control, gyroscope, and oddly a Bluetooth speaker. The motor control board received an unknown two-wire digital feed from the scooter’s control board, so he set to work investigating its protocol. His write-up of how he did it is an interesting primer in logic line detective work.
Hooking up his logic analyzer he was quickly able to rule out the possibility of the control signal being PWM because all signals followed the same timing. Both lines had data so he was able to rule out I2C, for in that case one line would carry a clock. He was therefore left with a serial line, and taking the 38 microsecond timing interval, he was able to calculate that it had a rather unusual bitrate of 26315 BPS. Each packet had a multiple of 9 bits so he either had 9-bit or 8-bit with parity, and trying all possible parity schemes resulted in parity errors. Therefore the boards used a highly unusual 9-bit non-standard bitrate serial port. Some experimentation led him to an Arduino library, and he was able to get some movement from his motors. Some clever timing detective work later and he could make them move at will, success!
All his code for the project is on GitHub, for his 9-bit SoftwareSerial library and a motor control sketch.
If you want a real Back to the Future hoverboard then you may have to wait a while longer. We have featured a replica made as an unrideable floating artwork though, and a working board that is more of a personal hovercraft.
56 thoughts on “Reverse Engineering Hoverboard Motor Drive”
Do you have torque at low speed with such a system ? I would like to use it at a brushless platform for a robot lawn mower.
If you don’t then some gearing should fix that.
At 350W per wheel I’m thinking maybe making a pair of e-bikes out of one.
Gearing would be tricky as the stator windings are built into the wheel, which has a rim and accepts a tube/tire (at least for the 10″ model I used). The motor control board could be used to power a similarly sized shaft 3 phase DC motor with hall effect sensor feedback though. The hub motor windings are 0.5 ohm, lead to lead.
You’d probably have to weld/epoxy a gear onto it, which could be a pain.
Most of the hub motors that I have seen are a planetary gear set around a central 3 phase dc motor. So it would be a lot of work but you might be able to change the planetary gear ratio to have higher torque.
Should have plenty of torque for that application. Remember, these things move adult humans..
Electric motor tend to have the same torque all the way regardless of the rpm. They will increase the amps until it reach the requested speed or blew the electronic –whichever sooner. Usually the controller have some sort of protection against the later.
I’m working on a R/C lawnmower too. Just got a pair of new 350W @ 36V wheel/motors. I will run them on 12V since (hobby, car) ESC’s get rather expensive for higher voltages. I needed to get both forward and reverse, hence the car ESC’s. My old Neuton lawnmower has two 12V batteries; I’ll run each motor from a separate 12 battery. Speed is not an issue with a lawnmower! I plan to steer it “tank style” using 2 sticks on my Tx.
You’re going to lose a lot of efficiency by undervolting them. Cool project though.
I need to reconfigure the hoverboard battery pack to 12 volts. What I would like from you is the info necessary to run the wheels on 12 volts and any consequences that result from doing it. Thanks.
Fun fact: In some european countries – e.g. Germany and Switzerland – these things are completely illegal to operate. They fall under the same category as small mopeds, which means they require registration (license plate), technical approval (brakes, a steering wheel/handlebar, a seat, lighting etc.) and also a drivers license for small vehicles with a mechanically limited topspeed of up to 45kmh (that’s the only one you can get in Germany at the age of 16). Note: this is only the case on public property, if you’re on private property with a fence/wall and gate surrounding it, you can do whatever you want.
So, when a 12 year old roams around in the town/city on such a thing and a policeman has a bad day, this kid is in serious trouble.
Well that sucks! I don’t care for ‘hoverboards’ but geez, the government regulations in some places.
So having a technical approval for brakes is not good?
Who controls them then?
Most regulation is there for a reason. Besides, you can do whatever you want in your property, what else do you want?
You do want to go to a doctor/surgeon that has a diploma and degree, isn’t that regulation?
You want the pilot of your plane to have a pilot license, isn’t that regulation?
I think the bigger (and underlying) issue here, is that people believing in the fallacy of free market think the market would self regulate: in this case if somebody has an accident with one of these things because of faulty brakes, then he would sue the company or something, maybe be on the news for 3 seconds.
What happens in real life (and not in the unicorn free market no regulation bullshit land) is that the company is not local, the guy who has the accident has no money to sue a big company and in the end nobody gives a fuck.
Google in Germany: “we spied on millions of wifi networks?, sorry it was bug”
Germany: “really? a bug? then it’s fine, nothing to see here”
And so precedents are being set and people conditioned to accept that accidents are actually bugs, and since people are also being conditioned to think that bugs can be fixed (even if that does not happens; look at all the mobile phones, routers and other stuff running insecure software) then there should be no consequences to accidents…I mean “bugs”, with a net effect of nobody being responsible for anything.
And people want self-driving cars…
Well, I wouldn’t want a brake on a balancing board. At least I wouldn’t use it at speed… It might end badly. Fortunately here there is a little less government overreach.
That escalated quickly….
I’ll just give @sorry_it_was_a_bug a ‘TL;DR.
Until you think a bit. And realise that there are a hell of a lot of idiots about. And even if it is their fault, someone still has to get over smearing them all over the road. How is that fair?
Something like this might help. http://pccocwv.com/roadkill
Too many regulations. I’m not against most.
Please feel free to put a license plate and mirrors on your hoverboard if you want to. ;)
Happily, in european country, the cop will not shot the boy, even if he is black.
where’s the arduino in this?
Because, Europe. The U.S. and Russia are where all the fun stuff happens, though the American Nanny Party is doing its best to squash that.
Mass shootings and corporate lobbying are fun!
OKay, all the fun stuff and all the crap stuff. But still, all the fun stuff. I would feel suffocated living in the EU. Brexit FTW!
I’m pretty sure any electric motorized vehicle is illegal in most places in the US as well, but that doesn’t stop anyone from using them, nor should it. If nobody broke the law by riding them, lawmakers wouldn’t be forced to fix the law, and an entire industry for small electric vehicles would cease to exist.
Most problems with hoverboards have been them catching fire while charging which have lead to stricter import controls in Europe. You can of cause still legally buy one for yourself for around 79$ Direct from china. (The European importers markup is as always insanely high). A HAL sensored brushless motor can give plenty torque at low rpm if you want to use it on a robot.
Link to the $79 offer?
Found it on Alibaba Express on the manufacturer’s web store, last year, checked again 3 months ago. Take a Look here: http://www.aliexpress.com/w/wholesale-hoverboard.html?site=glo&g=y&SortType=price_asc&SearchText=hoverboard&groupsort=1&initiative_id=SB_20160611014201&shipCountry=DK&needQuery=n
Shipping is expensive and might need to be with something else than free china post air mail because of the batteries, thus susceptible to customs and handling!
You can get a refurb hoverboard from hobbytron.com, which is in socal I believe, for $99. Components are also cheap from that site (replacement control board for $10, battery pack for $40, etc). Not sure how reputable this site is.
I was reverse engineering the serial protocol that the microcontroller in the Nissan Leaf battery pack BMS uses to talk to the balancer chips and thought it was some weird proprietary protocol… but turns out it was LIN bus:
Probably something similar… just not a well known serial protocol.
And for those interested in the Nissan Leaf BMS reverse engineering, still a work in progress:
Hey Wolf! Thanks for all the work you did on Solectria Teardowns – it really helped me with my Force rebuild. Funny that we visit the same forums…
Has he figured out how to make the battery explode yet?
I can’t be the only one considering the potential of these as drive systems for combat robots.
I’m thinking about turning it into a version of that one-wheel motorcycle…! Dunno if 2x350W motors are grunty enough though?
Sorry if somewhere it was mentioned but, are the motor shafts encoded?
The feedback from the motor shafts is from hall effect sensors (there is a link on the blog post to a doc about how 3-phase DC motor controllers work). The motor control board takes care of position sensing. AFAIK, you can’t set the position via the serial protocol as you could a stepper or servo, only the speed and direction.
I think as hoverboards they suck. But as a parts source they rock. I have 3 of them that I will be stripping the parts to make one monster 6 wheeled RC offroad drone.
Thats a great idea! We should buy all the bad, dangerous battery ones off of Ebay. :)
I have a pair of motors but no way to drive them I tried RC ESC’s but had no luck
How well do the motors work as generators? Could make for a relatively cheap way to build a DIY windmill…
Unfortunately, most motors have to be disassembled and rewired for the intended average speed of the rotor/shaft. I don’t know how well these would work without modification. You could add a gearbox but that would reduce efficiency dramatically.
There is an overwhelming amount of designs and ideas online. Good luck if you try it out!
I want to use 4 switches instead of gyroscope sensors
What changes can be made to circuit to do that
Hi there, I wired the hoverboard motor driver up and tried your code but I can not get it to work… Any ideas of incompatablility? Also, which wire color is connected to MOSI and MISO respectively? Thanks a lot!
Hi there, I’ve wired my arduino up exactly as you have but I am not getting any movement from the motors when I change the values with they keyboard in the serial monitor. Any ideas? Thank you
Sorry. My English is a little weak. What I would like to say; Cancel the hall sensor on the device and connect it throttle instead. How can I do it. Thank you.
So the motors are DC? Will the wheels power up if you connect them to a 36Volyt battery?
Where do I connect the 2 wires?????
Do you think there’s a way to motor controller in torque mode? I’d like to dictate torque instead of speed.
Could you draw the wiring or schematic? Thank you in advance :)
i have a problem because when i watch the trame send by sensors, there are 8 values (the six first are the same 256 lowbyte highbyte lowbyte highbyte 85) and i find 2 others identicals values after. I don’t know what is the signification of this 2 values becauses they often change. Can you help me ? Thank you
Hi, I am trying to make the openchair project, it use STM32F446RE, but I cannot get it to work with the available code …the chip on motherboard of hoverboard is GD32F103RCT6, Any issue about incompatablility? Thanks a lot!
It’s powerful. Looking stylish fulfill with all features.
is there any way to edit out the trolls…?
this is about hoverboards, motors and their software protocols…
would all you trolls get a life, and put your comments in a place built for it… NOT HERE…
How can I use hover board motors without motor controller. Can I use relay?
Please be kind and respectful to help make the comments section excellent. (Comment Policy)