Hallo.
Getting old, forgot some basic things, need help to design the values for a simple circuit.
One of the Arduinos pin out digital shall draw a relay. Please help me to decide the value for the R1 and the transistor. Coil takes 50 mA and resistans is 220 Ohms. The transistor should switch to bottom, fully open, or closed like a switch. Do I need some more components? Or other T1?
Thank you for answers and greetings from Sweden, (I´m a little old fashion....)
After I posted the question above I learned the output from the A. is max 40 mA and found a type of solution at the Playground.
But I also found a new "trouble"/problem. What if the Arduino is switched off. In that case they relay must NOT pull. The pin out is "floating" when powered off? I do not understand this well.
Someone smarter than me can answer?
"floating" means that the output is not able to source or sink current (it is open sort of). It is the third state in tri-state. The relay connected to a floating output will not be energized.
I use a 2n2222 or 2n3904 transistor for this type of circuit (small signal NPN). A 1K resistor to the base form the Arduino. For the diode use 1n4001. A high on the Arduino pin will turn the transistor on and energize the solenoid.
Thank You so much groundfungus!
It´s solved now.