Go Down

Topic: MOSFET ON by default when arduino is off. (Read 6741 times) previous topic - next topic

stuart0

#15
Mar 05, 2017, 04:16 am Last Edit: Mar 05, 2017, 04:22 am by stuart0
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?
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!.


stuart0

#16
Mar 05, 2017, 05:31 am Last Edit: Mar 05, 2017, 05:31 am by stuart0
BTW. If anyone was wondering what I was referring to previously (which I now believe won't work with a low side switch), it was this.

Note how the internal body diode of the mosfet will prevent it from ever stopping the battery charging.

allanhurst

Then put a diode in series with the MOSFET....


Allan

stuart0

Then put a diode in series with the MOSFET....
Allan
And when you want the mosfet to switch on and charge the battery ...?

stuart0

#19
Mar 05, 2017, 08:41 am Last Edit: Mar 05, 2017, 08:43 am by stuart0
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.

juan3211

#20
Mar 05, 2017, 09:49 am Last Edit: Mar 05, 2017, 10:13 am by juan3211
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!.


Thanks again.

I have simulated this (thanks a lot for your PV model, it works !!!)

I have put a NONIDEALBATTERY from MultiSim14 (I don't know how to simulate it correctly).

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 ?
2. I will use SI2301 as P-Mosfet, but what about resistors inyour hand-schema? I have put some values in my simulation, but probably you have a better ones.

I will try now the N-Channel option to see that it doesn't work. Wait a few minutes.





juan3211

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.
@Stuart0, it is very good to read your comments. I almost doesn't understand anything  :o but I will try to read more info about mosfets. Maybe I misunderstand them from the very begining.

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 ?

Regards,

stuart0

#22
Mar 05, 2017, 11:39 am Last Edit: Mar 05, 2017, 12:31 pm by stuart0
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 ?
Yes. In the first circuit it was the battery that was connected to the drain. That means you were disconnecting (low side switching) the battery from gnd (the source of the mosfet was gnd). This mean that the low side of the battery would also be disconnected from the arduino gnd - but you wouldn't want that.

stuart0

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.

juan3211

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 ?

Finally I think you get managed to find the solution, thanks a lot !!!! I hope more people will find this solution good.

Do you think that we can finish then these great post ?

NOTE: in the other hand, do you know any good equivalent circuit for a rechargable battery ? Regards,

stuart0

#25
Mar 05, 2017, 03:23 pm Last Edit: Mar 05, 2017, 03:24 pm by stuart0
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. :)

juan3211

#26
Mar 05, 2017, 06:44 pm Last Edit: Mar 05, 2017, 06:50 pm by juan3211
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 have just put all things together and check them.



Here you will find the whole circuit with (multisim 14):
1. "P key" will simulate night and day, or shadows in solar panel (it is designed as 9 Voc and 200mA Icc), with the rotary encoder you will have different Vmax.
2. "A key" will change your battery voltage to check what happens when it increases or decreases
3. "Space key" will operate the arduino pin. I will program it to cut off solar panel when battery voltage is above 7V and it will connect it again when battery falls to 6.6V
4. The auto low voltage cut off will cut off loads (LDO and arduino) when battery voltage is about 5.4V and reconnect it again about 6.1V (parameters are 47K, 68K, and 300K resistors). I recommend you to install potentiometers in 68K and 300K resistors and check your already soldered circuit. 300K resistor is the control of the hysteresis (difference between 5.4 and 6.1V)

In the simulation, everything work as expected.

Thanks all for your help.

For explanation this circuit is for a little system in my brother in law's garden. It has a 6V seal acid battery and a 9Voc solar panel, but last years two batteries failed.

I think one of them was because high voltage (low current, yes, but at sun light the temperature and the high voltage of the panel could break the battery).

The other one as because of low voltage. It measures the battery voltage, send trough RF24 to a central node, and after with SIM900 to a web page.But my brother in law usually didn't go frequently so finally the battery voltage went down, and down, and down until it failed.

Thanks a lot again, and I hope you will find this "community" schema useful.

NOTE: May be you can find a cheap solar charger controller, but for us it is better to DIY, isn't it ?  ;)

Regards,

juan3211

#27
Apr 02, 2017, 11:54 pm Last Edit: Apr 03, 2017, 12:07 am by juan3211
Hi @stuart0 as I said, I have done the last circuit and it works perfectly !!!! Thanks.

Now, I am going to do the same circuit for a little LiIon 3.7V battery, SIM900 module and a standalone ATMEGA328P IC.

I dont remember exactly when and where, but I read about disconnect a solar panel by short circuiting it. Short circuit a solar panel is normal, for example, when you want to check the maximum current that it sources. It is not bad for it.

So .... what do you think about this circuit ?

It is only a NPN transistor, two resistors and a P channel mosfet. Few components.



NOTES: PV+ and PV- are solar panel's terminals, 1N5819 is a schottky not to short circuit the battery, and control switch is simulation an Arduino PIN output (HIGH or LOW)

tauro0221

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.

juan3211

 
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.
Hi, thanks a lot. This document is great. I helps a lot.

But do you think that my schema is not correct ?? I think that it meets with the document, don't it ?

Regards,

Go Up