Driving relay connected to 5v or 6v

Started by JimInWoodstock, February 17, 2015, 04:29:43 PM

JimInWoodstock

I am attaching a simple schematic with a moteino to relay connection. The relay coil is 350 ohms so there is no problem with the current. Can I connect as show in the diagram to a voltage greater than the 3.3v powering the moteino? This should work, but I could not find a spec for max voltage to an output pin.So I thought I would ask before "blowing up" the chip if this is a problem.

TomWS

#1
Quote from: JimInWoodstock on February 17, 2015, 04:29:43 PM
I am attaching a simple schematic with a moteino to relay connection. The relay coil is 350 ohms so there is no problem with the current. Can I connect as show in the diagram to a voltage greater than the 3.3v powering the moteino? This should work, but I could not find a spec for max voltage to an output pin.So I thought I would ask before "blowing up" the chip if this is a problem.
Sorry, Jim, this will blow out the Moteino since the pin voltage can't go above 3.3V.

Choices are many, but the simplest and easiest to find is an NPN transistor to drive the relay (collector to the relay/diode - good that you included that, emitter to ground, and the base of the transistor connected to a Moteino pin through a resistor).  The resistor can be reasonably large given that you're only pulling about 14 mA for the relay and the transistor DC gain is probably better than 30 so, 2.6V * (0.014/30) is approximately 5.6K ohm resistor - go with 4.7K and you'll be fine.

Tom
PS: it's good that you asked!
PPS: note that the transistor will pull current (turn ON the relay) with a HIGH signal.