[WIP] Simon Merrett's Arduboy Clone


(Scott) #21

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.


(Simon Merrett) #22

This should address both those good points!

Are you missing the “Batt_Level” net or are you suggesting that PA05 isn’t an analog input? I was going from your previous post:

Or have I missed your meaning about not connecting to an ADC? Sorry, but some of this was done late at night!


#23

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


(Scott) #24

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.


(Scott) #25

I don’t see any boost circuit in the schematic. The battery voltage is dropped to 3.0V by the MCP1700T regulator.


#26

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


(Scott) #27

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.


(Scott) #28

@SimonMerrett,
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.


#29

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.


(Simon Merrett) #30

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…?


(Simon Merrett) #31

Now only powers the battery voltage divider when switched on:


(Simon Merrett) #32

Now with a flash chip:


Next task is to start making the footprint for the LCD!


(Simon Merrett) #33

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.