I have an electromagnet that I want to be activated for two seconds as soon as I turn the power on. I think that this can be done by connecting the electromagnet to the power source in a series with a capacitor and a resistor. As soon as the power is turned on the EM would work until the capacitor gets charged up and cuts off the circuit. Is that true? If so, how do I calculate the sizes of the resistor and capacitor that I need?