reversebias / mitosis-hardware

Mechanical design files for the Mitosis keyboard
GNU General Public License v3.0
322 stars 54 forks source link

LiPo for keyboard? #12

Open xkortex opened 5 years ago

xkortex commented 5 years ago

Very happy with my Mitosis so far with one small exception: I left it on my shelf for ~2 months and the battery was dead. I thought it should get more like 6 in standby. The variant I got from Flashquark has a housing which needs to be removed to get at the battery; this is a tad inconvenient.

I'm looking at putting in a lipo so I can at least change it without taking the housing apart. Is 3.7V something the board can handle natively, or would I need to put in a 3 or 3.3v regulator as well? The nRF nRF51822 specifies Supply voltage range 1.8 V to 3.6 V which feels like pushing my luck.

EDIT: I'm a goof, I forgot 3.7 was the uncharged voltage, and at full charge it's more like 4.2. Most likely that's too saucy for the nRF. Leaving issue just to point out the battery consumption and see if anyone else has encountered this.

datagrok commented 5 years ago

@xkortex I have the same kit, and I have done exactly that. I don't know if I'm stressing any limits of the ICs or something but I've been using 3.7v LiPos plugged into the +3.3v and Ground programming header pins, with no additional regulator circuitry, and it seems to work great!

xkortex commented 5 years ago

Oh hey, @datagrok I'm using your keyboard as a basis! Did you ever get that I2C hack splice working?

datagrok commented 5 years ago

@xkortex I did! But I only got as far as proof-of-concept before life happened and I had to set the whole thing aside for... months? (I actually had to go read up in my repo to remember what you were even talking about!) :sweat_smile:

Anyway here's a little video of my Mitosis receiver with a $0.50 speaker and $2.50 I2C OLED display attached, running some demo code. It's hard to see but there's a wire in there routing the green LED previously on pin 3 to the Pro Micro pin 4, so I get to use I2C and all the LEDs still work.

9effea77daaa4375

Hopefully I'll get a chance to tidy it up, test, and submit a new PR upstream in the next several weeks.

xkortex commented 5 years ago

Very cool stuff :) :+1:

xkortex commented 5 years ago

@datagrok Have you ever had issues with the blue and red LED channels not working simultaneously? For reference, I'm using the Flashquark version. On your layout, I can get the led to light up red or blue, but when I press both, it just goes red. Smells like undervoltage to me, but my header pins are all clipped short so I can't easily go snooping (and don't have the time to be messing much with hardware until summer). Also I cannot get green to show, with or without MITOSIS_DATAGROK_I2CHACK

Edit: yeah something is really goofy with the LED layout, so I would appreciate it if you know of any quirks.

I'm considering just rebuilding the receiver module and using transistors to supply the RGB or using an I2C slave board to run LED.

Also I found out the hard way that the space between the bottom and the acrylic is juuust to thin for Adafruit's thinnest LiPo to squeeze in without scraping a sharp through-hole wire....and sparking...and leaking electrolyte. Oops :P

datagrok commented 5 years ago

@xkortex sorry it took me a couple days to notice your question. I got my kit from a FlashQuark group buy too, with the acrylic case (which I have since decided i dislike, and removed.)

I haven't had issues like you describe; each component of my RGB LED works fine regardless of which other components are on or off. I think undervoltage is unlikely since the receiver is USB powered. I've plugged a whole bunch of LEDs into the unused pins and had them all lit at once without issues. Not to mention the I2C OLED display.

I suspect that you're somehow ending up using code intended for my modified hardware where I have rerouted the green LED pin. Maybe the MITOSIS_DATAGROK_I2CHACK toggle mechanism isn't working properly for stock pin assignment or something. I haven't looked at this in a while; let me study it a bit and reply again later.

I found out the hard way that the space between the bottom and the acrylic is juuust to thin for Adafruit's thinnest LiPo to squeeze in without scraping a sharp through-hole wire....and sparking...and leaking electrolyte. Oops :P

image

joric commented 5 years ago

Check this out https://github.com/joric/jorian I also wrote i2c display support but for the keyboard side (there's no difference really).

datagrok commented 5 years ago

@xkortex I finally got a chance to sit and think about this a bit more.

I checked that my code wasn't the culprit, then I re-read your description:

  • Green is totally MIA.
  • Red/blue can't light at the same time
  • Red/blue should be totally unaffected by portD, BUT if the bit 0b10 (annotated SDA) is set low ( i.e. setbits(PORTD, ~(0b00000010), 0b00100010); ) it'll nerf the RGB LED.

I think you're on the right track to suspect undervoltage. Your last bullet point makes me think there is a short to VCC from PD1/SDA (pro micro pin 2). So when you set that pin low, which would normally light the green LED, current takes the less-resistance path from VCC instead so neither the green nor any other LEDs light. (Referring to the schematic should help here)

But since you're not getting a total brownout, which i think would reset the chip, I suspect that the current is still flowing through the resistors on that line. I'd suspect a bad solder join under the RGB LED. I remember it being pretty hard to solder without getting a solder blob trapped underneath it and bridging some pins.

If that's not it, find a magnifying glass and check the joins on those tiny resistors. Or use a multimeter to verify the amount of resistance through each line is correct, and that there's no continuity between lines.

Anyway, I can confirm my LEDs are working and exhibiting no problems when lit simultaneously. So it's probably a solder issue, not a problem with the circuit design. Best of luck troubleshooting from here!

datagrok commented 5 years ago

@joric thanks for the note! I've been watching your bluetosis firmware project with interest, and I love that you were able to Mitosis-ify the Jian design to take advantage of the 100mm x 100mm pcb prototype discounts and the pcb-plate cutouts trick. Fantastic!