Balanceboard input device

Posted on
  • Hey there,

    this is my very first electronics project and I'm a little overwhelmed.

    I want to turn a balance board (see image below) into an input device using an original Espruino board and a MPU6050 gyroscope/accelerometer. It's supposed to be foot-controlled, when I tip the Balanceboard to the right, the cursor should move right on my computer screen.

    From what I understand, my microcontroller needs a USB HID mode (and maybe other stuff that I'm not thinking of), to be utilized as a mouse.

    Does that mean I can't use my original Espruino board for this project or is there some kind of workaround?


    1 Attachment

    • balance_board.jpg
  • Would the electronics (Espruino and Gyro) on the board communicate wirelessly to the computer?

    If so, you would have them talk Bluetooth / BLE to the computer, either directly or through another Espruino that plays the mouse or keyboard USB HID.

  • Right now the Gyro is wired to the Espruino and the Espruino is connected via USB cable to my laptop. I don't have a Bluetooth module, but I guess I could get one.
    If the Espruino uses Bluetooth to talk to my computer, how would that solve my "no USB HID" problem, though?

    EDIT: Ok, dumb question. I guess not actually using USB solves my no USB HID problem just fine :D

  • This conversation about USB HID Support on Pico! gets you started. I do not know what board you have, but any Espruino can do.
    Connecting the gyro and transform the gyros output to input to the computer is the next thing.

    Checkout @ClearMemory041063 's conversations... he did a lot with gyro/magnetic fields. He used a different device but used a lot of math to get good values out of the sensor(s).

    --- EDIT --- I'm mistaken on that 'any Espruino can do' as @Gordon points out in the next post: the original board has an 'older' processor that does not have the appliances to support the USB HID Support.

  • Great, thanks! I will look into that.

  • Hi!

    I do not know what board you have, but any Espruino can do.

    I'm afraid this isn't the case. The Original Espruino won't do USB HID, however both the Espruino Pico and WiFi boards will. There's some info and example code on using them here: http://www.espruino.com/USB

    Another option if you wanted to go Wireless is to use Puck.js, as that can emulate a Bluetooth LE wireless keyboard, and you can still connect your gyro: http://www.espruino.com/Puck.js+Keyboard

    If you're dead set on using the original Espruino then you'd have to write some code on your PC to take the data sent over USB and translate it to keypresses/mouse input though, which could end up being a bit more of a pain - we could still try and help you with that though.

  • Ok, thank you for clearing that up!

    Writing it myself is not a something I want to focus on since I have a limited amount of time and there are other boards that provide USB HID.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Balanceboard input device

Posted by Avatar for frontsidekante @frontsidekante

Actions