The above link describes the efforts made to find a solution to my problem using programing and common sense approaches. Note that my sketch is not the issue here. It works perfectly. No solution was found. The problem seems to be as follows:
When the solar controller (see link) shuts off the battery (around 2.6V) to prevent over discharge, the Arduino shuts down and the sketch obviously stops functioning.
As the battery slowly recharges, the voltage appearing at the Arduino 5V pin (I'm powering directly to the 5V pin as the solar controller has an onboard 5V regulated output) rises slowly and fluctuates according to the solar panel output.
This appears to mess up the built in reset mechanism on the Arduino, so that when the solar controller eventually decides that the battery is sufficiently charged and switches on the 5V output, the Arduino sketch does NOT restart
A short MANUAL disconnection/reconnection of the 5V feed to the Arduino will reset it and restart the sketch.
Therefore:
What I need is an electonic circuit that will automate this manual process by holding the power feed to the Arduino disconnected until the 5V supply switches on.
Any ideas would be greatly appreciated!
Thanks. This looks very promising. I looked at a few youtube videos, but I still had a few questions. Obviously in my case, shutting down is not an issue as the solar controller isolates the battery at around 2.6V to prevent over discharge. I guess I can use the EN pin on the blue header of the solar controller to switch the 5V output to the Arduino on and off. The EN pin is pulled low for off and high for on. So, I assume that I could use the voltage supervisor to monitor the battery voltage as it charges and switch on the 5V when it reaches 4.6V. Would that work? If so how would I wire it up? Thanks again for your help!
That is one approach, except you would switch the battery on when it is fully charged at 4.2V. The other is to hold the reset on the Arduino low until the power is good.
Unfortunately, I can't make any sense of the "enable pin" part of the schematic for the linked DFRobot solar power manager. If it is actually wired according to the schematic, the EN pin does nothing. Take a look at the lower right corner. This major error does not inspire confidence in the overall design.
EDIT: I'm now guessing that "GND_VOUT" is actually a low side switch INPUT, which would work, but is poor notation and hardly an optimal design. The EN input does not control the USB 5V output, and should be connected to the MT3608 EN pin.
I do not recommend this board, and recommend instead this Adafruit solar charger. It are designed sensibly, and supported by Adafruit.
I use a part called MC34064, it connects to the 5V, Ground, and Reset pin. My reset pins have a pull up resistor. Here is a link that will explain how it works and how to use it. https://www.nxp.com/docs/en/engineering-bulletin/EB413.pdf
Thanks for the quick response. What did you mean by "hold the reset on the Arduino low". I presume you mean use the voltage supervisor to directly swich on and off the 5V supply to the Arduino? If I do that, can it handle the current drawn by the Arduino when running my sketch (up to 150mA).
I will look at the Adafruit controller, because you are correct regarding the poor notation and information on the DFR0559. I was surprised that the solar controller didn't already do what I'm trying to achieve, i.e. when the battery is isolated, why is voltage from the solar panel appearing at the output?
I mean exactly that. All MCUs have some sort of reset pin. Ideally, the MCU draws very little current in the reset mode, and reboots when the reset pin is set HIGH.
I do not know of any microprocessor that does not have a reset pin. That is used to put the processor's internal hardware in a known state before starting. Without that capability it could start anywhere. There are some that it is not pined out but rest assured it has one. Look between the 3.3V and 5V on this picture just below the silver caps. Since you did not post a link to the part you have I chose one I have.
The part I recommended will hold that pin low until the 5V reaches something in the range of 4.6 volts and assert itself when the voltage drops. Check the data sheet for exact details.
Thanks. I knew that all controllers had a reset pin on the chip, but I didn't think the Arduino WiFi R2 had a pin that I could actually connect to. From what you say there actually is. I'm away from home right now so can't check out my stuff, but this looks perfect. so, if I read this right, the device you recommend will hold the reset pin low until the voltage passes 4.6V and therefore the Arduino off until the solar controller switches the 5V supply back on.
Brown out detection. - it resets the processor when the voltage dips . But haven’t thought it through, but it might offer a path , dunno .
If you have minicore in your boards manager , it gives options to set this .
I have been trying this out, but have had some problems. I have wired the MC34064 as you indicated: pin 1 - input voltage (from the solar controller 5V output), pin 2 - to the RST pin on the arduino, pin 3 (TO92) to ground. I have a low voltage power supply connected to the solar controller battery input to simulate the battery. No solar panel connected. With the pwr supply set to 3.4V, the solar panel provides the expected 5V output to the arduino and the MC34064. However, the Arduino sketch does not run. The arduino green ON LED is lit. If a reduce the voltage is reduced below 2.6V, the solar controller shuts down the 5V output and the Arduino shuts down (green LED off). If I now gradually increase the pwr supply voltage, the solar controller restarts the 5V output once the voltage passes about 3V. The Arduino starts (green LED on), but the sketch does not run. If I disconnect the connection between the MC34064 and the RST pin, the sketch runs OK. Reconnecting to the RST pin stops the sketch. This can be repeated ad infinitum with the same result. It seems like the MC34064 is holding the arduino off despite having 5V on pin 1. Any thoughts on what I'm doing wrong? Many thanks for your help.
It sounds like the 5V is coming up short. Post an annotated schematic, I am having a hard time following what you are saying. It should be connected to the 5V and Ground of the processor and the output connected to reset.
Can we check signals on this? Are you using the TO-92 package version of the MC34064? If so, the datasheet shows pin 1 = reset, pin 2 = input, pin 3 = ground.
When you're in the situation where if you disconnect the reset line the Arduino will start up, what are the voltages on the reset pin and the Arduino 5V pin before you disconnect that line?
Have you tried a plain old Uno or Nano running Blink in place of the Uno Wifi? Does it have the same problem?
And you're sure you have all the grounds connected together?