Arduino digital pin not triggering 5v relay when powered by 9v battery

Hello all, I am very new to the world of Arduino, so please be gentle, haha.

The issue I seem to be having is that I have a relay I am trying to trigger with my arduino duemilanove, but it won't work when the arduino is powered by a 9v battery.

It works perfectly fine when I power the board with the USB connecction (either from my PC or a USB wall wart), but when I switch to the barrel jack with a 9v battery the relay won't close when I set the digital pin to which the relay's signal line is connected.

I do know that this particular relay runs on 5v logic, so I'm thinking (probably incorrectly) that maybe to conserve power the Arduino switches to 3.3v logic when its on battery power?

If anyone could please give me any advice, I would greatly appreciate it.

Thanks

I suspect that your relay need more current than the 40 mA ABSOLUTE MAXIMUM the Arduino pin can provide. You will need a transistor switch to increase the current through the relay.

Probably the wimpy 9 volt battery is unable to supply the current that the relay wants. A couple of rules of thumb I live by with Arduinos is

  1. Never use a 9 Volt battery to run motors, relays, solenoids, and death ray guns.
  2. Never directly connect the above to an Arduino pin. (Use a transistor or mosfet to do the heavy lifting).

so I'm thinking (probably incorrectly) that maybe to conserve power the Arduino switches to 3.3v logic when its on battery power?

You are right to think that this is probably incorrectly, as it is totally incorrect.

Driving a relay direct from a pin takes a special sort of relay a low current one, one that takes less than 40mA. Even if you have one of these, you need a diode across the relay to prevent the back EMF generated when you turn off the current from destroying or at best damaging your Arduino.

What sort of Arduino are we talking about because if it is a 3V3 sort of Arduino then they can supply even less current than the 40mA of a Uno.

Show your relay. Is it a bare relay or is it a relay module?
Either way, the Arduino pin for signal is not what should be powering the coil.

I suppose I need to clarify, I am not driving the relay directly from the Arduino pin, the relay sits on a sparkfun 'Inline Power control' board, I have the power from it connected to 5v on the Arduino and the ground to ground, and then the signal line connected to a digital pin on the Arduino.

Hi,
Is your 9V battery one of these?

It will not be able to power the arduino for long and the relay will not help.
Do you have a DMM to measure the battery volts when you use it?

Tom.... :slight_smile:

Hi,
Can you provide a link to the "sparkfun 'Inline Power control' board"

Please.. Tom... :slight_smile:

A DMM is on my list of things to pick up as I get further into working with the arduino, I'll have to see if I can pick one up tomorrow and measure the battery.

Tom,
I believe that inline power control board I have has been discontinued and replaced with this

Sparkfun Beefcake Relay

Hi,
Thanks mate, the spec-sheet for that relay quotes 185mA as coil current for 5V model.

When you power from USB or 5V PlugPack those supplies can provide the current necessary, >1A.

When using a 9V supply through the DC Socket, you are using an onboard 5V regulator, this has limited capacity and really should not be used to power output devices.
Your 9V battery has no hope of supplying that current and keeping its output voltage high enough for the DC-Socket, which is about 8V minimum.

A USB PlugPack is your best bet.

Tom... :slight_smile: