Alternative to relays

I'm currently using a 4 relay standard module powered by a 5v add. Supply, as wemos D1 will not supply enough current. I was wondering if I can use another solution that draws less current than 70 ma per relay so I can ditch my add power supply.

The three relays are driving 12v DC (2 of then), and one is just a connection off/on , as I've soldered to contacts on a remote control button to control it remotely.

joerack:
...as wemos D1 will not supply enough current.

How did you come to that conclusion?
Leo..

If I run the command to control my relays and they're powered by wemos, only the relay's led will go on.

If the relays are powered by external source, then both led and relay will switch

For lower power solutions probably a transistor would suffice, but if you have 12v available, using 12v relays driven by transistors can be a solution.

joerack:
If I run the command to control my relays and they're powered by wemos, only the relay's led will go on.

There is the problem. The WeMOS has no power "output" to power anything, only an input for 5 V which also corresponds to the USB connector (albeit via a diode).

We conclude that you (a) do not understand what you are doing and (b) are not correctly describing whatever it was you attempted to do. :astonished:

Paul__B:
We conclude that

‘pluralis majestatis’ isn’t it, not that you haven’t earned it :wink:
and actually an ‘obsolete’ ULN2803 would be the easiest solution

Must be having a bad day. What’s being switched? So far I get it’s 12V but what the current being switched?

I thought that powering wemos via USB and taking 5v for the relay from 5v pin, would have been the same thing as doing this.

https://goo.gl/images/9eTqLJ

I'm quite knew to wemos, and always powered my modules directly with Arduino.. maybe I'm missing something here..
Care to share?

I’m switching electromagnetic contacts of <1A 12vdc. Would a tip120 be ok?

You need to research switching options. It’s pretty complicated to go through all the options and pros and cons. It could work but I don’t think it’s the most efficient solution is a short anaswer.

joerack:
I’m switching electromagnetic contacts of <1A 12vdc. Would a tip120 be ok?

Yes, its rated at 60V and 4A. Assuming you are low-side switching, and use a free-wheel diode
across the electromagnet, as its a highly inductive load.

OP didn’t tell us how the WeMos D1 is powered (probably didn’t read the “how to post” pages).
If through USB, then about 400mA should be available on the 5volt pin,
because the Wemos circuitry itself uses about 100mA.
If powered through the DC socket, then I guess the same or more is available.
The WeMos specs don’t say how much the 5volt switching supply can deliver.
They don’t even have the model of the chip listed on the schematics.
My educated guess is that powering four ~75mA relays shouldn’t be a problem.
Leo…

Edit:
More confusion. I just saw the link to an image with a WeMos D1 mini (NOT a WeMos D1).
That changes part of the story. So what is it…
It shouldn’t be a problem to draw 300mA from the 5volt pin (~4.6volt) of a D1 mini on USB supply.

Wawa:
It shouldn't be a problem to draw 300mA from the 5volt pin (~4.6volt) of a D1 mini on USB supply.

isn't a Wemos similar to an ESP ? then leaving only 200mA for powering it will cause problems during wifi connection & transmit.

joerack:
I thought that powering wemos via USB and taking 5v for the relay from 5v pin, would have been the same thing as doing this.


Well, almost - you do have the voltage drop of the diode to consider which may be a problem and you have not explained what you plugged into the USB port to provide power.

joerack:
I'm quite knew to wemos, and always powered my modules directly with Arduino.. maybe I'm missing something here..
Care to share?

Well, "powering directly with Arduino" does not really make sense. The Arduino is not a power supply. If you feed power into the "Barrel jack", the on-board regulator can only supply a very limited current due to lack of heatsinking and feeding 12 V in is really stretching the friendship.

The WeMOS D1 R2 - as against the Mini - which Wawa had in mind, and the RoboRed derivative of the UNO have a proper on-board switchmode regulator which can provide a usable 5 V supply to other devices but the UNO derives from a very old concept where "9 V" - unregulated - "plug packs" or "wall warts" were common and could power the Arduino as a simple demonstration - as long as you never connected anything more than a few LEDs or simple sensors.

Now, USB "phone chargers" are common with nominal ratings of 2.1 A to mach the Ipad. Plugging into the USB is convenient but whatever diode or polyswitch lies between the jack and the "5V" pin may be a problem; if you can simply wire your 5 V to the 5 V pin and your other devices, that will be most reliable.

Also, it would be useful to know what your "4 relay standard module" is in terms of how it needs to be connected to an ESP.

thanks for the explanation. I have a songle SRD-05VDC-Sl-C.
I am using a 2A 5v power supply as external for the relay module.

Come to think of it, I'm doing some research about optoisolation, and it seems that I can isolate (optoisolation) and separate the two power supplies i need to remove jd-vcc/vcc jumper and feed only jd-vcc.
Thing is that I can see in the module only a jd-vcc pin, should there also be an Isolated gnd?

joerack:
Thing is that I can see in the module only a jd-vcc pin, should there also be an Isolated gnd?

No, because the Arduino is only connected by Arduino 5V to relay module Vcc and Arduino i/o pin to relay module INx pins. The Arduino ground is never connected to the relay module in the case of the jumper being removed.

why don't you remove the usb or 5v from the Arduino and power the arduino from the separate supply ?

Please look at the image I posted. There's no way of separating the gnds with that module. Unless where the input pins are, I connect ext part supply and instead of Arduino s

https://goo.gl/images/U6YGQp

Ok, this should work with 4 relays module.

joerack:
Please look at the image I posted. There’s no way of separating the gnds with that module.

Was that to me, joerack?

The question of “separating the grounds” is irrelevant: there is only one ground, the one from the external supply. The Arduino doesn’t need to have its ground to the relay module, since all you do in the module is turn on an LED inside the opto-isolator, and that needs only the Arduino Vcc and a low on the data line; just like any other LED connected to an Arduino.