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.
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.