Go Down

Topic: 4n35 Optocoupler as Switch (Read 1 time) previous topic - next topic

Tinkering

So you're going to buy a relay with 12V coil(s), you will need transistor(s) to switch the 12V coil current with the 3.3V esp-12e outputs. Correct?
actually the coil is 5v and going to switch the 12v on the com side

Tinkering

#16
May 07, 2018, 03:50 am Last Edit: May 07, 2018, 04:06 am by Tinkering
Been researching relays more.   What im looking for is a 5vdc relay that will latch to apply 12vdc to a dc device.  I want the relay to not require power so my circuit is energy efficient.  The relay will be driven by an esp-12e.  Is below the relay I should've used?

https://www.ebay.com/itm/1-pc-Bistable-latching-2-coil-relay-5V-coil-16A-contact-SPDT-RT314F05/362154527599?hash=item5452178b6f:g:9FAAAOxyY3ZRkQUO

or

https://www.ebay.com/itm/Bistable-Latching-DPDT-8A-Power-Relay-Module-DC5V-Coil/191122298692?_trkparms=aid%3D555019%26algo%3DPL.BANDIT%26ao%3D1%26asc%3D50686%26meid%3D68a7e9ddbf9b4c78b78e8087b5271c89%26pid%3D100754%26rk%3D1%26rkt%3D1%26%26itm%3D191122298692&_trksid=p2045573.c100754.m4842

outsider

Do you have a 5V power supply for the relay coils? How are you going to switch the 5V, 110 mA pulse required by the coils with 3.3V outputs? That relay is available in a 3V version but you still face the problem of switching a high current (probably around 180 mA at 3V) with a 12 mA rated output, even though it should be a short (10 mS) pulse?

Tinkering

Do you have a 5V power supply for the relay coils? How are you going to switch the 5V, 110 mA pulse required by the coils with 3.3V outputs? That relay is available in a 3V version but you still face the problem of switching a high current (probably around 180 mA at 3V) with a 12 mA rated output, even though it should be a short (10 mS) pulse?
have cars 12vdc, so have power.  After that part Im a novice with relays on the esp-12e.  Though I see a ton of people using a regular srd-5vdc which takes a similar voltage to switch?

http://www.circuitbasics.com/wp-content/uploads/2015/11/SRD-05VDC-SL-C-Datasheet.pdf

avr_fred

#19
May 07, 2018, 05:46 am Last Edit: May 07, 2018, 05:48 am by avr_fred
If you go with the 12 volt version of the relay, you can drive it directly from two esp8266 outputs and the power is supplied by the vehicle.

All that aside, if the device you're powering is on when the esp8266 is on, you can create a high side switch with p channel mosfet which would eliminate the need for the rather expensive relay. That's just a guess though as you've never explained what you're doing with the 8266 and the device being controlled by the relay.

Tinkering

#20
May 07, 2018, 12:31 pm Last Edit: May 07, 2018, 04:15 pm by Tinkering
If you go with the 12 volt version of the relay, you can drive it directly from two esp8266 outputs and the power is supplied by the vehicle.

All that aside, if the device you're powering is on when the esp8266 is on, you can create a high side switch with p channel mosfet which would eliminate the need for the rather expensive relay. That's just a guess though as you've never explained what you're doing with the 8266 and the device being controlled by the relay.
I apologize for not giving all the information or a good schematic.  Was trying to keep it short and simple but missed the details and was hoping to clarify as needed.

What Im doing with the esp-12e is control a 12vdc 7W device in a car.  The esp-12e and 12vdc 7W device will always be in the vehicle.  The esp-12e will turn the device on and off based on a schedule.

EDIT: Thank you for mentioning high side switch.  I found the below, which appears to do what i want without a relay.  Being that I have a 2n3904 I would need an irf510n.
 https://electronics.stackexchange.com/questions/281992/nodemcu-to-control-mosfet-not-enough-voltage

larryd

Quote
Was trying to keep it short and simple but missed the details and was hoping to clarify as needed.
NEVER try to keep it sort and simple.

NEVER clarify as needed.

ALWAYS share your information if you want someone to help you!



No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

avr_fred

#22
May 07, 2018, 09:01 pm Last Edit: May 07, 2018, 09:02 pm by avr_fred
The IRF510 is a N channel device, it will not work as a high side switch. You need a p channel device wired something like this:


Tinkering

The IRF510 is a N channel device, it will not work as a high side switch. You need a p channel device wired something like this:


Thank you for this. One last question why choose this over a low side switch?  Switching ground on and off is another avenue I could pursue right?

avr_fred

Quote
Switching ground on and off is another avenue I could pursue right?
Maybe yes, maybe no.

Without knowing what you're switching on and off, a high side switch will always work because it opens the supply, like a relay would. A low side switch, effectively disconnecting the ground, may have other current paths to ground which will result in undesired current flow when the device is disconnected from its supply ground.

It's all a matter of what you're trying to control which is still known only to yourself.


Tinkering

Maybe yes, maybe no.

Without knowing what you're switching on and off, a high side switch will always work because it opens the supply, like a relay would. A low side switch, effectively disconnecting the ground, may have other current paths to ground which will result in undesired current flow when the device is disconnected from its supply ground.

It's all a matter of what you're trying to control which is still known only to yourself.


its a 12vdc 7W GPS device that Im controlling power to.

Wawa

its a 12vdc 7W GPS device that Im controlling power to.
This should have been mentioned in post#0.

If the data pins of this device are also connected to the Arduino, then you can't just switch off power to the device.
The device could be phantom-powered through the data pins, and that could be a danger to the GPS and/or the Arduino.
Post a link to the GPS, and a full diagram showing all connections.
Leo..

Tinkering

#27
May 10, 2018, 03:51 am Last Edit: May 10, 2018, 04:13 am by Tinkering
I downloaded fritz and drew up a diagram.  Might be missing a diode protecting power to ground on the device and resistor on trigger to gate.   Below should be an imgur link.  The power for the nodemcu (esp-12e) will come from a usb to the car battery.  For mosfet Ill either use a TIP120 or IRLZ44N .   A link to the device Im using is below and I want to leave a 100ma capacity for adding a smaller device of similar power configuration.

https://cradlepoint.com/products/cor-ibr1100-series#!specs

https://imgur.com/Ypryo6A

TomGeorge

I downloaded fritz and drew up a diagram.  Might be missing a diode protecting power to ground on the device and resistor on trigger to gate.   Below should be an imgur link.  The power for the nodemcu (esp-12e) will come from a usb to the car battery.  For mosfet Ill either use a TIP120 or IRLZ44N .   A link to the device Im using is below and I want to leave a 100ma capacity for adding a smaller device of similar power configuration.

https://cradlepoint.com/products/cor-ibr1100-series#!specs

https://imgur.com/Ypryo6A
Sorry, but you will be better off drawing your circuit by hand and posting a picture of it.
Fritzy images are pretty hopeless as they don't reperesent the components properly, or labels for component leads/pins.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html
It will show you how to post images.

Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up