I need to know switch voltage of some relays, I've got an Analog output from 0 to 5V.
Relays have nominal Voltage variable: 12V, 36V, 48V.
What do you think it can be the best method to do it?
I thought i can generate an increasing voltage and record voltage output when relay switches. But how can i do to amplify analog output voltage to nominal voltage for all kind of devices??
The standard method is to have a supply voltage at the relay coil rated voltage. Then use a low side switch. Put one lead of the relay coil to the power rail. Put the other lead of the relay coil to the collector/drain of a transistor. Put the emitter/source of the transistor to ground. Put the base/gate to your 0, 5V control through a resistor.
This can be done with a resistor, a transistor and a diode. Use the resistor to current limit the ouput of the 5 volt I/O pin. Use a switching transistor rated for the voltage you need, and use the diode across the relay coil inputs to avoid frying the transistor or i/o pin from the EMF spike voltage when the coil de-energizes. The diode is A MUST HAVE. The voltage generated by a relay coil when it's suddenly de-energized can be several hundred volts. The diode effectivly shorts the relay out when the voltage tries to reverse itself. This will cause a transistor to fail after very short periods of time and fry i/o ports on a micro controller after even brief exposure.