Hi,
I was finally able to achieve some sort of results. I wrote a simple program of setting a digital bit high for 10 seconds and then setting it low for ten seconds. Then I supplied the 5V from the Arduino to the source of the Mosftet and put the digital pin on the gate. I got the desired 5V on the drain when the bit was low and O when the bit was high.
However, when I tried to use the same logic in my main code it did not work. In my main program, I make the controller sleep and in this scenario the bit is set. However, when the arduino wakes up again, with the bit set to low to provide the voltage at the drain, the voltage at the drain is around 3.24 volts instead of 5 volts and therefore I am unable to on my device.
Is this has to do with the power down sleep mode I am using. Do I need to do something more after the processor comes back from sleep. Is there any way of flushing out any voltage remains on the digital pin and make it absolutely zero to provide exact 5 Volts on drain ?
I hope I am not sounding confusing ?
BR,
Vik