Solar powered ATtiny85 "hanging" during startup

I am trying to power an Attiny85 for a moisture sensor project for my garden. I am using a 12 volt, 7 watt solar cell driving a 7805 voltage reducer circuit to get 5 volts.
It all works well if I wait until there is enough sunlight to provide enough voltage and current. But if I leave the solar panel connected after dark when it does get daylight
and the 7805 circuit gets above 7 volts it starts up the Attiny85, but as soon as it starts to run and selects some of the sensors or led displays it "hangs". I am guessing that
when it first comes on there is enough current for the At85, but not the remaining devices. What would be the best way to delay the Attiny85 from booting up until there is enough current? I checked the circuit while running all devices and it seems to use about 62mA. How can I easily delay startup until there is maybe 100mA? I've searched around looking for some device like a darlington or optocoupler that needs 100mA before it triggers, but I can't seem to find a solution. Any thoughts on best practices to solve this problem. - thank Bruce

The BOD is set to what voltage?

I not sure what BOD is but the solar panel is 12 Volts, 7 watts and it connects to a 7805 circuit that feeds 5 volts to the bus that the ATtiny85, sensors and led displays get their power from. At early morning light thru late afternoon the solar cell runs the ATtiny85 and devices just fine.

Oh, I burned the Attiny85 to 8MHz, so I think it needs about 5 volts to run.

The solar itself is not safe for powering your stuff. Mind the solar panels parameters are mostly valid for full exposition only (a little part of the day).
So the best way for you is to charge a small battery from the solar panel and power the stuff from the battery. If you need 100mA max, then you need ie. 6*1.2V/2400mAh AA cells, or, 7.2V lipo for example, etc. And do use a low-drop voltage regulator (7805 needs 2.5V to be happy, LDO needs ~0.2V instead).
Make a calculation whether the energy budget is positive in a per day average (it means the charging current from solar per day is bigger than current draw from battery per day) for a worst case scenario. All satellites use this setup, nobody is running on solar only.. :wink:

My intentions were to let the Attiny85 stop running at night. That's why I was avoiding using a battery to keep everything running all the time. I thought that the 7805 would limit the voltage from the solar cell (even disconnecting when the solar cell dropped below 7 volts) and just provide me 5 volts to run everything during the day. I would like something between the solar cell and the 7805 that wouldn't connect until I had at least 100mA. I found a low voltage disconnect device from another posting, but $78 isn't what I was looking for.

I not sure what BOD is...

The Brownout Out Detector (BOD) holds the processor in reset when the voltage drops below a certain level.

What is the regulator output voltage when the system "hangs"? What is the input voltage?

This may seem kind of hokey, but since there is no battery involved.... Place a load resistor and transistor so that when the Arduino is off, the transistor is on and loading the 5V supply by 65mA or so. Then when there is enough power to bring the CPU out of brown out reset AND carry the load, the CPU will just disable the load and start enabling devices. When it dies from lack of power, a pullup on the base of the transistor will re-enable the load when the CPU puts the pins in high-z mode right before passing out.

Yes, and it certainly does just that when night falls and the solar cell stops providing enough to run. But I’m dealing with the opposite end when it start to get power in the morning. I want to hold off powering the AT 85 until there is enough voltage and current to boot up and run the rest of the day. About 100mA would be good.

I thought that the 7805 would limit the voltage from the solar cell (even disconnecting when the solar cell dropped below 7 volts) and just provide me 5 volts to run everything during the day.

The 7805 does not disconnect when the input voltage drops below 7.5V - it "follows" the the drop in a "linear" fashion.
Moreover a single bird flying over your solar panel will certainly BOD your cpu in this setup. You may consider a large capacitor instead of the battery..

I haven't determined what the voltage is when the BOD puts the AT85 into reset. It doesn't matter to me when the At85 stops running when it starts to get dark outside. I am just trying to not send anything from the solar cell to the 7805 until there is at least enough voltage (I think the 7805 must have at least 7 volts) and at least 100mA to run everything. I believe the 7805 is already making sure I have enough voltage, ie; at least 7 volts input gives 5 volts output. I would like something to work the same way for current.

I didn't know the 7805 would not disconnect when voltages dropped below 7 volts. But it doesn't really matter as long as it doesn't start passing 5 volts until it gets at least 7. Funny thought about a bird flying over. I tried using my hand to simulate a bird and nothing happens. I think the solar cell is providing almost 500mA at peak so clouds, birds, hand passing overhead, etc. don't lower the output enough for the circuit to stop.

afremont:
This may seem kind of hokey, but since there is no battery involved....

Seems like it would work to me. Add an LED to the mix for nice "standby" indicator.

Brilliant minds think alike. I already have the "power on" led and I blink another led when the '85 is running. I also test the soil moisture once every hour with ten averaged samples and a 7 segment led display shows the "relative" moisture value from zero to 9. I blink the decimal point during the 10 sample test.

brucemac:
I haven't determined what the voltage is when the BOD puts the AT85 into reset.

So you have the BOD enabled? At what voltage?

You are above my pay grade. I have no idea how to enable/disable the BOD. I just write some arduino code and use the IDE and my MEGA 2560 to download a sketch to the ATtiny85. I've done several examples this way and so far they all work fine. I'm fine with the BOD stopping the AT85 from running when the voltage drops. That is going to happen every night until the solar cell finally doesn't send any voltage or current to the AT and it just stops. I don't mind that the AT is not running at night. It's the next day start up that is a problem. Because the solar cell brings up voltage and current slowly as it gets more and more sunlight it eventually sends enough voltage to the 7805 to power the AT85 because my power on led is on, but I always have to disconnect and reconnect power from the solar cell to get the AT85 up and running. Again, I'm pretty sure it's because once the AT85 has enough current to run and it does start, it immediately stops because the AT starts using leds and sensors that cause the current to drop too low.
I was thinking that maybe a TIP120 could be used to insure that there is enough current to run the AT85 AND the leds and sensors before it powers on the AT85? If not a TIP then maybe something else that would work like the 7805 does with voltage, ie; minimum of 7 volts before it starts outputting 5 volts, but with a minimum amount of current at say 100mA.

brucemac:
I didn't know the 7805 would not disconnect when voltages dropped below 7 volts. But it doesn't really matter as long as it doesn't start passing 5 volts until it gets at least 7. Funny thought about a bird flying over. I tried using my hand to simulate a bird and nothing happens. I think the solar cell is providing almost 500mA at peak so clouds, birds, hand passing overhead, etc. don't lower the output enough for the circuit to stop.

There are few ways allow you to do it. I list 2.

  1. LTC4365 - Linear Technology
    UV, OV and Reverse $3.69
    Supply Protection Controller IC (turn off power)

  2. ON Semiconductor
    MC34064 $0.33
    Undervoltage Sensing Circuit (reset Arduino)

I list them here as bandages not solutions, but if I were you, I will go pito -Reply #4 direction.

brucemac:
I have no idea how to enable/disable the BOD.

No problem. Which core are you using?

You will be far better off using a small battery.
The battery is not for running the Micro over the night, but is there to ensure that in low light in the morning when the Solar Panels voltage rises
sufficiently high to start the ATtiny, there is enough current available to run it.
Solar cells dont have a linear voltage / current relationship.
The voltage with no load rises at a logarithmic rate whilst the current capacity rises at a linear rate for a given illumination.
What happens with no battery, is that the solar voltage will rise quickly to above 5 V , which will cause the 7805 to start operating, but the solar cell has no capacity to deliver any current , so the voltage immediately collapses, and the Micro stops.