Arduinoboy help (almost there)

A couple of minor / trivial comments:

On the schematic, I do my crystals like this…
image
… it’s 100% personal preference, and a lot of the way you draw it is about making it easy to understand for others (and you too!!!) to quickly understand it in the future.

As for those six resistors at the top, personally I’d rotate them, have all six next to each other, makes the tracks so much simpler!. This is what I have on one of my PCBs:
image
(4 resistors, with 4 LEDs, staggered, above them)

[Hmm, I just realised that THOSE resistors of mine should be 2k2!!! That’s what you get when you just cut/paste!!!]

Even though I hand make my PCBs in small quantities, over the iterations I’ve learnt that things like having a line of resistors like that makes it so much easier to fit, hold in place, cut and solder them. (I fit the components to the PCB, bend the wires, cut the excess, then solder them. (Yes, if I had a fancy PCB holder with a layer of foam at the back, I wouldn’t need to do that!)

(I’m very lucky, back-in-the-day I was able to watch a guy laying out PCBs manually, using tapes etc, usually at 2:1 or 4:1, so picked up some helpful tips on PCB layout. CAD makes it 100 times simpler, but many of the same concepts still apply)

Thanks! I think I’m just about finished but I’ll keep those suggestions in mind for next time- makes a lot of sense!

I’ve made some revisions and additions. For switching between battery and usb, I’ve put a power MUX in the circuit, but realized I think that requires another micro-controller, so I want to change it to a manual switch or something mechanical - is there anything that’s recommended for this? I won’t be switching while in operation. My main concern is making sure usb power doesn’t backfeed to the batteries or anything like that.

edit: Just realized a switching barrel jack might be the best way… thoughts on this?

haven’t redrawn ground plane yet - please ignore those stray lines :slight_smile:

Plane redraw is “b”. Takes < 1s.
Battery/USB power: Connect via two schottky diodes. You lose 0.2 V, but should still work. Best post the schematic as well when asking questions about it. I wouldn’t really trust a barrel connector switch to work 100% reliably. Alternatively use jumpers (solder jumper or 3 position 2.54 mm header with jumper).

1 Like

I’m a little worried about the diode method (as I was also about the MUX) bc the voltages are so similar: USB 5v, Battery 4.8v. I’ve read USB 5v supplies can fluctuate from 4.75 to 5.25, so it would constantly be switching, or is this thought process incorrect?

Is there any reason not to just use a spdt switch?

Well, that’s more a design than a KiCad question (Beginners - Page 1 would be a good place to ask). You did not provide enough information to answer your question. What battery, when should switching happen… I would know of no battery delivering 4.8 V - all batteries have some range from full to empty.
You need to explain more what you intend to achieve, however this forum is not the optimal place for electronic design questions.

2 Likes

You’re right I wasn’t clear. The intention is that USB should be given priority and switch to battery only when USB is disconnected. 4.8v battery power comes from 4 eneloop AA batteries (each 1.2v).

Also you’re right these aren’t really Kicad questions - I got off topic I guess. I’ll work this out and circle back when I (inevitably) have more Kicad related questions :slight_smile:

1 Like

The simplest approach to what you want I believe is this


What you have here is a state where all the time the USB is plugged in VCC is derived from the USB but when removed the MOSFET opens up and it runs from battery. You will need to do a bit of research to insure you fully understand (thats a disclaimer :rofl:) whats going on.
Hope this is of some use :nerd_face:
:mouse:

2 Likes

Thanks for this. Interesting reading about the mosfet options. Am I correct that the VGS(on) needs to be 4.5v in a logic level mosfet?

Some of the reading I’m doing has me concerned about what could happen if the voltage from the battery drops below the VGS(on), but I believe it’s supposed to be “ok” as long as it stays above 4V.

This seems promising, and I’m assuming you’re suggesting it over the switching barrel jack with diodes just from a reliability standpoint?

Do I not need any extra diodes (besides the one in the mosfet body) in this case?

edit: A lot of my research seems to imply that a mosfet solution like this will still use the higher of the two voltage sources. Given the variability of USB power (4.75-5.25), with 4.8v from battery, this seems problematic. But please correct me if I’m wrong or misunderstood your suggestion.

VGS (on) or the threshold voltage will be on the datasheet marked VGS(th) and can be as low as 2.5V.
If the battery voltage drops or fails then problem will be how the device your powering behaves, the battery is in use with the USB unplugged so the gate is ‘low’ and the MOSFET is conducting and the point when your lithium cell (or battery) is switched off will depend will depend on you Battery Management system (BMS) and probably around 3v for a single cell.
This system is a far better choice than a Barrel Jack switch and considerably more reliable.
Now the extra diodes are optional but I would fit them that is if your ok with the voltage drop you will see, either around 650mV for a silicon one or 200mV for the Schottky. They would be placed just after V_BATT and the second just after Power from USB and will provide an extra layer of protection from any back feed issues.
The MOSFET solution has only 2 states, the MOSFET is not driven and the power is conducted through it from the lithium cell until that cell is used (BMS kicks in ) this is state 1
State 2 is when power is supplied from plugging in the USB cable this will pull the gate ‘High’ and the MOSFET will stop conducting and the USB will power the device until the cable is removed or the USB supply fails. :crazy_face: Hope this made sense and was useful in some way :slightly_smiling_face:
:mouse:

1 Like

Oh come on mods this is getting rediculous!

We all might, out of convenience, need a quick question answered as we’re here but this is continuing to be an ongoing electronic design tutorial and needs to be stopped.

OP, please post unresolved KiCad related queries in individual threads.