The battery monitor divider is going to VCC. That’s not going to work. it should go to the battery output voltage. Also, you haven’t connected the divider output to an ADC input.
The battery is constantly powering the voltage regulator. Although this chip probably draws very little quiescent power, it will still slowly drain the battery. You should try to switch the battery completely out of everything (except maybe the charge circuit) when not in use.
An easy way to measure battery life if your analog reference is on a regulated voltage rail (assuming there is a boost converter to say generate 5V from a lipo whose voltage will always be less) is to tie the adc pin directly to the battery terminal. This way there is no drain from a resistive divider and your calculation is very simple. Alternatively I’ve also used the fixed trimmed internal reference in PICs with the battery voltage as the analog reference and then back calculated the battery voltage from the inversely varying measured value. And if you are set on using a resistive divider an easy trick is to tie the supply rail side of the divider to an output pin and set it high during reads and low or as an input so that there is no drain when not reading battery life (of course for accuracy you’d need to compensate for the tiny output drop caused by the nonzero impedance of the pin’s high side totem switch).
It looks good now. Before, the centre of the divider didn’t go anywhere and wasn’t labelled. However, the way you have it now the battery will always be connected to the divider and draw power even when the switch is off. I’d connect the top of the divider to pin 2 of the switch.
I was speak generally for different setups, but yes it looks like Simon is using an LDO so he would be limited to using a divider (but like I mentioned driving the high side by an output will solve the problem of current drain).
How is that going to work? An output, when set high, will always be (very close to) 3V since the processor is powered by the output of the 3V regulator. The top (and thus centre) of the divider won’t vary with battery voltage, which is what you want.
Unless you plan to use a battery with built in overcharge, overdischarge and overcurrent protection, I suggest you add a protection circuit to your design, such as one based on a DW01 or similar IC.
Whoops, you are right, this is why I shouldnt post when I’m tired lol. You’d still need to use a pnp transistor to power the divider (or set the resistances high and suffer the noise).
For most hobby stuff I do battery powered that isnt voltage critical and has a wide operating range I’ll just have no regulator and do the internal ref polling method. No extra parts, soft power control and low self discharge in the off state. Of course though having no regulator means it can be unstable near the bottom of the operating range but you can cutoff in software/use brownout protection if available/rely on the lipo low voltage cutoff before that point.
Yep, the next revision will have that so that an unprotected battery can be used. For this version we’ll need to use protected batteries. The reason I’m waiting until the next version to include and onboard protection circuit is because I want to investigate the DW07 which is like the DW01 but has the MOSFETs built in to the IC, thereby reducing part count and board complexity. The DW07s are on order but will take a little while and some datasheet translation to be confident that I have incorporated them correctly in the schematic. If people want to wait for that revision, that’s fine by me but I want to make something available sooner if people who are prepared to use protected batteries want to get on. I’m also wondering whether USB C connector is too fine-pitch a part for people to solder themselves - perhaps a micro-B would be better…?
Just a quick update. Schematic has changed slightly to include pads for 4 way surface mount joystick, should you want to use one instead of buttons. Also added schematic for a USB micro connector as I doubt I’ll get a USB C connector soldered myself on the first batch (the TQFP SAMD will be hard enough!). Have also tidied up the LCD schematic to include the backlights on the main connector pins.
The only footprint I need to finalise before being able to start laying out the PCB is for the micro USB, so hopefully won’t be long before I can post some progress there. Although I have littered the place with test points now, and they show up as components, the BOM is at 100 parts! I very much doubt that all will be populated in the early versions but it’s nice to have the options there, IMHO.
Another quick update. I have got footprints for all the components (but not 3D models so several parts look unpopulated on the 3D renders from kicad). Board dimensions are 125x70mm.
Features footprints for:
IR Tx & IR Rx (with both common pin configurations for the Rx)
Micro USB connector
Hardware power switch
4 way joystick (footprint is top left of D pad) and/or 4 tactile switch direction buttons (plus A, B and Reset)
Volume and backlight control wheels
Headphone jack and terminals for a speaker (but no amp)
Lithium battery connector and charging circuit
Loads of test points
Built-in USB PCB corner connector
SWD, I2C, LCD SPI & SD SPI pin headers
Haven’t started routing traces yet but feel like this is the right component laydown and board shape for now. Feel free to comment - especially if you can offer a constructive thought. I will be pleased if I can even get the Arduino bootloader on this thing!
1.) Thickness of the PCB substrate needs to be thick enough to ensure a good connection (around 2mm/0.07 inches I think you would have to read the specification) If your board is thinner than this you wont get a decent connection. I have seen someone make a business card with USB connector like yours where they have a second part of the pcb that they snap off and glue onto the USB connector before handing them out.
2.) Weight/fragility of that USB Connector, It is very cool but I would be worried about the weight of all the components putting stress onto the PCB itself, even if the board doesnt snap you may get small cracks in traces.
Thanks, I’ll get the 1.6mm for the first run of boards and people (as in the very few who I send a minimally populated board to, to help get the screen, flash and SAMD21 running) can add tape or a shim if they can’t get a connection. That connector is really there to save soldering the USB micro connector (next to the LED along the bottom of the board) for early stage dev work - I’d definitely review it if other people want one as I agree with you about the weight. May add some vias to the ends of the strip contacts to help anchor the traces in the meantime.
How close to the lines does the screen come?
I have fairly small hands and if I fill my phone screen so the usb is around the correct size my thumbs cover a portion of screen area when pushing Right and A.
The lines are about in line with the edge of the screen but there’s a 3mm gap before you start covering the pixels. I’m trying to balance making it compact with sufficient space for the HMI. Do you think the board needs to be bigger or should the direction buttons just move left?
Unless your restricted to a specific size like the Arduboy was I would try spacing the buttons away to avoid accidentally putting pressure of the screen edges and extend the pcb if necessary. You may find playing some pretend games on cardboard cutouts will help.