Go Down

Topic: Redundant solar/charging/battery/supply (Read 1 time) previous topic - next topic


Dec 12, 2017, 04:56 am Last Edit: Dec 12, 2017, 05:08 am by MorganS
but why not use an N-channel?
Good question. It took me 3 attempts to come up with this answer and I'm not sure it's the complete answer...

The N MOSFET is switched on by a positive VGS. That's the voltage between the gate and the source. The voltage on the drain is not important unless it gets high enough to destroy the device (the damaging voltage may be as low as 20V.)

If used as a high-side switch, the N MOSFET will have its source connected to the load. (The names are somewhat backwards because the source sources negatively-charged electrons.) If you've got a fully-charged 3.7V battery, the source will also be about 3.7V. With a 5V control voltage on the gate, VGS is only 1.3V. That's not enough to properly turn it on, even with a logic MOSFET.

I have seen many datasheets for things that use an N MOSFET as a high-side switch. Those devices usually have a voltage-booster circuit that gives about 10V above the supply voltage, which is enough to fully turn on a regular MOSFET.
"The problem is in the code you didn't post."


Dec 12, 2017, 02:44 pm Last Edit: Dec 12, 2017, 03:05 pm by cgorton
jremington: I am showing an N-MOSFET in my schematic. I think I have it hooked up correctly. My symbol looks different than yours, but my understanding is that battery is hooked to the source, the drain is hooked to the booster. That was my intent. And this booster has two grounds, but they are connected on the board (I checked with my multi-meter) so I just show one grounded.
10K between gate and source, got it!

morganS: that makes sense. I'll have to re-think using the N MOSFET.

I'll re-work this. Thanks again for the input.

Oh- jremington, the stall current is 1.7A. I'll need to look at that again.


Dec 12, 2017, 04:41 pm Last Edit: Dec 12, 2017, 04:44 pm by jremington
An N-MOSFET won't work as a high side switch, for the reasons that MorganS gave.

The voltage difference between gate and source controls the current flow.


Dec 13, 2017, 04:06 am Last Edit: Dec 13, 2017, 02:40 pm by cgorton
Having watched this, I think I get it:

The resistor between the gate and source (battery V+) keeps the gate at the same voltage as the source, and therefore keeps the switch off. When I pull the gate to 0V with the Arduino pin, it switches on the power to the booster and driver.

And I see I need the P-channel because with an N-channel I would not have enough Vgs.

I'll re-draw one more time tonight. :)


I'm still having some problems with my circuit. Schematic attached.

I have 3.8V at batt1 and 3.6V at batt2. I would expect that the 5VDC step up booster will only use the 3.8V source because diode D1 should "win". But, both batteries are discharging.

I've disconnected the Arduino to see if the right side of the circuit works on its own, just powering a dummy load. It looks like it might be working okay (I need to wait a bit longer to declare victory).

But with the Arduino hooked up, batt2 is definitely discharging. I'm not using the motor driver either. Pins 29, 39 and 46 are in output mode. And the motor driver draws negligible current when not in use.

Does anyone see something wrong with the design? The diodes are Schottky with Vf of 0.16, measured.



Jun 13, 2018, 03:31 am Last Edit: Jun 13, 2018, 04:55 am by jremington
The circuit diagram can't be correct. I didn't go through all of it, but what is C4 doing? Where is the motor boost module getting its power?

What exactly are S1-S4 on the batteries and solar panels and why are they needed? For the panels, most people just use a diode to block reverse current flow. But even that may not be necessary for the charger module, so check its specs carefully. For example, the Adafruit solar LiPo charger has a built in diode, and also implements a crude sort of maximum power point tracking.

I forgot to mention that Pololu has a great collection of high side switch modules, controllable either with a real switch, or by microprocessor input.


Thanks. Yes, I am missing a line from the Vout of the solar charger 2 to the green step up booster. C4 is recommended by Pololu (the green step up is a Pololu #2564).

Having run this for a few more hours without the Arduino attached, I am seeing batt2 stable and batt1 discharge as expected. So it might be something to do with the connections between the Arduino and the power circuitry.

The switches are just so I can easily turn thins on and off. They will normally be closed. I used DIP switches, they're helpful for testing.

A0 and A1 are monitoring the voltages and I think 10k resistors are appropriate. Could something "leak" into those inputs? Should I set pins to output when not using them in input mode?

I'll do some more testing tomorrow. Thanks for the help. This is for Gortobot attempt #3, later this summer.


A0 and A1 are monitoring the voltages and I think 10k resistors are appropriate. Could something "leak" into those inputs?
Yes, if the voltage is > Vcc+0.5V (to account for the input protection diode), but the current should be low enough that no damage would be done.

Go Gortobot!

Go Up