I want to generate a 0.01Hz square wave in Arduino. With that signal I want to power a RC series circuit to charge and discharge the capacitor. I want to measure the current and the voltage and export that through PLX-DAQ to an Excel spreadsheet and graph the current and the voltage depending on time to see the evolution of the two.
I have a 2200uF capacitor and a 1kohm resistor. The time constant is 5RC = 11 seconds. That's why I need such a low frequency signal.
How do I do that? Attach me the code and the PLX-DAQ output please.
0.01Hz is 100 seconds, 50 HIGH, 50 LOW. I believe you want 0.05Hz, 10 seconds HIGH, 10 LOW. This simple sketch generates a 0.05Hz square wave on "outputPin" with Arduino Nano.
Or maybe something in between. After 5 time constants (=11s) the voltage has risen/fallen to 99.3% of its final value. After 20s it will be fully charged according to an analogRead().
Driving this with an Arduino output? So 100 ohms into essentially a short circuit? Sounds like 50 mA, quickly decaying. Exceeding pin max specs, I'd say.
The power calculation was "just in case" for the education of the poster. 5V @50 mA is a quarter watt instantaneous, so although decaying away, the initial wattage is significant, but agreed, the decay saves him.
But, whatever.