Output pin cannot drive a relay

Arduino Mega2560, powered by USB

Relay spec:
http://www.weclonline.com/downloads/pdf/07-08-0005.pdf
Supply voltage above 3.75V or supply current maximum 10mA is enough to turn the relay on

Situation

  1. Output pin set to HIGH, measure the output under open circuit by DMM, output voltage ~5V
  2. Output pin connected to the relay coil input, voltage dropped to ~0.07V, which cannot turn it on
  3. Different pins have been tested, all failed; BUT using onboard fixed 5V output pin to drive the relay, WORKS
  4. Using DC supply to test the relay, operation is fine with the coil current much below 40mA

Under the condition of 3 and 4, it is believed that the circuit has no problem
Seems the problem is on the Arduino but I cannot figure out the reason
Is the USB power supply not enough? Or is there any other reason?

thanks :roll_eyes:

Or is there any other reason?

Post your testing code and we will see. Possibly you forgot to set the pin mode to output?

Lefty

Maybe you have not set your pin to be an output. You could be seeing only the current from the pull-up circuit.

Conventionally, you would wire a TTL level relay between your output pin with the other leg going to +5V. Then put the output pin LOW to turn on the relay. Typically TTL logic outputs generate +5 via a pull-up resistor or similar weak current source.

Despite whether your relay coil can operate with small currents, I would still recommend using a transistor to drive it. There are plenty of examples and discussions in the playground and forums. Here's a couple of hits that I got:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1289431549
http://didier.longueville.free.fr/arduinoos/?p=2308

after setting the pinMode, the circuit works fine finally
thanks 8)