SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By esklar81
#117043
SXRguyinMA,

Two questions, one tactical and one strategic:

Tactical: Have you watched the voltage on the Arduino's RESET pin (pin 1) during startup. That pin is pulled up through a 10K resistor and it may be that it's pulling up very slowly when the capacitors are drawing a large charging current. (If the pull up is slow, I'd try changing the pullup resistor to 1 K. One thing you might do to see if it's the Arduino or the servo that won't respond until you're at about half charge is to put a "heartbeat" LED on a spare DO of the Arduino and have your code flash it ~5-10 Hz. That way, it would be easy to see if the Arduino is alive during the first couple of minutes.

Strategic: Why use a 12 V line from the PC's power supply for your power, but a 5 V line to determine when to have the circuit operate? Put another way, under what circumstances is the 12 V live, but the 5 V not, and in which you do not want the louvers to operate? Alternatively, why not just run the whole louver subsystem on the 5 V power from the power supply?

Eric

PS: I've been trying for several hours to send this, but have been having web problems.
By SXRguyinMA
#117049
I have not checked the voltage at the reset pin on startup, but I will check it. The only reason for the 10k was when I originally learned how to integrate the ATMega into a final project, that's what was showed to me. That, the crystal and the 2 22uF caps. And of course the power LED just to be sure it's getting power.

The reason for needing the 5v and 12v is that the 5v goes to the sense pin only, to tell the arduino when the computer is on or off. The 12v line is used to charge that caps and power the system. When I had it powered with the 5v line, it would backfeed from that caps through the 5v and into the input of the Arduino and it wouldn't close the louvers. So the only way to keep it set up properly was to have the 5v line dedicated to the sense pin. If I were to use the 12v line instead (with voltage dividers) it would backfeed through the ground and do the same thing. The 12v is off when the 5v is (as always with a standard computer power supply) and this is the reason for needing the caps. The caps allow sufficient power for the Arduino to move the servo to close the vents, otherwise when you shut the computer off they wouldn't close.

Thanks a ton for your help so far, I really appreciate it. :D
By SXRguyinMA
#117051
do you think maybe the 15Ohm is too low? Maybe it's drawing too much current away from the IC? Maybe if I put in a ~150 or something instead?
By esklar81
#117083
So, which type(s) of regulator are you using on the breadboard and on the PCB?

Increasing the resistance through which you charge the capacitors would lower the charging current, but at the cost of extending the charging time. As a rule of thumb, a capacitor is "pretty much fully charged" after three times the circuit's time constant: τ = R * C
For 15 Ω, 5 F: τ = R * C = 15 Ω * 5 F = 75 seconds
For 150 Ω, 5 F: τ = R * C = 150 Ω * 5 F = 750 seconds = 12.5 minutes
So, you'd be looking at most of an hour of running before being able to have the louvers shut at power down.

Reducing the capacitance would also reduce the charging time, but until you get this working, it will be hard to determine just how much capacitance you really need.

The increase in startup time is why I'd try reducing the resistance of the pull-up resistor on the RESET pin first. The considerations for choosing the pull-up resistor include protecting the microcontroller pin from current spikes and limiting the current through the reset switch.
For 10 KΩ, I = V / R = 5 V / 10 000 Ω = 0.0005 A = 0.5 mA
For 1 KΩ, I = V / R = 5 V / 1000 Ω = 0.005 A = 5 mA
For 100 Ω, I = V / R = 5 V / 100 Ω = 0.05 A = 50 mA (a bit higher than the pin's spec, but I doubt if it would be a problem)

It's probably worth a try on the breadboard, particularly if the reset pin is being pulled up slowly.

Another consideration is that, IIRC, the threshold for the RESET pin is very loosely specified (20-90% of Vcc). You may just have a chip at the high end of this range on your board.

Happy Hunting,
Eric
By esklar81
#117117
Will,

As I have doubts that changing the pull-up resistor on RESET will suffice, I gave the problem a bit more thought. How about paralleling the supply of that resistor (or the pin itself) from the regulator output with a supply from the incoming 12 V (using a suitable voltage divider) from the PC's power supply?

If you put an appropriate diode between the voltage divider and the RESET pin, that should preclude backfeeding from the capacitors to the PC's supply. Putting a diode in the connection between the capacitors and the RESET pin will keep the 12 V power line from trying to charge the capacitors through the voltage divider. To ensure you're getting 5 V to the pin, I suggest you select the resistors for the divider so that the voltage after the diode's forward drop is 5 V. (If you'd like to take advantage of a "freebie", you can use an LED to prevent backfeeding while providing indication that the PC power supply is on. To do that, though, you'll need to put the LED between incoming power and the voltage divider, so that there's a path to ground.)

Eric