I have circuit where I am using transisitor 2N3904 and Mosfet IRF9540. Following is the schematic:
In the above circuit, chargePin
is the digital pin of Atmega328p(arduino uno). Solar+
is the pin where solar voltage is coming. Battery+
is the battery voltage pin. So depending upon the few conditions, MCU will enable the chargePin
which will enable the transistor and then Mosfet will connect the solar voltage to battery voltage to start charging. But what's happening is, chargePin is disabled but still the solar+ is connected to battery+.
Is there any error in the above circuit.