Puck bigger battery

Posted on
  • @Gordon Is there a guide available to add a bigger battery to the puck ? Looking at making a ble joypad and thinking a 2032 will soon drain.

  • You might be surprised actually - if it's just a joypad with buttons then Puck.js will probably do pretty well (you could make it go to sleep after 15 mins of not being used).

    There isn't a guide at the moment, but as a quick run-down:

    • The maximum voltage for Puck.js is 3.6v, which is too low to run it directly off a LiPo battery
    • You could run it off a LiPo with a voltage regulator though (someone must do voltage regulator + LiPo charger combo boards, in fact you could probably change the resistors on a USB power bank's supply)
    • The simplest method is probably to use a standard Lithium (not ion/polymer) battery like this: http://uk.farnell.com/varta/6127201301/battery-lithium-1-2aa-pcb-3v/dp/463310 - not rechargeable but it's got almost 5x more power than the CR2032. The full AA size ones are even better.
    • LiFePO4 batteries have the correct voltage range too - and are rechargeable. They could be a really good bet
  • I am doing exactly that right now.
    Hooked up an old arcade joystick mechanic to 4 pins on the puck.

    There is not much drain apparently.

    I also disconnect after some seconds of inactivity but not sure if that is actually necessary...

    Mainly there is a setWatch() function for every direction (and later some buttons) - the rest is communication code for establishing, sending and disconnecting.

  • Great thanks for the replies.

    I'm thinking about using a couple of these https://www.adafruit.com/products/2765 to fly a parrot minidrone ( all BLE comms). Big pipe dream with lots of coding ahead.

    Someone has already done alot of the hard work https://github.com/fetherston/npm-parrot-minidrone/blob/master/lib/MiniDroneBtAdapter.js

  • Nice - @ChristianW do you have any pictures? It'd be great to see!

    @Adam79 sounds fun - I have a minidrone too so it'd be great to give it a try if you do it. I know I saw a talk where someone was using it with Web Bluetooth - I don't know if his code might be easier to integrate? https://github.com/poshaughnessy/web-bluetooth-parrot-drone/blob/master/js/drone.js#L387

    Unfortunately Puck.js doesn't do notifications yet, but it doesn't look like you need that for normal control.

  • @Gordon: See the pictures attached.

    The project in a whole is a 12 x 20 LED matrix with 12 rows of 30 LEDs / meter RGB stripes in a 700 x 400 mm box.
    It is currently run by an Arduino pico (sorry for that, already considering to migrate it to Espruino later because C/C++ is a different thing and Arduino has quite limited RAM...) with a HM-10 BLE module (the original one, not the clone).

    The joystick can first navigate through a little menu (currently: Tetris, Fireplace, ...some other demo...). I am about 95% finished with Tetris now.

    This is the puck code: https://gist.github.com/Whizzard/9ca5caeed42c0ce7659cd98231626289

    I have also attached some videos from the menu, the tetris intro page (with highscore) and the fireplace simulation.


    5 Attachments

  • PS: @Adam79 the puck with the joystick is powered for 2-3 weeks now and mainly sleeping because of the setWatch-function in Espruino.
    Still shows 100% battery:

    >NRF.getBattery()
    =2.84150390624
    >Puck.getBatteryPercentage()
    =100
    

    I would not worry right now about battery issues unless you do something battery-draining in your code.

  • @ChristianW good to hear about the battery! And thanks for that post - that's really cool! So at the moment the animations are done on an Arduino?

    Had you tried making your joystick into a BLE hid device, so you could use it with any computer?

    Also, just a quick warning - the pads you've soldered to on the top won't be very strong and could lift if the wires get pulled - it's probably worth trying to stop the wires wobbling around too much by holding them in with hot glue or something?

  • @Gordon: Actually the first thing was a research if a BLE(!) (not the old standard) was readily available - but not much luck here. There are 5$ HID BT devices, but they won't talk to a puck because no LE there...
    Also not sure if a HM-10 will work with a HID device at all. I just tried to keep the protocol simple instead of following a (maybe more complex) standard, but I may try soon.

    Thanks for the warning about the pads. Because I don't like hot glue I may secure it with a zip tie.

  • For HID, I meant this: http://www.espruino.com/Puck.js+Keyboard

    So Puck.js can do BLE HID directly - once it's set up you just pair it with your PC/Phone/etc and it'll act as a keyboard - you could make your joypad do arrow keys, or WSAD.

    Note: right now Windows HID needs the device to be bondable - which Puck.js isn't at the moment - but it should work on most other platforms.

    Hope that helps!

  • Thanks.
    Consudered it at First, but the counterpart is no PC, Phone etc, but a HM 10 with an Arduino attached.
    And I do not know if HM10 copes with HID devices or if it pairs at all...

  • Ahh sorry - thanks - it all makes more sense now!

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

Puck bigger battery

Posted by Avatar for Adam79 @Adam79

Actions