I know that is a poor simulation, but in this circuit and get negative voltages in base of the NPN. Will It hurt my arduino pin?
Then put a diode in series with the MOSFET....Allan
That is because you still haven't got the overall circuit topology right. To be clear, you need to disconnect the solar cell from the rest of the circuit, not just disconnect the battery as in your original plan.Initially I thought that you could still achieve this using the low side switch as per your original plan, but switching the low side of the solar panel instead of the battery (while keeping a common ground for BJT emitter, and MOSFET source, and Arduino gnd, and battery negative).After some thought however I now don't think that this simple solution can work, because the mosfet body diode will allow the battery to keep charging even after you attempt to switch out the solar panel (a low side switch on the panel would need to be reverse blocking).So I suggest changing to a high side switch (p-channel) so that you can keep a common ground for everything. It complicates the circuit a little, but I now believe you need something like the following.BTW. This is a crude freehand diagram to show basic interconnection only. It's not a complete circuit diagram!.
Allan, the problem is that the mosfet needs to conduct current in the wrong direction. In other words, when it's "on" it need to conduct current backwards, when it's "off" it need to block current backwards.I think that this should look pretty obvious now that I've re-drawn the circuit. I have to admit that the slightly goofy way the circuit was originally drawn threw me a bit. I could see that the wrong thing was being switched out (battery instead of solar cell), but I didn't see that the low side switch cannot work until I re-drew it.
Why are you saying that I tried to disconnect the battery and not the solar panel? Because of the battery was in the first circuit in the DRAIN pin of the mosfet, wasn't it ?
This circuit works but I have two questions:1. I have never tought how complicated it is. There is no option to simplify it, isn't it ?
Not that I could immediately see. That was the most simple high side switch (that was on by default) that I could come up with. Someone else might see a simplification.BTW. If you're still concerned about power consumption, it should work ok with all the resistors at 100k.
Thanks a lot. These kind of circuits are better to do with mosfet than with transistors, aren't they ?
The main high side switch is usually best to be a mosfet (as it is in this case), however BJTs are just fine for the other two transistors. Small BJT's, like the BC327/BC337 (pnp/npn) for example, are very readily available and cost a few cents each. And they'll do a job like that perfectly well.
Hi,I found this article that I used when running in to trouble when working with mosfet. Maybe it will help you understand how to use mosfet transistors.attached it is the article.