I used the attached circuit to switch relay from MCU. the relay switched but after couple of times it doesn't switch till i disconnected the input and trigger it. i hear sound of the relay isn't able to switch completely sometimes when i connect the input what is the problem?
the relays are connected in that manner to reverse motor direction.
The 2n2222 has a gain of 100 ( min value ) the coil will be 65mA so theoretically it will work as is... There must be a capacitive build up on the circuit.. But The 2n2222 will drive better.. It's a 1A device so to saturate it I would give it 10mA on the base.. A 470 will give @ 9mA..
If I'm talking rubbish, someone else will pipe in with other answers..
I would guess that the MCU is crashing due to a noisy power supply. Do you have good decoupling? If the motor has inertia then when you reverse it you turn it momentarily into a generator and that can cause big problems - lots of big capacitors needed.
You need to be more precise in the description of the fault. You say the "relays don't switch" Is the problem that they don't switch on or or they don't switch off ? What is the voltage across the coil in the energised and unenergised state both at first when they are working and when they are not working ?
Edit. Jim,I have justs noticed your post #11. I thought the same as you at first but mah gives the part number written on the relay as "arp03f-1c-5vdc" and there is a link to the datasheet in his link. From this the relay does look to have the correct spec.
Are you sure the base is +1.3 volts with respect to the emitter ? Are you sure you are not measuring between the emitter and the right hand end of the 1K resistor ?
Relay coil current and collector voltage as a function of transistor beta:
Shouldn't be a problem.
Take the just the relay, connect it to a variable DC supply. Slowly increase the voltage. Record the voltage at which the relay pulls in. Slowly decrease the voltage. Record the voltage where the relay relay armature releases.