Driving a Relay Module

Hi all.

I have been looking at a way to use Arduino to switch on & off automatically a LED lamp using a SONGLE
SRD-05VDC-SL-C relay module.

My investigation showed me that a SONGLE relay of this nature, the coil needs approx 90Ma to operate @ 5 vdc, as the Arduino UNO is rated at 20Ma per pin 5vdc, i assumed the UNO was not powerful enough to drive it, but if you GOOGLE, "Arduino Uno + Songle SRD-05VDC-SL-C" it comes up with loads of examples on how to do this, complete with Schematics and sketches, how can this be when looking at the specs of each piece of equipment they are not compatible?

Usually, those things are supplied on a little board that you provide power to separately. All the Arduino has to do is drive an optoisolator to control the relay.

It's because this is usually a hobby, not commercial engineering. People do all kinds of dumb things. Frequently they share those mistakes on showcase websites. Some circuit mistakes will work under certain circumstances, but not others. Those will pass as a hobby enterprise but would be a complete engineering failure in a commercial or research setting.

For example, I've powered a small servo directly from an UNO. But you can't get away with this for larger servos because the motor noise gets into the Arduino power supply. Thus even the small servo can not be considered reliable in that configuration, only good to experiment a bit and then take it apart to put back in the parts bin.

So do you have a module, or just the relay? Have you purchased it yet, or just choosing?

You should get a relay module which will include the necessary driver transistor to control it from an Arduino pin. But note, you need a 5 V power supply to operate both the Arduino and the relay module. A USB "phone charger", generally rated at either 1 Amp or 2.1 Amp, is a very convenient form of 5 V power supply.

gresleyman:
Hi all.

I have been looking at a way to use Arduino to switch on & off automatically a LED lamp using a SONGLE
SRD-05VDC-SL-C relay module.

My investigation showed me that a SONGLE relay of this nature, the coil needs approx 90Ma to operate @ 5 vdc, as the Arduino UNO is rated at 20Ma per pin 5vdc, i assumed the UNO was not powerful enough to drive it, but if you GOOGLE, "Arduino Uno + Songle SRD-05VDC-SL-C" it comes up with loads of examples on how to do this, complete with Schematics and sketches, how can this be when looking at the specs of each piece of equipment they are not compatible?

That is correct if you use a I/O pin.
The 5V pin can supply more and 90mA should be in its capabilities.
How do you aim to power your project?
Thanks.. Tom... :slight_smile:

I was hoping to use a Relay Module, the power supply will be a 12 vdc battery, reduced by an LM317 voltage reducer, set to approx 9 vdc for the UNO

Why a 12 V battery?

OK, I suppose the LED lamp runs on 12 V.

To operate on 12 V, you would want to use a switchmode "buck" converter to drop it to the 5 V that the Arduino uses. You may get away with using the on-board regulator if the relay is the only other thing attached to the "5V" pin.

The thing is, a UNO is a very bad choice for battery operation as you are wasting power on the USB interface chip and a few other bits and pieces. You want a Pro Mini which has only the ATmega328 and some LEDs - as well as the regulator which you do not need and may draw some current in the low milliamps or microamps, significant if you sleep the processor.

Of course, you have not properly explained the purpose of the project, how you propose to charge the battery and what other things you propose to attach.