Switching 5v Relay w/Arduino - NPN switch Problems

Hey all,

I’m clunking my head on the table trying to get this circuit to work. I’m trying to drive a 5v relay with the Arduino to switch a 12v solenoid circuit. Originally, I just was driving the relay straight from a digital output pin and it worked fine. But, with further investigation I found that is the incorrect way to do it because you could fry a pin. So, I set up a NPN transistor circuit according to:

http://www.arduino.cc/playground/upload … relays.pdf

I can drive an LED with this setup, but that’s about it. If I power from the Arduino 5v output, I can only get about 2.5v across the relay coil. So, I tried using a 12v adapter and I still seem to only get about 2.5v across the relay coil. Seems weird to me. I’ve messed around with switching grounds around and base resistor values. I have all the grounds connected and running to both the Arduino ground and the ground from my 12v switching supply. Maybe its the transistor I’m using?

I’m using the 5v relay from SparkFun

http://www.sparkfun.com/products/100

and a KSP2222A Transistor

http://www.datasheetcatalog.org/datashe … P2222A.pdf

Any ideas? Thanks for the help!

Ah, I hate to do this, but it is bittersweet. After screwing with this all day and posting here, by buddy and I just started over from scratch and we got it to work fine. Not sure what I was doing.

Disaster averted. 8)

you can use an optoisolator to isolate the arduino output and the 12V selenoid circuit and a powertransistor (BD135) to trigger the selenoid

the Sharp PC817 http://www.datasheetcatalog.org/datashe … Xqyrss.pdf is both cheap and easy to use.