Reverse Engineering Hoverboard Motor Drive

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

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

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

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

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

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

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

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

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

      2. Seems bad..
        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?

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

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

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

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

  3. 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:
    https://en.m.wikipedia.org/wiki/Local_Interconnect_Network

    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:
    http://www.wolftronix.com/E10_LithiumUpgrade/index.html

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

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

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

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

  6. is there any way to edit out the trolls…?
    this is about hoverboards, motors and their software protocols…
    NOT POLITICS…
    would all you trolls get a life, and put your comments in a place built for it… NOT HERE…

Leave a Reply to neuromancer2701Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.